Add window track to merge dialogs

This commit is contained in:
Nick Hall 2016-12-23 22:01:35 +00:00
parent e931b8a75c
commit 13b53e35d4
20 changed files with 34 additions and 32 deletions

View File

@ -55,8 +55,8 @@ class MergeCitation(ManagedWindow):
"""
Displays a dialog box that allows the citations to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.dbstate = dbstate
database = dbstate.db
self.citation1 = database.get_citation_from_handle(handle1)

View File

@ -54,8 +54,8 @@ class MergeEvent(ManagedWindow):
"""
Displays a dialog box that allows the events to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.dbstate = dbstate
database = dbstate.db
self.ev1 = database.get_event_from_handle(handle1)

View File

@ -56,8 +56,8 @@ class MergeFamily(ManagedWindow):
Merges two families into a single family. Displays a dialog box that allows
the families to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.database = dbstate.db
self.fy1 = self.database.get_family_from_handle(handle1)
self.fy2 = self.database.get_family_from_handle(handle2)

View File

@ -53,8 +53,8 @@ class MergeMedia(ManagedWindow):
"""
Displays a dialog box that allows the media objects to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.dbstate = dbstate
database = dbstate.db
self.mo1 = database.get_media_from_handle(handle1)

View File

@ -53,8 +53,8 @@ class MergeNote(ManagedWindow):
"""
Displays a dialog box that allows two notes to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.dbstate = dbstate
database = dbstate.db
self.no1 = database.get_note_from_handle(handle1)

View File

@ -78,9 +78,9 @@ class MergePerson(ManagedWindow):
"""
Displays a dialog box that allows the persons to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2, cb_update=None,
expand_context_info=True):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2,
cb_update=None, expand_context_info=True):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.database = dbstate.db
self.pr1 = self.database.get_person_from_handle(handle1)
self.pr2 = self.database.get_person_from_handle(handle2)

View File

@ -63,8 +63,9 @@ class MergePlace(ManagedWindow):
"""
Displays a dialog box that allows the places to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2, callback=None):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2,
callback=None):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.dbstate = dbstate
database = dbstate.db
self.callback = callback

View File

@ -54,8 +54,8 @@ class MergeRepository(ManagedWindow):
"""
Displays a dialog box that allows two repositories to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.dbstate = dbstate
database = dbstate.db
self.rp1 = database.get_repository_from_handle(handle1)

View File

@ -54,8 +54,8 @@ class MergeSource(ManagedWindow):
"""
Displays a dialog box that allows the sources to be combined into one.
"""
def __init__(self, dbstate, uistate, handle1, handle2):
ManagedWindow.__init__(self, uistate, [], self.__class__)
def __init__(self, dbstate, uistate, track, handle1, handle2):
ManagedWindow.__init__(self, uistate, track, self.__class__)
self.dbstate = dbstate
database = dbstate.db
self.src1 = database.get_source_from_handle(handle1)

View File

@ -430,7 +430,7 @@ class BasePersonView(ListView):
"holding down the control key while clicking on "
"the desired person."), parent=self.uistate.window)
else:
MergePerson(self.dbstate, self.uistate, mlist[0], mlist[1])
MergePerson(self.dbstate, self.uistate, [], mlist[0], mlist[1])
def tag_updated(self, handle_list):
"""

View File

@ -415,7 +415,7 @@ class PlaceBaseView(ListView):
"place hierarchy.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergePlace(self.dbstate, self.uistate, mlist[0], mlist[1],
MergePlace(self.dbstate, self.uistate, [], mlist[0], mlist[1],
self.merged)
def merged(self):

View File

@ -580,7 +580,7 @@ class DuplicatePeopleToolMatches(ManagedWindow):
self.show()
def build_menu_names(self, obj):
return (_("Merge candidates"),None)
return (_("Merge candidates"), _("Merge persons"))
def on_help_clicked(self, obj):
"""Display the relevant portion of GRAMPS manual"""
@ -616,7 +616,7 @@ class DuplicatePeopleToolMatches(ManagedWindow):
return
(self.p1,self.p2) = self.list.get_object(iter)
MergePerson(self.dbstate, self.uistate, self.p1, self.p2,
MergePerson(self.dbstate, self.uistate, self.track, self.p1, self.p2,
self.on_update, True)
def on_update(self):

View File

@ -326,7 +326,8 @@ class CitationListView(ListView):
"sources first.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeCitation(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeCitation(self.dbstate, self.uistate, [], mlist[0],
mlist[1])
def get_handle_from_gramps_id(self, gid):
obj = self.dbstate.db.get_citation_from_gramps_id(gid)

View File

@ -546,10 +546,10 @@ class CitationTreeView(ListView):
ErrorDialog(msg, msg2,
parent=self.uistate.window)
else:
MergeCitation(self.dbstate, self.uistate, mlist[0],
MergeCitation(self.dbstate, self.uistate, [], mlist[0],
mlist[1])
elif source1 and source2:
MergeSource(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeSource(self.dbstate, self.uistate, [], mlist[0], mlist[1])
else:
msg = _("Cannot perform merge.")
msg2 = _("Both objects must be of the same type, either "

View File

@ -266,7 +266,7 @@ class EventView(ListView):
"control key while clicking on the desired event.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeEvent(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeEvent(self.dbstate, self.uistate, [], mlist[0], mlist[1])
def tag_updated(self, handle_list):
"""

View File

@ -308,7 +308,7 @@ class FamilyView(ListView):
"control key while clicking on the desired family.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeFamily(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeFamily(self.dbstate, self.uistate, [], mlist[0], mlist[1])
def _make_father_active(self, obj):
"""

View File

@ -353,7 +353,7 @@ class MediaView(ListView):
"control key while clicking on the desired object.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeMedia(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeMedia(self.dbstate, self.uistate, [], mlist[0], mlist[1])
def get_handle_from_gramps_id(self, gid):
"""

View File

@ -244,7 +244,7 @@ class NoteView(ListView):
"control key while clicking on the desired note.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeNote(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeNote(self.dbstate, self.uistate, [], mlist[0], mlist[1])
def tag_updated(self, handle_list):
"""

View File

@ -249,7 +249,7 @@ class RepositoryView(ListView):
"repository.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeRepository(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeRepository(self.dbstate, self.uistate, [], mlist[0], mlist[1])
def get_handle_from_gramps_id(self, gid):
obj = self.dbstate.db.get_repository_from_gramps_id(gid)

View File

@ -232,7 +232,7 @@ class SourceView(ListView):
"control key while clicking on the desired source.")
ErrorDialog(msg, msg2, parent=self.uistate.window)
else:
MergeSource(self.dbstate, self.uistate, mlist[0], mlist[1])
MergeSource(self.dbstate, self.uistate, [], mlist[0], mlist[1])
def get_handle_from_gramps_id(self, gid):
obj = self.dbstate.db.get_source_from_gramps_id(gid)