diff --git a/src/Merge/mergeevent.py b/src/Merge/mergeevent.py index 96264e237..98a15718f 100644 --- a/src/Merge/mergeevent.py +++ b/src/Merge/mergeevent.py @@ -165,11 +165,13 @@ class MergeEvents(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.ev1 titanic = self.ev2 - unselect_path = (1,) else: phoenix = self.ev2 titanic = self.ev1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) if self.get_widget("type_btn1").get_active() ^ use_handle1: phoenix.set_type(titanic.get_type()) @@ -185,9 +187,6 @@ class MergeEvents(ManagedWindow.ManagedWindow): query = MergeEventQuery(self.dbstate, phoenix, titanic) query.execute() - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergefamily.py b/src/Merge/mergefamily.py index ee0712b0f..f458d0b45 100644 --- a/src/Merge/mergefamily.py +++ b/src/Merge/mergefamily.py @@ -197,11 +197,13 @@ class MergeFamilies(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.fy1 titanic = self.fy2 - unselect_path = (1,) else: phoenix = self.fy2 titanic = self.fy1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) phoenix_fh = phoenix.get_father_handle() phoenix_mh = phoenix.get_mother_handle() @@ -221,9 +223,6 @@ class MergeFamilies(ManagedWindow.ManagedWindow): query.execute() except MergeError, err: ErrorDialog( _("Cannot merge people"), str(err)) - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergemedia.py b/src/Merge/mergemedia.py index 2801fe73c..83b77fb92 100644 --- a/src/Merge/mergemedia.py +++ b/src/Merge/mergemedia.py @@ -147,11 +147,13 @@ class MergeMediaObjects(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.mo1 titanic = self.mo2 - unselect_path = (1,) else: phoenix = self.mo2 titanic = self.mo1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) if self.get_widget("path_btn1").get_active() ^ use_handle1: phoenix.set_path(titanic.get_path()) @@ -165,9 +167,6 @@ class MergeMediaObjects(ManagedWindow.ManagedWindow): query = MergeMediaQuery(self.dbstate, phoenix, titanic) query.execute() - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.close() class MergeMediaQuery(object): diff --git a/src/Merge/mergenote.py b/src/Merge/mergenote.py index e2e83753a..f362801fe 100644 --- a/src/Merge/mergenote.py +++ b/src/Merge/mergenote.py @@ -158,11 +158,13 @@ class MergeNotes(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.no1 titanic = self.no2 - unselect_path = (1,) else: phoenix = self.no2 titanic = self.no1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) if self.get_widget("text_btn1").get_active() ^ use_handle1: phoenix.set_styledtext(titanic.get_styledtext()) @@ -175,9 +177,6 @@ class MergeNotes(ManagedWindow.ManagedWindow): query = MergeNoteQuery(self.dbstate, phoenix, titanic) query.execute() - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.close() #------------------------------------------------------------------------- diff --git a/src/Merge/mergeperson.py b/src/Merge/mergeperson.py index 68f23f3fa..f37d1d54a 100644 --- a/src/Merge/mergeperson.py +++ b/src/Merge/mergeperson.py @@ -308,11 +308,13 @@ class MergePeople(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.pr1 titanic = self.pr2 - unselect_path = (1,) else: phoenix = self.pr2 titanic = self.pr1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) if self.get_widget("name_btn1").get_active() ^ use_handle1: swapname = phoenix.get_primary_name() @@ -330,9 +332,6 @@ class MergePeople(ManagedWindow.ManagedWindow): query.execute() except MergeError, err: ErrorDialog( _("Cannot merge people"), str(err)) - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.uistate.set_busy_cursor(False) self.close() if self.update: diff --git a/src/Merge/mergeplace.py b/src/Merge/mergeplace.py index 1af341462..4ff61e419 100644 --- a/src/Merge/mergeplace.py +++ b/src/Merge/mergeplace.py @@ -169,11 +169,14 @@ class MergePlaces(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.pl1 titanic = self.pl2 - unselect_path = (1,) else: phoenix = self.pl2 titanic = self.pl1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) + if self.get_widget("title_btn1").get_active() ^ use_handle1: phoenix.set_title(titanic.get_title()) @@ -190,9 +193,6 @@ class MergePlaces(ManagedWindow.ManagedWindow): query = MergePlaceQuery(self.dbstate, phoenix, titanic) query.execute() - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergerepository.py b/src/Merge/mergerepository.py index 8bcbff64d..48ddcbc85 100644 --- a/src/Merge/mergerepository.py +++ b/src/Merge/mergerepository.py @@ -136,11 +136,13 @@ class MergeRepositories(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.rp1 titanic = self.rp2 - unselect_path = (1,) else: phoenix = self.rp2 titanic = self.rp1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) if self.get_widget("name_btn1").get_active() ^ use_handle1: phoenix.set_name(titanic.get_name()) @@ -151,9 +153,6 @@ class MergeRepositories(ManagedWindow.ManagedWindow): query = MergeRepoQuery(self.dbstate, phoenix, titanic) query.execute() - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergesource.py b/src/Merge/mergesource.py index 429a75612..6075e6df1 100644 --- a/src/Merge/mergesource.py +++ b/src/Merge/mergesource.py @@ -159,11 +159,13 @@ class MergeSources(ManagedWindow.ManagedWindow): if use_handle1: phoenix = self.src1 titanic = self.src2 - unselect_path = (1,) else: phoenix = self.src2 titanic = self.src1 - unselect_path = (0,) + # Add second handle to history so that when merge is complete, + # phoenix is the selected row. + self.uistate.viewmanager.active_page.get_history().push( + phoenix.get_handle()) if self.get_widget("title_btn1").get_active() ^ use_handle1: phoenix.set_title(titanic.get_title()) @@ -178,9 +180,6 @@ class MergeSources(ManagedWindow.ManagedWindow): query = MergeSourceQuery(self.dbstate, phoenix, titanic) query.execute() - if self.uistate.viewmanager.active_page.selection: - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) self.uistate.set_busy_cursor(False) self.close()