[GRASS-SVN] r58138 - grass/trunk/gui/wxpython/lmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Nov 2 05:41:48 PDT 2013
Author: annakrat
Date: 2013-11-02 05:41:48 -0700 (Sat, 02 Nov 2013)
New Revision: 58138
Modified:
grass/trunk/gui/wxpython/lmgr/frame.py
Log:
wxGUI: fix wrong order of layers when reading from workspace file
Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py 2013-11-01 12:42:50 UTC (rev 58137)
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2013-11-02 12:41:48 UTC (rev 58138)
@@ -1164,16 +1164,16 @@
displayId += 1
mapdisp.Show() # show mapdisplay
-
- maptree = None
- selected = [] # list of selected layers
+
+ maptree = None
+ selectList = [] # list of selected layers
#
# load list of map layers
#
for layer in gxwXml.layers:
display = layer['display']
maptree = self.notebookLayers.GetPage(display).maptree
-
+
newItem = maptree.AddLayer(ltype = layer['type'],
lname = layer['name'],
lchecked = layer['checked'],
@@ -1182,17 +1182,17 @@
lgroup = layer['group'],
lnviz = layer['nviz'],
lvdigit = layer['vdigit'])
-
- if layer.has_key('selected'):
- if layer['selected']:
- selected.append((maptree, newItem))
- else:
- maptree.SelectItem(newItem, select = False)
-
- for maptree, layer in selected:
- if not maptree.IsSelected(layer):
- maptree.SelectItem(layer, select = True)
-
+
+ if 'selected' in layer:
+ selectList.append((maptree, newItem, layer['selected']))
+
+ for maptree, layer, selected in selectList:
+ if selected:
+ if not layer.IsSelected():
+ maptree.SelectItem(layer, select=True)
+ else:
+ maptree.SelectItem(layer, select=False)
+
busy.Destroy()
for idx, mdisp in enumerate(mapdisplay):
More information about the grass-commit
mailing list