[GRASS-SVN] r50054 - in grass/trunk/gui/wxpython: core lmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 4 03:33:59 EST 2012
Author: annakrat
Date: 2012-01-04 00:33:58 -0800 (Wed, 04 Jan 2012)
New Revision: 50054
Modified:
grass/trunk/gui/wxpython/core/workspace.py
grass/trunk/gui/wxpython/lmgr/frame.py
Log:
wxGUI: save map display names to workspace
Modified: grass/trunk/gui/wxpython/core/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/core/workspace.py 2012-01-03 14:10:55 UTC (rev 50053)
+++ grass/trunk/gui/wxpython/core/workspace.py 2012-01-04 08:33:58 UTC (rev 50054)
@@ -132,6 +132,7 @@
projection = { 'enabled' : False }
self.displays.append( {
+ "name" : display.get('name'),
"render" : bool(int(display.get('render', "0"))),
"mode" : int(display.get('mode', 0)),
"showCompExtent" : bool(int(display.get('showCompExtent', "0"))),
@@ -579,6 +580,7 @@
# list of displays
for page in range(0, self.lmgr.gm_cb.GetPageCount()):
+ dispName = self.lmgr.gm_cb.GetPageText(page)
mapTree = self.lmgr.gm_cb.GetPage(page).maptree
region = mapTree.Map.region
@@ -589,13 +591,15 @@
else:
viewmode = '2d'
- file.write('%s<display render="%d" '
+ file.write('%s<display '
+ 'name="%s" render="%d" '
'mode="%d" showCompExtent="%d" '
'alignExtent="%d" '
'constrainRes="%d" '
'dim="%d,%d,%d,%d" '
'extent="%f,%f,%f,%f" '
'viewMode="%s" >\n' % (' ' * self.indent,
+ dispName.encode('utf8'),
int(mapTree.mapdisplay.GetProperty('render')),
mapTree.mapdisplay.statusbarManager.GetMode(),
int(mapTree.mapdisplay.GetProperty('region')),
Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py 2012-01-03 14:10:55 UTC (rev 50053)
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2012-01-04 08:33:58 UTC (rev 50054)
@@ -863,7 +863,7 @@
displayId = 0
mapdisplay = list()
for display in gxwXml.displays:
- mapdisp = self.NewDisplay(show = False)
+ mapdisp = self.NewDisplay(name = display['name'], show = False)
mapdisplay.append(mapdisp)
maptree = self.gm_cb.GetPage(displayId).maptree
@@ -1345,10 +1345,11 @@
"""!Create new layer tree and map display instance"""
self.NewDisplay()
- def NewDisplay(self, show = True):
+ def NewDisplay(self, name = None, show = True):
"""!Create new layer tree, which will
create an associated map display frame
+ @param name name of new map display
@param show show map display window if True
@return reference to mapdisplay intance
@@ -1357,7 +1358,11 @@
# make a new page in the bookcontrol for the layer tree (on page 0 of the notebook)
self.pg_panel = wx.Panel(self.gm_cb, id = wx.ID_ANY, style = wx.EXPAND)
- self.gm_cb.AddPage(self.pg_panel, text = "Display "+ str(self.disp_idx + 1), select = True)
+ if name:
+ dispName = name
+ else:
+ dispName = "Display " + str(self.disp_idx + 1)
+ self.gm_cb.AddPage(self.pg_panel, text = dispName, select = True)
self.curr_page = self.gm_cb.GetCurrentPage()
# create layer tree (tree control for managing GIS layers) and put on new notebook page
More information about the grass-commit
mailing list