Browse Source

wxGUI: make wx.BusyInfo compatible with wxPython 4

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72456 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 7 years ago
parent
commit
f337b9f4a8

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

@@ -539,7 +539,7 @@ class AnimationController(wx.EvtHandler):
 
         images = []
         busy = wx.BusyInfo(
-            message=_("Preparing export, please wait..."),
+            _("Preparing export, please wait..."),
             parent=self.frame)
         wx.Yield()
         lastBitmaps = {}
@@ -621,7 +621,7 @@ class AnimationController(wx.EvtHandler):
 
         # export
         pilImages = [WxImageToPil(image) for image in images]
-        busy = wx.BusyInfo(message=_("Exporting animation, please wait..."),
+        busy = wx.BusyInfo(_("Exporting animation, please wait..."),
                            parent=self.frame)
         wx.Yield()
         try:

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

@@ -1594,7 +1594,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             else:
                 flags = "a"
 
-            busy = wx.BusyInfo(message=_("Rectifying images, please wait..."),
+            busy = wx.BusyInfo(_("Rectifying images, please wait..."),
                                parent=self)
             wx.Yield()
 
@@ -1608,7 +1608,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                                   method=self.gr_method,
                                   flags=flags)
 
-            busy.Destroy()
+            del busy
 
             # provide feedback on failure
             if ret != 0:
@@ -1639,7 +1639,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 ret = msg = ''
 
                 busy = wx.BusyInfo(
-                    message=_("Rectifying vector map <%s>, please wait...") %
+                    _("Rectifying vector map <%s>, please wait...") %
                     vect, parent=self)
                 wx.Yield()
 
@@ -1652,7 +1652,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                                       group=self.xygroup,
                                       order=self.gr_order)
 
-                busy.Destroy()
+                del busy
 
                 # provide feedback on failure
                 if ret != 0:

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

@@ -1660,7 +1660,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             else:
                 flags = "a"
 
-            busy = wx.BusyInfo(message=_("Rectifying images, please wait..."),
+            busy = wx.BusyInfo(_("Rectifying images, please wait..."),
                                parent=self)
             wx.Yield()
 
@@ -1674,7 +1674,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                                   angle=self.grwiz.cam_angle,
                                   flags=flags)
 
-            busy.Destroy()
+            del busy
 
             # provide feedback on failure
             if ret != 0:
@@ -1705,7 +1705,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 ret = msg = ''
 
                 busy = wx.BusyInfo(
-                    message=_("Rectifying vector map <%s>, please wait...") %
+                    _("Rectifying vector map <%s>, please wait...") %
                     vect, parent=self)
                 wx.Yield()
 
@@ -1718,7 +1718,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                                       group=self.xygroup,
                                       order=self.gr_order)
 
-                busy.Destroy()
+                del busy
 
                 # provide feedback on failure
                 if ret != 0:

+ 4 - 5
gui/wxpython/lmgr/frame.py

@@ -1393,7 +1393,7 @@ class GMFrame(wx.Frame):
                 filename)
             return
 
