[GRASS-SVN] r53922 - in grass/trunk/gui/wxpython: gmodeler gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 19 10:11:23 PST 2012


Author: wenzeslaus
Date: 2012-11-19 10:11:23 -0800 (Mon, 19 Nov 2012)
New Revision: 53922

Modified:
   grass/trunk/gui/wxpython/gmodeler/frame.py
   grass/trunk/gui/wxpython/gui_core/forms.py
Log:
wxGUI/GConsole: fix 53921 (applying changes for forms and gmodeler)

Modified: grass/trunk/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/frame.py	2012-11-19 17:57:36 UTC (rev 53921)
+++ grass/trunk/gui/wxpython/gmodeler/frame.py	2012-11-19 18:11:23 UTC (rev 53922)
@@ -34,7 +34,7 @@
 
 from core                 import globalvar
 from gui_core.widgets     import GNotebook
-from gui_core.goutput     import GConsole
+from gui_core.goutput     import GConsole, EVT_OUTPUT_TEXT
 from core.debug           import Debug
 from core.gcmd            import GMessage, GException, GWarning, GError, RunCommand
 from gui_core.dialogs     import GetImageHandlers
@@ -104,7 +104,8 @@
         
         self.pythonPanel = PythonPanel(parent = self)
         
-        self.goutput = GConsole(parent = self, frame = self, notebook = self.notebook)
+        self.goutput = GConsole(parent = self, frame = self)
+        self.goutput.Bind(EVT_OUTPUT_TEXT, self.OnOutputText)
         
         self.notebook.AddPage(page = self.canvas, text=_('Model'), name = 'model')
         self.notebook.AddPage(page = self.itemPanel, text=_('Items'), name = 'items')
@@ -687,8 +688,17 @@
         self.model.AddItem(data)
         
         self.canvas.Refresh()
-        
-        
+
+    def OnOutputText(self, event):
+        """!Manages @c 'output' notebook page according to event priority."""
+        if event.priority == 1:
+            self.notebook.HighlightPageByName('output')
+        if event.priority >= 2:
+            self.notebook.SetSelectionByName('output')
+        if event.priority >= 3:
+            self.SetFocus()
+            self.Raise()
+
     def OnHelp(self, event):
         """!Display manual page"""
         grass.run_command('g.manual',

Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2012-11-19 17:57:36 UTC (rev 53921)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2012-11-19 18:11:23 UTC (rev 53922)
@@ -1617,8 +1617,9 @@
         # are we running from command line?
         ### add 'command output' tab regardless standalone dialog
         if self.parent.GetName() == "MainFrame" and self.parent.get_dcmd is None:
-            from gui_core.goutput import GConsole
-            self.goutput = GConsole(parent = self.notebook, frame = self.parent, margin = False, notebook = self.notebook)
+            from gui_core.goutput import GConsole, EVT_OUTPUT_TEXT
+            self.goutput = GConsole(parent = self.notebook, frame = self.parent, margin = False)
+            self.goutput.Bind(EVT_OUTPUT_TEXT, self.OnOutputText)
             self.outpage = self.notebook.AddPage(page = self.goutput, text = _("Command output"), name = 'output')
             index = self.AddBitmapToImageList(section = 'output', imageList = imageList)
             if index >= 0:
@@ -1845,6 +1846,16 @@
             # event is somehow propagated?
             event.StopPropagation()
 
+    def OnOutputText(self, event):
+        """!Manages @c 'output' notebook page according to event priority."""
+        if event.priority == 1:
+            self.notebook.HighlightPageByName('output')
+        if event.priority >= 2:
+            self.notebook.SetSelectionByName('output')
+        if event.priority >= 3:
+            self.SetFocus()
+            self.Raise()
+
     def OnColorChange(self, event):
         myId = event.GetId()
         for p in self.task.params:



More information about the grass-commit mailing list