Jelajahi Sumber

wxGUI: replace deprecated wx.Yield

Anna Petrasova 5 tahun lalu
induk
melakukan
0bd5a64a69

+ 2 - 2
gui/wxpython/animation/controller.py

@@ -541,7 +541,7 @@ class AnimationController(wx.EvtHandler):
         busy = wx.BusyInfo(
             _("Preparing export, please wait..."),
             parent=self.frame)
-        wx.Yield()
+        wx.GetApp().Yield()
         lastBitmaps = {}
         fgcolor = UserSettings.Get(
             group='animation',
@@ -623,7 +623,7 @@ class AnimationController(wx.EvtHandler):
         pilImages = [WxImageToPil(image) for image in images]
         busy = wx.BusyInfo(_("Exporting animation, please wait..."),
                            parent=self.frame)
-        wx.Yield()
+        wx.GetApp().Yield()
         try:
             if exportInfo['method'] == 'sequence':
                 filename = os.path.join(

+ 2 - 2
gui/wxpython/gcp/manager.py

@@ -1599,7 +1599,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
             busy = wx.BusyInfo(_("Rectifying images, please wait..."),
                                parent=self)
-            wx.Yield()
+            wx.GetApp().Yield()
 
             ret, msg = RunCommand('i.rectify',
                                   parent=self,
@@ -1644,7 +1644,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 busy = wx.BusyInfo(
                     _("Rectifying vector map <%s>, please wait...") %
                     vect, parent=self)
-                wx.Yield()
+                wx.GetApp().Yield()
 
                 ret, msg = RunCommand('v.rectify',
                                       parent=self,

+ 1 - 1
gui/wxpython/gis_set.py

@@ -579,7 +579,7 @@ class GRASSStartup(wx.Frame):
                              read=True)
 
         wx.BeginBusyCursor()
-        wx.Yield()
+        wx.GetApp().Yield()
         if vectors:
             # vector detected
             returncode, error = RunCommand(

+ 1 - 1
gui/wxpython/gui_core/forms.py

@@ -2525,7 +2525,7 @@ class CmdPanel(wx.Panel):
             # calling LoadPage() is strangely time-consuming (only first call)
             # FIXME: move to helpPage.__init__()
             if not self.manualTab.IsLoaded():
-                wx.Yield()
+                wx.GetApp().Yield()
                 self.manualTab.LoadPage()
 
         self.Layout()

+ 2 - 2
gui/wxpython/iclass/frame.py

@@ -611,7 +611,7 @@ class IClassMapFrame(DoubleMapFrame):
             return
 
         wx.BeginBusyCursor()
-        wx.Yield()
+        wx.GetApp().Yield()
 
         # close, build, copy and open again the temporary vector
         digitClass = self.GetFirstWindow().GetDigit()
@@ -763,7 +763,7 @@ class IClassMapFrame(DoubleMapFrame):
         :param bool withTable: true if attribute table is required
         """
         wx.BeginBusyCursor()
-        wx.Yield()
+        wx.GetApp().Yield()
 
         # close, build, copy and open again the temporary vector
         digitClass = self.GetFirstWindow().GetDigit()

+ 1 - 1
gui/wxpython/image2target/ii2t_gis_set.py

@@ -578,7 +578,7 @@ class GRASSStartup(wx.Frame):
                              read=True)
 
         wx.BeginBusyCursor()
-        wx.Yield()
+        wx.GetApp().Yield()
         if mapName in vectors:
             # vector detected
             returncode, error = RunCommand(

+ 2 - 2
gui/wxpython/image2target/ii2t_manager.py

@@ -1663,7 +1663,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
             busy = wx.BusyInfo(_("Rectifying images, please wait..."),
                                parent=self)
-            wx.Yield()
+            wx.GetApp().Yield()
 
             ret, msg = RunCommand('i.ortho.rectify',
                                   parent=self,
@@ -1708,7 +1708,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 busy = wx.BusyInfo(
                     _("Rectifying vector map <%s>, please wait...") %
                     vect, parent=self)
-                wx.Yield()
+                wx.GetApp().Yield()
 
                 ret, msg = RunCommand('v.rectify',
                                       parent=self,

+ 2 - 2
gui/wxpython/lmgr/frame.py

@@ -1441,7 +1441,7 @@ class GMFrame(wx.Frame):
         # the really busy part starts here (mapset change is fast)
         busy = wx.BusyInfo(_("Please wait, loading workspace..."),
                            parent=self)
-        wx.Yield()
+        wx.GetApp().Yield()
 
         #
         # load layer manager window properties
@@ -1612,7 +1612,7 @@ class GMFrame(wx.Frame):
 
         busy = wx.BusyInfo(_("Please wait, loading workspace..."),
                            parent=self)
-        wx.Yield()
+        wx.GetApp().Yield()
 
         maptree = None
         for layer in ProcessGrcFile(filename).read(self):

+ 1 - 1
gui/wxpython/mapwin/buffered.py

@@ -701,7 +701,7 @@ class BufferedMapWindow(MapWindowBase, Window):
 
         self._busy = wx.BusyInfo(_("Please wait, exporting image..."),
                                  parent=self)
-        wx.Yield()
+        wx.GetApp().Yield()
 
         self.Map.ChangeMapSize((width, height))
         renderMgr = self.Map.GetRenderMgr()

+ 1 - 1
gui/wxpython/modules/colorrules.py

@@ -1552,7 +1552,7 @@ class VectorColorTable(ColorTable):
         busy = wx.BusyInfo(
             _("Please wait, loading data from attribute table..."),
             parent=self)
-        wx.Yield()
+        wx.GetApp().Yield()
 
         columns = self.properties['sourceColumn']
         if self.properties['loadColumn']:

+ 1 - 1
gui/wxpython/modules/histogram.py

@@ -190,7 +190,7 @@ class BufferedWindow(wx.Window):
         """
         busy = wx.BusyInfo(_("Please wait, exporting image..."),
                            parent=self)
-        wx.Yield()
+        wx.GetApp().Yield()
 
         self.Map.ChangeMapSize((width, height))
         ibuffer = EmptyBitmap(max(1, width), max(1, height))

+ 1 - 1
gui/wxpython/nviz/animation.py

@@ -211,7 +211,7 @@ class Animation:
                     height=size[1])
                 self.currentFrame += 1
 
-                wx.Yield()
+                wx.GetApp().Yield()
                 toolWin.UpdateFrameIndex(
                     index=self.currentFrame, goToFrame=False)
             else:

+ 1 - 1
gui/wxpython/nviz/tools.py

@@ -3440,7 +3440,7 @@ class NvizToolWindow(FN.FlatNotebook):
         if not self.mapWindow.init:
             return
 
-        wx.Yield()
+        wx.GetApp().Yield()
 
         # find attribute row
         attrb = self.__GetWindowName(self.win['surface'], event.GetId())

+ 2 - 2
gui/wxpython/photo2image/ip2i_manager.py

@@ -1022,7 +1022,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
             busy = wx.BusyInfo(_("Rectifying images, please wait..."),
                                parent=self)
-            wx.Yield()
+            wx.GetApp().Yield()
 
             ret, msg = RunCommand('i.rectify',
                                   parent=self,
@@ -1044,7 +1044,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
             busy = wx.BusyInfo(_("Writing output image to group, please wait..."),
                                parent=self)
-            wx.Yield()
+            wx.GetApp().Yield()
 
             ret1, msg1 = RunCommand('i.group',
                                   parent=self,

+ 1 - 1
gui/wxpython/psmap/frame.py

@@ -411,7 +411,7 @@ class PsMapFrame(wx.Frame):
             busy = wx.BusyInfo(
                 _("Generating preview, wait please"),
                 parent=self)
-            wx.Yield()
+            wx.GetApp().Yield()
             try:
                 im = PILImage.open(event.userData['filename'])
                 if self.instruction[self.pageId]['Orientation'] == 'Landscape':

+ 1 - 1
gui/wxpython/rlisetup/sampling_frame.py

@@ -260,7 +260,7 @@ class RLiSetupMapPanel(wx.Panel):
         tmpraster = "rast_" + pname
         tmpvector = "vect_" + pname
         wx.BeginBusyCursor()
-        wx.Yield()
+        wx.GetApp().Yield()
         RunCommand('r.in.poly', input=polyfile.name, output=tmpraster,
                    rows=region_settings['rows'], overwrite=True)
 

+ 1 - 1
gui/wxpython/wxgui.py

@@ -99,7 +99,7 @@ class GMApp(wx.App):
                     parent=None,
                     id=wx.ID_ANY)
 
-        wx.Yield()
+        wx.GetApp().Yield()
 
         # create and show main frame
         from lmgr.frame import GMFrame