[GRASS-SVN] r33749 - in grass/trunk/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 8 03:41:19 EDT 2008


Author: martinl
Date: 2008-10-08 03:41:19 -0400 (Wed, 08 Oct 2008)
New Revision: 33749

Modified:
   grass/trunk/gui/wxpython/gui_modules/goutput.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: switch to 'Command output' page on 'print metadata'
(merge from devbr6, r33748)


Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2008-10-08 07:38:16 UTC (rev 33748)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2008-10-08 07:41:19 UTC (rev 33749)
@@ -246,7 +246,7 @@
         """Write out line in warning style"""
         self.WriteLog(line, style=self.cmd_output.StyleWarning)
 
-    def RunCmd(self, command, compReg=True):
+    def RunCmd(self, command, compReg=True, switchPage=False):
         """
         Run in GUI GRASS (or other) commands typed into
         console command text widget, and send stdout output to output
@@ -261,6 +261,7 @@
 
         @param command command (list)
         @param compReg if true use computation region
+        @param switchPage switch to output page
         """
         
         # map display window available ?
@@ -311,6 +312,11 @@
                 # other GRASS commands (r|v|g|...)
                 #
                 
+                # switch to 'Command output'
+                if switchPage and \
+                        self.parent.notebook.GetSelection() != self.parent.goutput.pageid:
+                    self.parent.notebook.SetSelection(self.parent.goutput.pageid)
+
                 # activate computational region (set with g.region)
                 # for all non-display commands.
                 if compReg:

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-10-08 07:38:16 UTC (rev 33748)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-10-08 07:41:19 UTC (rev 33749)
@@ -363,7 +363,7 @@
         cmd.append('map=%s' % mapLayer.name)
 
         # print output to command log area
-        self.gismgr.goutput.RunCmd(cmd)
+        self.gismgr.goutput.RunCmd(cmd, switchPage=True)
 
     def OnSetCompRegFromRaster(self, event):
         """Set computational region from selected raster map (ignore NULLs)"""

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2008-10-08 07:38:16 UTC (rev 33748)
+++ grass/trunk/gui/wxpython/wxgui.py	2008-10-08 07:41:19 UTC (rev 33749)
@@ -415,13 +415,9 @@
         """Run command"""
 
         cmd = event.GetString()
-
-        # switch to 'Command output'
-        if self.notebook.GetSelection() != self.goutput.pageid:
-            self.notebook.SetSelection(self.goutput.pageid)
         
-        self.goutput.RunCmd(cmd)
-
+        self.goutput.RunCmd(cmd, switchPage=True)
+        
         self.OnUpdateStatusBar(None)
 
     def GetLogWindow(self):



More information about the grass-commit mailing list