[GRASS-SVN] r49528 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Dec 4 16:40:18 EST 2011
Author: martinl
Date: 2011-12-04 13:40:18 -0800 (Sun, 04 Dec 2011)
New Revision: 49528
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
Log:
wxGUI/workspace: support multi-line layer names
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py 2011-12-04 21:30:33 UTC (rev 49527)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py 2011-12-04 21:40:18 UTC (rev 49528)
@@ -189,10 +189,13 @@
elif item.tag == 'layer':
cmd, selected, vdigit, nviz = self.__processLayer(item)
+ lname = item.get('name', None)
+ if lname and '\\n' in lname:
+ lname = lname.replace('\\n', os.linesep)
self.layers.append( {
"type" : item.get('type', None),
- "name" : item.get('name', None),
+ "name" : lname,
"checked" : bool(int(item.get('checked', "0"))),
"opacity" : float(item.get('opacity', '1.0')),
"cmd" : cmd,
@@ -966,8 +969,8 @@
self.indent -= 4
self.file.write('%s</group>\n' % (' ' * self.indent));
else:
- cmd = mapTree.GetPyData(item)[0]['maplayer'].GetCmd(string=False)
- name = mapTree.GetItemText(item)
+ cmd = mapTree.GetPyData(item)[0]['maplayer'].GetCmd(string = False)
+ name = mapTree.GetItemText(item).replace(os.linesep, '\\n')
opacity = maplayer.GetOpacity(float = True)
# remove 'opacity' part
if opacity < 1:
More information about the grass-commit
mailing list