Jelajahi Sumber

wxGUI/datacatalog: indicate in simple way current location/mapset

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73398 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 6 tahun lalu
induk
melakukan
87b630cc31
1 mengubah file dengan 6 tambahan dan 5 penghapusan
  1. 6 5
      gui/wxpython/datacatalog/tree.py

+ 6 - 5
gui/wxpython/datacatalog/tree.py

@@ -300,13 +300,13 @@ class LocationMapTree(TreeView):
         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 @@ class LocationMapTree(TreeView):
                         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])