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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 25 13:27:17 PDT 2018


Author: martinl
Date: 2018-09-25 13:27:17 -0700 (Tue, 25 Sep 2018)
New Revision: 73398

Modified:
   grass/trunk/gui/wxpython/datacatalog/tree.py
Log:
wxGUI/datacatalog: indicate in simple way current location/mapset

Modified: grass/trunk/gui/wxpython/datacatalog/tree.py
===================================================================
--- grass/trunk/gui/wxpython/datacatalog/tree.py	2018-09-25 16:42:51 UTC (rev 73397)
+++ grass/trunk/gui/wxpython/datacatalog/tree.py	2018-09-25 20:27:17 UTC (rev 73398)
@@ -300,13 +300,13 @@
         nlocations = len(locations)
         grassdata_node = self._model.AppendNode(
             parent=self._model.root, label=_('GRASS locations in {0}').format(
-                genv['GISDBASE']), data=dict(
-                type='grassdata'))
+                genv['GISDBASE']), data=dict(type='grassdata'))
         for location in locations:
             results[location] = dict()
+            label = '{} (current)'.format(location) if location == genv['LOCATION_NAME'] else location
             varloc = self._model.AppendNode(
-                parent=grassdata_node, label=location, data=dict(
-                    type='location', name=location))
+                parent=grassdata_node, label=label,
+                data=dict(type='location', name=location, current=True))
             location_nodes.append(varloc)
             loc_count += 1
 
@@ -333,9 +333,10 @@
                         errors.append(error)
 
                     for key in sorted(maps.keys()):
+                        label = '{} (current)'.format(key) if key == genv['MAPSET'] else key
                         mapset_node = self._model.AppendNode(
                             parent=location_nodes[i],
-                            label=key, data=dict(
+                            label=label, data=dict(
                                 type='mapset', name=key))
                         self._populateMapsetItem(mapset_node, maps[key])
 



More information about the grass-commit mailing list