[GRASS-SVN] r41671 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 2 09:22:17 EDT 2010


Author: martinl
Date: 2010-04-02 09:22:17 -0400 (Fri, 02 Apr 2010)
New Revision: 41671

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: new workspace bugfix
(merge r41670 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-04-02 13:18:27 UTC (rev 41670)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-04-02 13:22:17 UTC (rev 41671)
@@ -423,8 +423,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/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-04-02 13:18:27 UTC (rev 41670)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-04-02 13:22:17 UTC (rev 41671)
@@ -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