[GRASS-SVN] r41670 - in grass/trunk/gui/wxpython: . gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Apr 2 09:18:27 EDT 2010
Author: martinl
Date: 2010-04-02 09:18:27 -0400 (Fri, 02 Apr 2010)
New Revision: 41670
Modified:
grass/trunk/gui/wxpython/gui_modules/menuform.py
grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: new workspace bugfix
Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-04-02 13:05:36 UTC (rev 41669)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-04-02 13:18:27 UTC (rev 41670)
@@ -468,8 +468,9 @@
# Output only values that have been set, and different from defaults
cmd += [ '%s=%s' % ( p['name'], p['value'] ) ]
- if ignoreErrors is False:
- raise ValueError, '\n'.join(self.getCmdError())
+ errList = self.getCmdError()
+ if ignoreErrors is False and errList:
+ raise ValueError, '\n'.join(errList)
return cmd
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2010-04-02 13:05:36 UTC (rev 41669)
+++ grass/trunk/gui/wxpython/wxgui.py 2010-04-02 13:18:27 UTC (rev 41670)
@@ -513,11 +513,11 @@
self.PopupMenu(menu)
menu.Destroy()
- def OnWorkspaceNew(self, event=None):
+ def OnWorkspaceNew(self, event = None):
"""!Create new workspace file
- Erase current workspace settings first"""
-
+ Erase current workspace settings first
+ """
Debug.msg(4, "GMFrame.OnWorkspaceNew():")
# start new map display if no display is available
@@ -527,7 +527,9 @@
maptree = self.curr_page.maptree
# ask user to save current settings
- if maptree.GetCount() > 0:
+ if self.workspaceFile and self.workspaceChanged:
+ self.OnWorkspaceSave()
+ elif self.workspaceFile is None and maptree.GetCount() > 0:
dlg = wx.MessageDialog(self, message=_("Current workspace is not empty. "
"Do you want to store current settings "
"to workspace file?"),
@@ -552,6 +554,7 @@
# no workspace file loaded
self.workspaceFile = None
+ self.workspaceChanged = False
self.SetTitle(self.baseTitle)
def OnWorkspaceOpen(self, event=None):
More information about the grass-commit
mailing list