Skip to content

Commit

Permalink
wxGUI: fix adding and removing from history for new mapset (OSGeo#4228)
Browse files Browse the repository at this point in the history
Bug introduced in 02e45e9 when trying to avoid calling complete tree refresh every time.
  • Loading branch information
petrasovaa authored and a0x8o committed Sep 5, 2024
1 parent 946f355 commit bfeba7d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gui/wxpython/history/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ def InsertCommand(self, entry):
},
)
self._model.SortChildren(self._model.root)
self.RefreshItems()

# Populate today's node by executed command
command_node = self._populateDayItem(today_node, entry)
Expand Down Expand Up @@ -621,9 +622,9 @@ def OnRemoveCmd(self, event):
selected_day = selected_command.parent
if selected_day and len(selected_day.children) == 0:
self._model.RemoveNode(selected_day)

# Reload day node
self._reloadNode(selected_day)
self._reloadNode(self._model.root)
else:
self._reloadNode(selected_day)
self.showNotification.emit(message=_("<{}> removed").format(command))

def OnItemSelected(self, node):
Expand Down

0 comments on commit bfeba7d

Please sign in to comment.