Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions gui/wxpython/datacatalog/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,15 +1480,19 @@ def InsertMapset(self, name, location_node):
return mapset_node

def InsertLocation(self, name, grassdb_node):
"""Insert new location into model and refresh tree"""
location_node = self._model.AppendNode(
parent=grassdb_node, data={"type": "location", "name": name}
)
# reload new location since it has a mapset
self._reloadLocationNode(location_node)
self._model.SortChildren(grassdb_node)
self.RefreshNode(grassdb_node, recursive=True)
return location_node
"""
Insert new location into model and refresh tree.
Check if not already added.
"""
if not self.GetDbNode(grassdb=grassdb_node, location=name):
location_node = self._model.AppendNode(
parent=grassdb_node, data={"type": "location", "name": name}
)
# reload new location since it has a mapset
self._reloadLocationNode(location_node)
self._model.SortChildren(grassdb_node)
self.RefreshNode(grassdb_node, recursive=True)
return location_node

def InsertGrassDb(self, name):
"""
Expand Down Expand Up @@ -1796,8 +1800,6 @@ def _updateAfterGrassdbChanged(
node = self.GetDbNode(grassdb=grassdb)
if not node:
node = self.InsertGrassDb(name=grassdb)
if node:
self.InsertLocation(location, node)
Comment on lines -1799 to -1800
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep that unchanged, no?

elif action == "delete":
node = self.GetDbNode(grassdb=grassdb)
if node:
Expand Down
Loading