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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 17 17:26:09 EDT 2008


Author: martinl
Date: 2008-03-17 17:26:09 -0400 (Mon, 17 Mar 2008)
New Revision: 30608

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: recycle GUI dialogs in Layer Manager (for selected map layer)

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-03-17 21:02:43 UTC (rev 30607)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-03-17 21:26:09 UTC (rev 30608)
@@ -796,10 +796,10 @@
     def OnCancel(self, event):
         """Cancel button pressed"""
         self.MakeModal(False)
-        # update only propwin reference
-        self.get_dcmd(dcmd=None, layer=self.layer, params=None,
-                      propwin=None)
-        self.Destroy()
+        if self.get_dcmd:
+            self.Hide()
+        else:
+            self.Destroy()
 
     def OnCloseWindow(self, event):
         """Close the main window"""
@@ -883,10 +883,12 @@
 
         # are we running from command line?
         ### add 'command output' tab regardless standalone dialog
-        #        if standalone:
-        self.goutput = goutput.GMConsole(parent=self, margin=False)
-        self.outpage = self.notebook.AddPage(self.goutput, text=_("Command output") )
-        self.outpageid = self.notebook.GetPageCount() - 1
+        if self.parent.get_dcmd is None:
+            self.goutput = goutput.GMConsole(parent=self, margin=False)
+            self.outpage = self.notebook.AddPage(self.goutput, text=_("Command output") )
+            self.outpageid = self.notebook.GetPageCount() - 1
+        else:
+            self.goutput = None
 
         manual_tab =  helpPanel( parent = self.notebook, grass_command = self.task.name)
         if manual_tab.Ok:
@@ -1172,7 +1174,7 @@
 
         # TODO: be less arbitrary with these 600
         self.panelMinHeight = 100
-        self.constrained_size = (min(600, maxsizes[0]) + 25, min(600, maxsizes[1]))
+        self.constrained_size = (min(600, maxsizes[0]) + 25, min(600, maxsizes[1]) + 25)
         for section in sections:
             tab[section].SetMinSize( (self.constrained_size[0], self.panelMinHeight) )
             # tab[section].SetMinSize( constrained_size )

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-03-17 21:02:43 UTC (rev 30607)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-03-17 21:26:09 UTC (rev 30608)
@@ -15,7 +15,7 @@
             Jachym Cepicky (Mendel University of Agriculture)
             Martin Landa <landa.martin gmail.com>
 
-COPYRIGHT:  (C) 2007 by the GRASS Development Team
+COPYRIGHT:  (C) 2007-2008 by the GRASS Development Team
             This program is free software under the GNU General Public
             License (>=v2). Read the file COPYING that comes with GRASS
             for details.
@@ -591,13 +591,14 @@
 
     def PropertiesDialog (self, layer, show=True):
         """Launch the properties dialog"""
-
         if self.GetPyData(layer)[0].has_key('propwin') and \
                 self.GetPyData(layer)[0]['propwin'] is not None:
-            # avoid duplicated GUI dialog for given map layer
+            # recycle GUI dialogs
             if self.GetPyData(layer)[0]['propwin'].IsShown():
                 self.GetPyData(layer)[0]['propwin'].SetFocus()
-                return
+            else:
+                self.GetPyData(layer)[0]['propwin'].Show()
+            return
         
         completed = ''
         params = self.GetPyData(layer)[1]



More information about the grass-commit mailing list