[GRASS-SVN] r35502 - grass/branches/develbranch_6/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 20 14:08:58 EST 2009


Author: martinl
Date: 2009-01-20 14:08:58 -0500 (Tue, 20 Jan 2009)
New Revision: 35502

Modified:
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: fix trac #450
       (merge from trunk, r35501)


Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2009-01-20 19:06:20 UTC (rev 35501)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2009-01-20 19:08:58 UTC (rev 35502)
@@ -581,27 +581,37 @@
         # start new map display if no display is available
         if not self.curr_page:
             self.NewDisplay()
-
+        
         maptree = self.curr_page.maptree
-
+        
         # ask user to save current settings
         if maptree.GetCount() > 0:
-             dlg = wx.MessageDialog(self, message=_("Workspace is not empty. "
+             dlg = wx.MessageDialog(self, message=_("Current workspace is not empty. "
                                                     "Do you want to store current settings "
                                                     "to workspace file?"),
-                                    caption=_("Save current settings?"),
-                                    style=wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
-             if dlg.ShowModal() == wx.ID_YES:
+                                    caption=_("Create new workspace?"),
+                                    style=wx.YES_NO | wx.YES_DEFAULT | \
+                                        wx.CANCEL | wx.ICON_QUESTION)
+             ret = dlg.ShowModal()
+             if ret == wx.ID_YES:
                  self.OnWorkspaceSaveAs()
+             elif ret == wx.ID_CANCEL:
+                 dlg.Destroy()
+                 return
+             
              dlg.Destroy()
-
+        
         # delete all items
         maptree.DeleteAllItems()
-
+        
         # add new root element
         maptree.root = maptree.AddRoot("Map Layers")
         self.curr_page.maptree.SetPyData(maptree.root, (None,None))
-
+        
+        # no workspace file loaded
+        self.workspaceFile = None
+        self.SetTitle(self.baseTitle)
+        
     def OnWorkspaceOpen(self, event=None):
         """Open file with workspace definition"""
         dlg = wx.FileDialog(parent=self, message=_("Choose workspace file"),



More information about the grass-commit mailing list