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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 12 05:28:41 EDT 2011


Author: martinl
Date: 2011-06-12 02:28:41 -0700 (Sun, 12 Jun 2011)
New Revision: 46669

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


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2011-06-12 09:26:02 UTC (rev 46668)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2011-06-12 09:28:41 UTC (rev 46669)
@@ -382,9 +382,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
@@ -512,8 +511,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()
@@ -647,8 +645,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/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2011-06-12 09:26:02 UTC (rev 46668)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2011-06-12 09:28:41 UTC (rev 46669)
@@ -1219,7 +1219,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
@@ -1614,7 +1614,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"
@@ -1655,9 +1655,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/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-06-12 09:26:02 UTC (rev 46668)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-06-12 09:28:41 UTC (rev 46669)
@@ -964,8 +964,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:
                 
@@ -2236,9 +2235,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/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-06-12 09:26:02 UTC (rev 46668)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/toolbars.py	2011-06-12 09:28:41 UTC (rev 46669)
@@ -1162,7 +1162,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/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2011-06-12 09:26:02 UTC (rev 46668)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2011-06-12 09:28:41 UTC (rev 46669)
@@ -250,7 +250,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
@@ -400,7 +400,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)
@@ -1522,7 +1522,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