[GRASS-SVN] r49529 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 4 16:44:18 EST 2011


Author: martinl
Date: 2011-12-04 13:44:18 -0800 (Sun, 04 Dec 2011)
New Revision: 49529

Modified:
   grass/trunk/gui/wxpython/core/workspace.py
Log:
wxGUI/workspace: support multi-line layer names
		 (merge r49528 from devbr6)


Modified: grass/trunk/gui/wxpython/core/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/core/workspace.py	2011-12-04 21:40:18 UTC (rev 49528)
+++ grass/trunk/gui/wxpython/core/workspace.py	2011-12-04 21:44:18 UTC (rev 49529)
@@ -169,10 +169,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,
@@ -669,8 +672,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