[GRASS-SVN] r54962 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 6 10:13:32 PST 2013


Author: wenzeslaus
Date: 2013-02-06 10:13:31 -0800 (Wed, 06 Feb 2013)
New Revision: 54962

Modified:
   grass/trunk/gui/wxpython/lmgr/giface.py
   grass/trunk/gui/wxpython/lmgr/layertree.py
Log:
wxGUI/giface: correcting the handling of current vs map window's layer tree

Modified: grass/trunk/gui/wxpython/lmgr/giface.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/giface.py	2013-02-06 18:08:02 UTC (rev 54961)
+++ grass/trunk/gui/wxpython/lmgr/giface.py	2013-02-06 18:13:31 UTC (rev 54962)
@@ -105,3 +105,25 @@
 
     def GetProgress(self):
         return self.lmgr.goutput.GetProgressBar()
+
+
+class LayerManagerGrassInterfaceForMapDisplay(LayerManagerGrassInterface):
+    """!Provides reference only to the given layer list (according to tree),
+        not to the current.
+    """
+    def __init__(self, lmgr, tree):
+        """!
+        @lmgr layer manager
+        @tree tree which will be used instead of the lmgr.tree
+        """
+        LayerManagerGrassInterface.__init__(self, lmgr)
+        self.tree = tree
+
+    def GetLayerTree(self):
+        return self.tree
+
+    def GetLayerList(self):
+        return LayerList(self.tree)
+
+    def GetMapWindow(self):
+        return self.tree.GetMapDisplay()

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2013-02-06 18:08:02 UTC (rev 54961)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2013-02-06 18:13:31 UTC (rev 54962)
@@ -46,6 +46,7 @@
 from icons.icon           import MetaIcon
 from modules.colorrules   import RasterColorTable
 from web_services.dialogs import SaveWMSLayerDialog
+from lmgr.giface import LayerManagerGrassInterfaceForMapDisplay
 
 
 TREE_ITEM_HEIGHT = 25
@@ -155,7 +156,10 @@
         
         # init associated map display
         pos = wx.Point((self.displayIndex + 1) * 25, (self.displayIndex + 1) * 25)
-        self.mapdisplay = MapFrame(self, giface = self._giface, id = wx.ID_ANY, pos = pos,
+        gifaceForDisplay = LayerManagerGrassInterfaceForMapDisplay(self.lmgr,
+                                                                   self)
+        self.mapdisplay = MapFrame(self, giface = gifaceForDisplay,
+                                   id = wx.ID_ANY, pos = pos,
                                    size = globalvar.MAP_WINDOW_SIZE,
                                    style = wx.DEFAULT_FRAME_STYLE,
                                    tree = self, notebook = self.notebook,



More information about the grass-commit mailing list