[GRASS-SVN] r54883 - in grass/trunk/gui/wxpython: gui_core lmgr mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 3 13:02:11 PST 2013


Author: wenzeslaus
Date: 2013-02-03 13:02:11 -0800 (Sun, 03 Feb 2013)
New Revision: 54883

Modified:
   grass/trunk/gui/wxpython/gui_core/goutput.py
   grass/trunk/gui/wxpython/lmgr/frame.py
   grass/trunk/gui/wxpython/mapdisp/frame.py
Log:
wxGUI/mapdisp: handling distance measuring messages with giface, measuring in d.mon works

Modified: grass/trunk/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/goutput.py	2013-02-03 21:00:39 UTC (rev 54882)
+++ grass/trunk/gui/wxpython/gui_core/goutput.py	2013-02-03 21:02:11 UTC (rev 54883)
@@ -295,6 +295,7 @@
         (replace by priority: False=1, True=2)
         @param priority priority of this message
         (0=no priority, 1=normal, 2=medium, 3=high)
+        also not clear how deal with this
         """
 
         self.cmdOutput.SetStyle()

Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2013-02-03 21:00:39 UTC (rev 54882)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2013-02-03 21:02:11 UTC (rev 54883)
@@ -52,7 +52,8 @@
 from dbmgr.manager         import AttributeManager
 from core.workspace        import ProcessWorkspaceFile, ProcessGrcFile, WriteWorkspaceFile
 from core.gconsole         import GConsole, \
-    EVT_CMD_OUTPUT, EVT_IGNORED_CMD_RUN, EVT_IMPORTANT_CMD_RUN, EVT_WRITE_LOG
+    EVT_CMD_OUTPUT, EVT_IGNORED_CMD_RUN, EVT_IMPORTANT_CMD_RUN, \
+    EVT_WRITE_LOG, EVT_WRITE_WARNING, EVT_WRITE_ERROR
 from gui_core.goutput      import GConsoleWindow, EVT_GC_CONTENT_CHANGED, GC_SEARCH, GC_PROMPT
 from gui_core.dialogs      import GdalOutputDialog, DxfImportDialog, GdalImportDialog, MapLayersDialog
 from gui_core.dialogs      import EVT_APPLY_MAP_LAYERS
@@ -291,6 +292,12 @@
         self._gconsole.Bind(EVT_WRITE_LOG,
                             lambda event:
                                 self._switchPageHandler(event = event, priority = event.priority))
+        self._gconsole.Bind(EVT_WRITE_WARNING,
+                            lambda event:
+                                self._switchPageHandler(event = event, priority = 2))
+        self._gconsole.Bind(EVT_WRITE_ERROR,
+                            lambda event:
+                                self._switchPageHandler(event = event, priority = 2))
         self._setCopyingOfSelectedText()
         
         # create 'search module' notebook page

Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2013-02-03 21:00:39 UTC (rev 54882)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2013-02-03 21:02:11 UTC (rev 54883)
@@ -930,10 +930,7 @@
         self.totaldist = 0.0 # total measured distance
         
         self.SwitchTool(self.toolbars['map'], event)
-        
-        # switch Layer Manager to output console to show measure results
-        self._layerManager.notebook.SetSelectionByName('output')
-        
+
         # change mouse to draw line for measurement
         self.MapWindow.mouse['use'] = "measure"
         self.MapWindow.mouse['box'] = "line"
@@ -944,9 +941,10 @@
         # change the cursor
         self.MapWindow.SetCursor(self.cursors["pencil"])
         
-        # initiating output
-        # TODO: this should be something like:
-        # write important message or write tip
+        # initiating output (and write a message)
+        # e.g., in Layer Manager switch to output console
+        # TODO: this should be something like: write important message or write tip
+        # TODO: mixed 'switching' and message? no, measuring handles 'swithing' on its own
         self._giface.WriteWarning(_('Click and drag with left mouse button '
                                               'to measure.%s'
                                               'Double click with left button to clear.') % \
@@ -974,7 +972,6 @@
         """!Calculate map distance from screen distance
         and print to output window
         """
-        self._layerManager.notebook.SetSelectionByName('output')
         
         dist, (north, east) = self.MapWindow.Distance(beginpt, endpt)
         
@@ -1004,7 +1001,7 @@
                    _('total distance'), strtotdist, tdunits,
                    '-' * 60)
         
-        self._giface.WriteLog(mstring)
+        self._giface.WriteLog(mstring, priority=2)
         
         return dist
 



More information about the grass-commit mailing list