浏览代码

wxGUI: change map display title when mapset changed from wxGUI

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59254 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 年之前
父节点
当前提交
920231d41d

+ 1 - 1
gui/wxpython/gui_core/mapdisp.py

@@ -8,7 +8,7 @@ Classes:
  - 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.

+ 5 - 0
gui/wxpython/lmgr/frame.py

@@ -934,6 +934,11 @@ class GMFrame(wx.Frame):
                 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
         """

+ 1 - 6
gui/wxpython/lmgr/layertree.py

@@ -175,12 +175,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
                                    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:

+ 11 - 1
gui/wxpython/mapdisp/frame.py

@@ -241,7 +241,17 @@ class MapFrame(SingleMapFrame):
 
     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
         """

+ 1 - 4
gui/wxpython/mapdisp/main.py

@@ -445,10 +445,7 @@ if __name__ == "__main__":
     
     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()