Skip to content

Commit

Permalink
wxGUI: change map display title when mapset changed from wxGUI
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59254 15284696-431f-4ddb-bdfa-cd5b030d7da7
landam committed Mar 14, 2014
1 parent cfb60d8 commit 920231d
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gui/wxpython/gui_core/mapdisp.py
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions gui/wxpython/lmgr/frame.py
Original file line number Diff line number Diff line change
@@ -934,6 +934,11 @@ def OnChangeMapset(self, event):
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
"""
7 changes: 1 addition & 6 deletions gui/wxpython/lmgr/layertree.py
Original file line number Diff line number Diff line change
@@ -175,12 +175,7 @@ def __init__(self, parent, giface,
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:
12 changes: 11 additions & 1 deletion gui/wxpython/mapdisp/frame.py
Original file line number Diff line number Diff line change
@@ -241,7 +241,17 @@ def __init__(self, parent, giface, title = _("GRASS GIS - Map display"),

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
"""
5 changes: 1 addition & 4 deletions gui/wxpython/mapdisp/main.py
Original file line number Diff line number Diff line change
@@ -445,10 +445,7 @@ def GetMapFrame(self):

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()

0 comments on commit 920231d

Please sign in to comment.