-        busy = wx.BusyInfo(message=_("Please wait, loading workspace..."),
+        busy = wx.BusyInfo(_("Please wait, loading workspace..."),
                            parent=self)
         wx.Yield()
 
@@ -1501,8 +1501,7 @@ class GMFrame(wx.Frame):
             else:
                 maptree.SelectItem(layer, select=False)
 
-
-        busy.Destroy()
+        del busy
 
         # set render property again when all layers are loaded
         for i, display in enumerate(gxwXml.displays):
@@ -1565,7 +1564,7 @@ class GMFrame(wx.Frame):
         if not self.currentPage:
             self.NewDisplay()
 
-        busy = wx.BusyInfo(message=_("Please wait, loading workspace..."),
+        busy = wx.BusyInfo(_("Please wait, loading workspace..."),
                            parent=self)
         wx.Yield()
 
@@ -1579,7 +1578,7 @@ class GMFrame(wx.Frame):
                                        lcmd=layer['cmd'],
                                        lgroup=layer['group'])
 
-            busy.Destroy()
+        del busy
 
         if maptree:
             # reverse list of map layers

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

@@ -698,7 +698,7 @@ class BufferedMapWindow(MapWindowBase, Window):
         self._fileType = FileType
         self._saveToFileCallback = callback
 
-        self._busy = wx.BusyInfo(message=_("Please wait, exporting image..."),
+        self._busy = wx.BusyInfo(_("Please wait, exporting image..."),
                                  parent=self)
         wx.Yield()
 
@@ -758,7 +758,6 @@ class BufferedMapWindow(MapWindowBase, Window):
             self.pdcVector.DrawToDC(dc)
         ibuffer.SaveFile(self._fileName, self._fileType)
 
-        self._busy.Destroy()
         del self._busy
         del self._fileName
         del self._fileType

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

@@ -1549,7 +1549,7 @@ class VectorColorTable(ColorTable):
             return
 
         busy = wx.BusyInfo(
-            message=_("Please wait, loading data from attribute table..."),
+            _("Please wait, loading data from attribute table..."),
             parent=self)
         wx.Yield()
 
@@ -1570,7 +1570,7 @@ class VectorColorTable(ColorTable):
                              stdout=outFile)
         else:
             self.preview.EraseMap()
-            busy.Destroy()
+            del busy
             return
 
         outFile.seek(0)
@@ -1620,7 +1620,7 @@ class VectorColorTable(ColorTable):
                     readvals = True
                     dlg.Destroy()
                 else:
-                    busy.Destroy()
+                    del busy
                     dlg.Destroy()
                     self.updateColumn = False
                     return
@@ -1636,7 +1636,7 @@ class VectorColorTable(ColorTable):
         else:
             self.rulesPanel.Clear()
 
-        busy.Destroy()
+        del busy
 
     def SetRangeLabel(self):
         """Set labels with info about attribute column range"""

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

@@ -188,7 +188,7 @@ class BufferedWindow(wx.Window):
         file. See the wx.Windows docs for wx.Bitmap::SaveFile for the
         details
         """
-        busy = wx.BusyInfo(message=_("Please wait, exporting image..."),
+        busy = wx.BusyInfo(_("Please wait, exporting image..."),
                            parent=self)
         wx.Yield()
 
@@ -204,7 +204,7 @@ class BufferedWindow(wx.Window):
         self.pdc.DrawToDC(dc)
         ibuffer.SaveFile(FileName, FileType)
 
-        busy.Destroy()
+        del busy
 
     def GetImage(self):
         """Converts files to wx.Image

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

@@ -1019,7 +1019,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             else:
                 flags = "a"
 
-            busy = wx.BusyInfo(message=_("Rectifying images, please wait..."),
+            busy = wx.BusyInfo(_("Rectifying images, please wait..."),
                                parent=self)
             wx.Yield()
 
@@ -1033,7 +1033,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                                   method=self.gr_method,
                                   flags=flags)
 
-            busy.Destroy()
+            del busy
 
             # provide feedback on failure
             if ret != 0:
@@ -1041,7 +1041,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 print(self.grwiz.src_map, file=sys.stderr)
                 print(msg, file=sys.stderr)
 
-            busy = wx.BusyInfo(message=_("Writing output image to group, please wait..."),
+            busy = wx.BusyInfo(_("Writing output image to group, please wait..."),
                                parent=self)
             wx.Yield()
 
@@ -1052,7 +1052,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                                   group=self.xygroup,
                                   input=''.join([self.grwiz.src_map.split('@')[0],self.extension]))
 
-            busy.Destroy()
+            del busy
 
             if ret1 != 0:
                 print('ip2i: Error in i.group', file=sys.stderr)

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

@@ -385,7 +385,7 @@ class PsMapFrame(wx.Frame):
                        'cols'], rows=event.userData['regionOld']['rows'])
             # wx.BusyInfo does not display the message
             busy = wx.BusyInfo(
-                message=_("Generating preview, wait please"),
+                _("Generating preview, wait please"),
                 parent=self)
             wx.Yield()
             try: