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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 14 11:41:06 PDT 2014


Author: martinl
Date: 2014-03-14 11:41:06 -0700 (Fri, 14 Mar 2014)
New Revision: 59254

Modified:
   grass/trunk/gui/wxpython/gui_core/mapdisp.py
   grass/trunk/gui/wxpython/lmgr/frame.py
   grass/trunk/gui/wxpython/lmgr/layertree.py
   grass/trunk/gui/wxpython/mapdisp/frame.py
   grass/trunk/gui/wxpython/mapdisp/main.py
Log:
wxGUI: change map display title when mapset changed from wxGUI


Modified: grass/trunk/gui/wxpython/gui_core/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/mapdisp.py	2014-03-13 21:19:56 UTC (rev 59253)
+++ grass/trunk/gui/wxpython/gui_core/mapdisp.py	2014-03-14 18:41:06 UTC (rev 59254)
@@ -8,7 +8,7 @@
  - mapdisp::SingleMapFrame
  - mapdisp::DoubleMapFrame
 
-(C) 2009-2012 by the GRASS Development Team
+(C) 2009-2014 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.

Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2014-03-13 21:19:56 UTC (rev 59253)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2014-03-14 18:41:06 UTC (rev 59254)
@@ -934,6 +934,11 @@
                 GMessage(parent = self,
                          message = _("Current mapset is <%s>.") % mapset)
         
+                dispId = 1
+                for display in self.GetMapDisplay(onlyCurrent = False):
+                    display.SetTitle(dispId) # TODO: signal ?
+                    dispId += 1 
+        
     def OnChangeCWD(self, event):
         """!Change current working directory
         """

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2014-03-13 21:19:56 UTC (rev 59253)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2014-03-14 18:41:06 UTC (rev 59254)
@@ -175,12 +175,7 @@
                                    lmgr = self.lmgr, page = self.treepg,
                                    Map = self.Map)
         
-        # title
-        self.mapdisplay.SetTitle(_("GRASS GIS %(version)s Map Display: %(id)d  - Location: %(loc)s@%(mapset)s") % \
-                                     { 'version' : grass.version()['version'],
-                                       'id' : self.displayIndex + 1,
-                                       'loc' : grass.gisenv()["LOCATION_NAME"],
-                                       'mapset' : grass.gisenv()["MAPSET"] })
+        self.mapdisplay.SetTitle(self.displayIndex + 1)
         
         # show new display
         if showMapDisplay is True:

Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2014-03-13 21:19:56 UTC (rev 59253)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2014-03-14 18:41:06 UTC (rev 59254)
@@ -241,7 +241,17 @@
 
     def GetMapWindow(self):
         return self.MapWindow
-    
+
+    def SetTitle(self, displayId = 1):
+        """!Set map display title"""
+        title = _("GRASS GIS %(version)s Map Display: %(id)s  - Location: %(loc)s@%(mapset)s") % \
+            { 'version' : grass.version()['version'],
+              'id' : str(displayId),
+              'loc' : grass.gisenv()["LOCATION_NAME"],
+              'mapset' : grass.gisenv()["MAPSET"] }
+            
+        super(MapFrame, self).SetTitle(title)
+
     def _addToolbarVDigit(self):
         """!Add vector digitizer toolbar
         """

Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py	2014-03-13 21:19:56 UTC (rev 59253)
+++ grass/trunk/gui/wxpython/mapdisp/main.py	2014-03-14 18:41:06 UTC (rev 59254)
@@ -445,10 +445,7 @@
     
     gmMap = MapApp(0)
     # set title
-    gmMap.mapFrm.SetTitle(_("GRASS GIS %(version)s Map Display: %(name)s - Location: %(location)s") % \
-                              { 'version' : grass.version()['version'],
-                                'name' : monName,
-                                'location' : grass.gisenv()["LOCATION_NAME"] })
+    gmMap.mapFrm.SetTitle(monName)
     
     gmMap.MainLoop()
     



More information about the grass-commit mailing list