[GRASS-SVN] r32809 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 16 04:30:46 EDT 2008


Author: cmbarton
Date: 2008-08-16 04:30:46 -0400 (Sat, 16 Aug 2008)
New Revision: 32809

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
Bug fix for cancel method. Ported from develbranch_6

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-08-16 08:28:57 UTC (rev 32808)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-08-16 08:30:46 UTC (rev 32809)
@@ -581,7 +581,7 @@
         wx.Frame.__init__(self, parent=parent, id=ID, title=title,
                           pos=wx.DefaultPosition, style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
 
-	self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
+        self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
 
         # statusbar
         self.CreateStatusBar()
@@ -826,13 +826,18 @@
         """Cancel button pressed"""
         self.MakeModal(False)
         if self.get_dcmd:
-            try:
-                if len(self.parent.GetPyData(self.layer)[0]['cmd']) < 1:
-                    self.parent.Delete(self.layer)
-                    self.Destroy()
-            except:
+            # display decorations
+            if self.task.name == 'd.barscale' or self.task.name == 'd.legend':
                 self.Hide()
+            # canceled layer with nothing set
+            elif len(self.parent.GetPyData(self.layer)[0]['cmd']) < 1:
+                self.parent.Delete(self.layer)
+                self.Destroy()
+            # pressing OK after setting layer properties
+            else:
+                self.Destroy()
         else:
+            # cancel for non-display commands
             self.Destroy()
 
     def OnHelp(self, event):
@@ -1488,7 +1493,8 @@
         self.parent = parent
         self.grass_task = None
 
-    def ParseCommand(self, cmd, gmpath=None, completed=None, parentframe=None, show=True, modal=False):
+    def ParseCommand(self, cmd, gmpath=None, completed=None, parentframe=None,
+                     show=True, modal=False):
         """
         Parse command
 



More information about the grass-commit mailing list