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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 12 05:26:02 EDT 2011


Author: martinl
Date: 2011-06-12 02:26:02 -0700 (Sun, 12 Jun 2011)
New Revision: 46668

Modified:
   grass/trunk/gui/wxpython/gui_modules/goutput.py
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/menuform.py
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
attempt to fix #1386 (wxGUI output gone)


Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-06-12 08:23:08 UTC (rev 46667)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-06-12 09:26:02 UTC (rev 46668)
@@ -383,9 +383,8 @@
 
         self.cmd_output.SetStyle()
 
-        if switchPage and \
-                self._notebook.GetSelection() != self._notebook.GetPageIndexByName('console'):
-            self._notebook.SetSelectionByName('console')
+        if switchPage:
+            self._notebook.SetSelectionByName('output')
         
         if not style:
             style = self.cmd_output.StyleDefault
@@ -513,8 +512,7 @@
                 # other GRASS commands (r|v|g|...)
                 # switch to 'Command output' if required
                 if switchPage:
-                    if self._notebook.GetSelection() != self._notebook.GetPageIndexByName('console'):
-                        self._notebook.SetSelectionByName('console')
+                    self._notebook.SetSelectionByName('output')
                     
                     self.parent.SetFocus()
                     self.parent.Raise()
@@ -648,8 +646,8 @@
         """!Print command output"""
         message = event.text
         type  = event.type
-        if self._notebook.GetSelection() != self._notebook.GetPageIndexByName('console'):
-            page = self._notebook.GetPageIndexByName('console')
+        if self._notebook.GetSelection() != self._notebook.GetPageIndexByName('output'):
+            page = self._notebook.GetPageIndexByName('output')
             textP = self._notebook.GetPageText(page)
             if textP[-1] != ')':
                 textP += ' (...)'

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-06-12 08:23:08 UTC (rev 46667)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-06-12 09:26:02 UTC (rev 46668)
@@ -1231,7 +1231,7 @@
         """!Internal method used by OnQuery*() methods"""
         if self.toolbars['map'].GetAction() == 'displayAttrb':
             # switch to output console to show query results
-            self._layerManager.notebook.SetSelectionByName('console')
+            self._layerManager.notebook.SetSelectionByName('output')
         
         self.MapWindow.mouse['box'] = "point"
         self.MapWindow.zoomtype = 0
@@ -1626,7 +1626,7 @@
         self.totaldist = 0.0 # total measured distance
         
         # switch Layer Manager to output console to show measure results
-        self._layerManager.notebook.SetSelectionByName('console')
+        self._layerManager.notebook.SetSelectionByName('output')
         
         # change mouse to draw line for measurement
         self.MapWindow.mouse['use'] = "measure"
@@ -1667,9 +1667,7 @@
         """!Calculate map distance from screen distance
         and print to output window
         """
-        if self._layerManager.notebook.GetSelection() != \
-                self._layerManager.notebook.GetPageIndexByName('console'):
-            self._layerManager.notebook.SetSelectionByName('console')
+        self._layerManager.notebook.SetSelectionByName('output')
         
         dist, (north, east) = self.MapWindow.Distance(beginpt, endpt)
         

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-06-12 08:23:08 UTC (rev 46667)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2011-06-12 09:26:02 UTC (rev 46668)
@@ -1021,8 +1021,7 @@
         if self.standalone or cmd[0][0:2] !=  "d.":
             # Send any non-display command to parent window (probably wxgui.py)
             # put to parents switch to 'Command output'
-            if self.notebookpanel.notebook.GetSelection() !=  self.notebookpanel.notebook.GetPageIndexByName('output'):
-                self.notebookpanel.notebook.SetSelectionByName('output')
+            self.notebookpanel.notebook.SetSelectionByName('output')
             
             try:
                 if self.task.path:
@@ -2421,9 +2420,10 @@
     def SetSelectionByName(self, page):
         """!Set notebook
         
-        @param page names, eg. 'layers', 'console', 'search', 'pyshell', 'nviz'
+        @param page names, eg. 'layers', 'output', 'search', 'pyshell', 'nviz'
         """
-        self.SetSelection(self.GetPageIndexByName(page))
+        if self.GetSelection() != self.GetPageIndexByName('output'):
+            self.SetSelection(self.GetPageIndexByName(page))
         
     def GetPageIndexByName(self, page):
         """!Get notebook page index

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-06-12 08:23:08 UTC (rev 46667)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-06-12 09:26:02 UTC (rev 46668)
@@ -1156,7 +1156,7 @@
             lmgr = self.parent.GetLayerManager()
             if lmgr:
                 lmgr.toolbars['tools'].Enable('vdigit', enable = True)
-                lmgr.notebook.SetSelectionByName('console')
+                lmgr.notebook.SetSelectionByName('output')
             self.digit.CloseMap()
             if lmgr:
                 lmgr.GetLogWindow().GetProgressBar().SetValue(0)

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2011-06-12 08:23:08 UTC (rev 46667)
+++ grass/trunk/gui/wxpython/wxgui.py	2011-06-12 09:26:02 UTC (rev 46668)
@@ -251,7 +251,7 @@
         
         # create 'command output' text area
         self.goutput = goutput.GMConsole(self)
-        self.notebook.AddPage(page = self.goutput, text = _("Command console"), name = 'console')
+        self.notebook.AddPage(page = self.goutput, text = _("Command console"), name = 'output')
         self._setCopyingOfSelectedText()
         
         # create 'search module' notebook page
@@ -404,7 +404,7 @@
     def OnPageChanged(self, event):
         """!Page in notebook changed"""
         page = event.GetSelection()
-        if page == self.notebook.GetPageIndexByName('console'):
+        if page == self.notebook.GetPageIndexByName('output'):
             # remove '(...)'
             self.notebook.SetPageText(page, _("Command console"))
             wx.CallAfter(self.goutput.cmd_prompt.SetFocus)
@@ -1470,7 +1470,7 @@
             if kc == wx.WXK_TAB:
                 # switch layer list / command output
                 if self.notebook.GetSelection() == self.notebook.GetPageIndexByName('layers'):
-                    self.notebook.SetSelectionByName('console')
+                    self.notebook.SetSelectionByName('output')
                 else:
                     self.notebook.SetSelectionByName('layers')
         



More information about the grass-commit mailing list