[GRASS-SVN] r67869 - grass/trunk/gui/wxpython/datacatalog

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 17 12:16:56 PST 2016


Author: martinl
Date: 2016-02-17 12:16:56 -0800 (Wed, 17 Feb 2016)
New Revision: 67869

Modified:
   grass/trunk/gui/wxpython/datacatalog/frame.py
   grass/trunk/gui/wxpython/datacatalog/tree.py
Log:
g.gui.datacatalog: expand current mapset instead of location

Modified: grass/trunk/gui/wxpython/datacatalog/frame.py
===================================================================
--- grass/trunk/gui/wxpython/datacatalog/frame.py	2016-02-17 18:54:46 UTC (rev 67868)
+++ grass/trunk/gui/wxpython/datacatalog/frame.py	2016-02-17 20:16:56 UTC (rev 67869)
@@ -38,8 +38,8 @@
         # tree
         self.tree = DataCatalogTree(parent=self.panel, giface=self._giface)
         self.tree.InitTreeItems()
-        self.tree.ExpandCurrentLocation()
-
+        self.tree.ExpandCurrentMapset()
+        
         # buttons
         self.btnClose = wx.Button(parent=self.panel, id=wx.ID_CLOSE)
         self.btnClose.SetToolTipString(_("Close GRASS GIS Data Catalog"))

Modified: grass/trunk/gui/wxpython/datacatalog/tree.py
===================================================================
--- grass/trunk/gui/wxpython/datacatalog/tree.py	2016-02-17 18:54:46 UTC (rev 67868)
+++ grass/trunk/gui/wxpython/datacatalog/tree.py	2016-02-17 20:16:56 UTC (rev 67869)
@@ -264,6 +264,20 @@
         else:
             Debug.msg(1, "Location <%s> not found" % location)
 
+    def ExpandCurrentMapset(self):
+        """Expand current mapset"""
+        gisenv = gscript.gisenv()
+        location = gisenv['LOCATION_NAME']
+        mapset = gisenv['MAPSET']
+        locationItem = self._model.SearchNodes(name=location, type='location')
+        mapsetItem = None
+        if locationItem:
+            mapsetItem = self._model.SearchNodes(parent=locationItem[0], name=mapset, type='mapset')
+        if mapsetItem:
+            self.Select(mapsetItem[0], select=True)
+            self.ExpandNode(mapsetItem[0], recursive=True)
+        else:
+            Debug.msg(1, "Mapset <%s> not found" % mapset)
 
 class DataCatalogTree(LocationMapTree):
     def __init__(self, parent, giface=None):



More information about the grass-commit mailing list