diff --git a/src/Merge/mergeevent.py b/src/Merge/mergeevent.py index bffd4245b..4fbe4da06 100644 --- a/src/Merge/mergeevent.py +++ b/src/Merge/mergeevent.py @@ -244,3 +244,4 @@ class MergeEventQuery(object): self.database.remove_event(old_handle, trans) self.database.commit_event(self.phoenix, trans) self.database.transaction_commit(trans, _("Merge Event Objects")) + self.database.emit('event-rebuild') diff --git a/src/Merge/mergefamily.py b/src/Merge/mergefamily.py index fb5cb6864..79a4584a5 100644 --- a/src/Merge/mergefamily.py +++ b/src/Merge/mergefamily.py @@ -241,6 +241,7 @@ class MergeFamilies(ManagedWindow.ManagedWindow): # TODO: rollback else: database.transaction_commit(trans, _('Merge family')) + self.database.emit('family-rebuild') self.uistate.viewmanager.active_page.selection.unselect_path( unselect_path) self.uistate.set_busy_cursor(False) diff --git a/src/Merge/mergemedia.py b/src/Merge/mergemedia.py index e46b44203..1dd4e97db 100644 --- a/src/Merge/mergemedia.py +++ b/src/Merge/mergemedia.py @@ -213,3 +213,4 @@ class MergeMediaQuery(object): self.database.remove_object(old_handle, trans) self.database.commit_media_object(self.phoenix, trans) self.database.transaction_commit(trans, _("Merge Media Objects")) + self.database.emit('media-rebuild') diff --git a/src/Merge/mergenote.py b/src/Merge/mergenote.py index 9b7d96690..33138e687 100644 --- a/src/Merge/mergenote.py +++ b/src/Merge/mergenote.py @@ -236,3 +236,4 @@ class MergeNoteQuery(object): self.database.remove_note(old_handle, trans) self.database.commit_note(self.phoenix, trans) self.database.transaction_commit(trans, _("Merge Notes")) + self.database.emit('note-rebuild') diff --git a/src/Merge/mergeperson.py b/src/Merge/mergeperson.py index 60644300f..18b1b0628 100644 --- a/src/Merge/mergeperson.py +++ b/src/Merge/mergeperson.py @@ -448,3 +448,4 @@ class MergePersonQuery(object): self.database.commit_person(self.phoenix, trans) if need_commit: self.database.transaction_commit(trans, _('Merge Person')) + self.database.emit('person-rebuild') diff --git a/src/Merge/mergeplace.py b/src/Merge/mergeplace.py index 407e3356e..fee4d6fc4 100644 --- a/src/Merge/mergeplace.py +++ b/src/Merge/mergeplace.py @@ -229,3 +229,4 @@ class MergePlaceQuery(object): self.database.remove_place(old_handle, trans) self.database.commit_place(self.phoenix, trans) self.database.transaction_commit(trans, _("Merge Places")) + self.database.emit('place-rebuild') diff --git a/src/Merge/mergerepository.py b/src/Merge/mergerepository.py index 5bb91916d..5f394cd2e 100644 --- a/src/Merge/mergerepository.py +++ b/src/Merge/mergerepository.py @@ -179,3 +179,4 @@ class MergeRepoQuery(object): self.database.remove_repository(old_handle, trans) self.database.commit_repository(self.phoenix, trans) self.database.transaction_commit(trans, _("Merge Repositories")) + self.database.emit('repository-rebuild') diff --git a/src/Merge/mergesource.py b/src/Merge/mergesource.py index 89f13cc6e..cb65ce0ee 100644 --- a/src/Merge/mergesource.py +++ b/src/Merge/mergesource.py @@ -236,3 +236,4 @@ class MergeSourceQuery(object): self.database.remove_source(old_handle, trans) self.database.commit_source(self.phoenix, trans) self.database.transaction_commit(trans, _("Merge Sources")) + self.database.emit('source-rebuild') diff --git a/src/gui/views/listview.py b/src/gui/views/listview.py index f3852ab14..41d85a7cf 100644 --- a/src/gui/views/listview.py +++ b/src/gui/views/listview.py @@ -735,8 +735,19 @@ class ListView(NavigationView): """ self.dirty = True if self.active: + # Save the currently selected handles, if any: + selected_ids = self.selected_handles() self.bookmarks.redraw() self.build_tree() + # Reselect one, if it still exists after rebuild: + nav_type = self.navigation_type() + lookup_handle = self.dbstate.db.get_table_metadata(nav_type)['handle_func'] + for handle in selected_ids: + # Still exist? + if lookup_handle(handle): + # Select it, and stop selecting: + self.change_active(handle) + break def _button_press(self, obj, event): """