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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 8 03:38:17 EDT 2008


Author: martinl
Date: 2008-10-08 03:38:16 -0400 (Wed, 08 Oct 2008)
New Revision: 33748

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: switch to 'Command output' page on 'print metadata'


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2008-10-08 05:51:30 UTC (rev 33747)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2008-10-08 07:38:16 UTC (rev 33748)
@@ -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/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-10-08 05:51:30 UTC (rev 33747)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/wxgui_utils.py	2008-10-08 07:38:16 UTC (rev 33748)
@@ -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/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-10-08 05:51:30 UTC (rev 33747)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-10-08 07:38:16 UTC (rev 33748)
@@ -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