Add window track to merge dialogs
This commit is contained in:
parent
e931b8a75c
commit
13b53e35d4
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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):
|
||||
"""
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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 "
|
||||
|
@ -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):
|
||||
"""
|
||||
|
@ -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):
|
||||
"""
|
||||
|
@ -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):
|
||||
"""
|
||||
|
@ -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):
|
||||
"""
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user