[GRASS-SVN] r32808 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Aug 16 04:28:57 EDT 2008
Author: cmbarton
Date: 2008-08-16 04:28:57 -0400 (Sat, 16 Aug 2008)
New Revision: 32808
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
Trying again to fix bugs in cancel method for menuform.py. Hopefully, this got them.
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2008-08-16 07:34:35 UTC (rev 32807)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2008-08-16 08:28:57 UTC (rev 32808)
@@ -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