[GRASS-SVN] r56084 - grass/branches/develbranch_6/gui/wxpython/psmap

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 2 09:55:06 PDT 2013


Author: annakrat
Date: 2013-05-02 09:55:05 -0700 (Thu, 02 May 2013)
New Revision: 56084

Modified:
   grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
Log:
wxGUI/composer: fix showing and hiding statusbar messages (merge from trunk, r56015,r56083)

Modified: grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/frame.py	2013-05-02 16:47:30 UTC (rev 56083)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/frame.py	2013-05-02 16:55:05 UTC (rev 56084)
@@ -319,11 +319,15 @@
                     GMessage(parent = self,
                              message = _("%(prg)s exited with return code %(code)s") % {'prg': command[0],
                                                                                         'code': ret})
-
+                else:
+                    self.SetStatusText(_('PDF generated'), 0)
             except OSError, e:
                 GError(parent = self,
                        message = _("Program ps2pdf is not available. Please install it to create PDF.\n\n %s") % e)
-                
+
+        elif not event.userData['temp']:
+            self.SetStatusText(_('PostScript file generated'), 0)
+
         # show preview only when user doesn't want to create ps or pdf 
         if havePILImage and event.userData['temp'] and not event.userData['pdfname']:
             RunCommand('g.region', cols = event.userData['regionOld']['cols'], rows = event.userData['regionOld']['rows'])
@@ -363,7 +367,9 @@
         grass.try_remove(event.userData['instrFile'])
         if event.userData['temp']:
             grass.try_remove(event.userData['filename'])
-        
+            
+        wx.CallLater(4000, lambda: self.SetStatusText("", 0))
+
     def getFile(self, wildcard):
         suffix = []
         for filter in wildcard.split('|')[1::2]:
@@ -1128,6 +1134,7 @@
         self.idLinePointsTmp = (wx.NewId(), wx.NewId()) # ids of marks for moving line vertices
 
         self.resizeBoxSize = wx.Size(8, 8)
+        self.showResizeHelp = False # helper for correctly working statusbar
         
         
 
@@ -1356,9 +1363,12 @@
             if foundResize and foundResize[0] in (self.idResizeBoxTmp,) + self.idLinePointsTmp:
                 self.SetCursor(self.cursors["sizenwse"])
                 self.parent.SetStatusText(_('Click and drag to resize object'), 0)
+                self.showResizeHelp = True
             else:
-                self.parent.SetStatusText('', 0)
-                self.SetCursor(self.cursors["default"])
+                if self.showResizeHelp:
+                    self.parent.SetStatusText('', 0)
+                    self.SetCursor(self.cursors["default"])
+                    self.showResizeHelp = False
                 
     def OnLeftDown(self, event):
         """!Left mouse button pressed.



More information about the grass-commit mailing list