2059: need a way to compare and merge all objects, by MD Nauta
svn: r15645
This commit is contained in:
parent
59403835fe
commit
3e28ee67ec
@ -142,3 +142,13 @@ class DbError(Exception):
|
||||
def __str__(self):
|
||||
"Return string representation"
|
||||
return self.value
|
||||
|
||||
class MergeError(Exception):
|
||||
"""Error used to report merge errors"""
|
||||
def __init__(self, value=""):
|
||||
Exception.__init__(self)
|
||||
self.value = value
|
||||
|
||||
def __str__(self):
|
||||
"Return string representation"
|
||||
return self.value
|
||||
|
@ -428,7 +428,7 @@ class ManagedWindow(object):
|
||||
if glade_file is None:
|
||||
raise TypeError, "ManagedWindow.define_glade: no glade file"
|
||||
glade_file = const.GLADE_FILE
|
||||
self._gladeobj = Glade(glade_file, "", top_module)
|
||||
self._gladeobj = Glade(glade_file, None, top_module)
|
||||
return self._gladeobj
|
||||
|
||||
def get_widget(self, name):
|
||||
|
@ -7,9 +7,14 @@ pkgdatadir = $(datadir)/@PACKAGE@/Merge
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
__init__.py \
|
||||
_MergePerson.py \
|
||||
_MergePlace.py \
|
||||
_MergeSource.py
|
||||
mergeperson.py \
|
||||
mergefamily.py \
|
||||
mergeevent.py \
|
||||
mergeplace.py \
|
||||
mergesource.py \
|
||||
mergerepository.py \
|
||||
mergemedia.py \
|
||||
mergenote.py
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/Merge
|
||||
pkgpythondir = @pkgpythondir@/Merge
|
||||
|
@ -23,6 +23,11 @@
|
||||
"""
|
||||
"""
|
||||
|
||||
from _MergePerson import *
|
||||
from _MergePlace import *
|
||||
from _MergeSource import *
|
||||
from mergeperson import *
|
||||
from mergefamily import *
|
||||
from mergeevent import *
|
||||
from mergeplace import *
|
||||
from mergesource import *
|
||||
from mergerepository import *
|
||||
from mergemedia import *
|
||||
from mergenote import *
|
||||
|
259
src/Merge/mergeevent.py
Normal file
259
src/Merge/mergeevent.py
Normal file
@ -0,0 +1,259 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provide merge capabilities for events.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
import const
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
import DateHandler
|
||||
import Utils
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Merge_Events')
|
||||
_GLADE_FILE = 'mergeevent.glade'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Events
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeEvents(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
Displays a dialog box that allows the events to be combined into one.
|
||||
"""
|
||||
def __init__(self, dbstate, uistate, handle1, handle2):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.ev1 = database.get_event_from_handle(handle1)
|
||||
self.ev2 = database.get_event_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergeevent', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget("event_title"),
|
||||
_("Merge Events"))
|
||||
|
||||
# Detailed selection widgets
|
||||
type1 = str(self.ev1.get_type())
|
||||
type2 = str(self.ev2.get_type())
|
||||
entry1 = self.get_widget("type1")
|
||||
entry2 = self.get_widget("type2")
|
||||
entry1.set_text(type1)
|
||||
entry2.set_text(type2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('type1', 'type2', 'type_btn1', 'type_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("date1")
|
||||
entry2 = self.get_widget("date2")
|
||||
entry1.set_text(DateHandler.get_date(self.ev1))
|
||||
entry2.set_text(DateHandler.get_date(self.ev2))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('date1', 'date2', 'date_btn1', 'date_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
place1 = database.get_place_from_handle(
|
||||
self.ev1.get_place_handle())
|
||||
place2 = database.get_place_from_handle(
|
||||
self.ev2.get_place_handle())
|
||||
place1 = place1.get_title() if place1 else ""
|
||||
place2 = place2.get_title() if place2 else ""
|
||||
entry1 = self.get_widget("place1")
|
||||
entry2 = self.get_widget("place2")
|
||||
entry1.set_text(place1)
|
||||
entry2.set_text(place2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('place1', 'place2', 'place_btn1', 'place_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("desc1")
|
||||
entry2 = self.get_widget("desc2")
|
||||
entry1.set_text(self.ev1.get_description())
|
||||
entry2.set_text(self.ev2.get_description())
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('desc1', 'desc2', 'desc_btn1', 'desc_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("marker1")
|
||||
entry2 = self.get_widget("marker2")
|
||||
entry1.set_text(str(self.ev1.get_marker()))
|
||||
entry2.set_text(str(self.ev2.get_marker()))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('marker1', 'marker2', 'marker_btn1',
|
||||
'marker_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.ev1.get_gramps_id()
|
||||
gramps2 = self.ev2.get_gramps_id()
|
||||
entry1 = self.get_widget("gramps1")
|
||||
entry2 = self.get_widget("gramps2")
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
ppant1 = Utils.get_participant_from_event(database, handle1)
|
||||
ppant2 = Utils.get_participant_from_event(database, handle2)
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
rbutton_label1.set_label("%s %s [%s]" % (type1, ppant1, gramps1))
|
||||
rbutton_label2.set_label("%s %s [%s]" % (type2, ppant2, gramps2))
|
||||
rbutton1.connect("toggled", self.on_handle1_toggled)
|
||||
|
||||
self.connect_button("event_help", self.cb_help)
|
||||
self.connect_button("event_ok", self.cb_merge)
|
||||
self.connect_button("event_cancel", self.close)
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
"""Preferred event changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget("type_btn1").set_active(True)
|
||||
self.get_widget("date_btn1").set_active(True)
|
||||
self.get_widget("place_btn1").set_active(True)
|
||||
self.get_widget("desc_btn1").set_active(True)
|
||||
self.get_widget("marker_btn1").set_active(True)
|
||||
self.get_widget("gramps_btn1").set_active(True)
|
||||
else:
|
||||
self.get_widget("type_btn2").set_active(True)
|
||||
self.get_widget("date_btn2").set_active(True)
|
||||
self.get_widget("place_btn2").set_active(True)
|
||||
self.get_widget("desc_btn2").set_active(True)
|
||||
self.get_widget("marker_btn2").set_active(True)
|
||||
self.get_widget("gramps_btn2").set_active(True)
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of the Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section = WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Perform the merge of the events when the merge button is clicked.
|
||||
"""
|
||||
self.uistate.set_busy_cursor(True)
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.ev1
|
||||
titanic = self.ev2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.ev2
|
||||
titanic = self.ev1
|
||||
unselect_path = (0,)
|
||||
|
||||
if self.get_widget("type_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_type(titanic.get_type())
|
||||
if self.get_widget("date_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_date_object(titanic.get_date_object())
|
||||
if self.get_widget("place_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_place_handle(titanic.get_place_handle())
|
||||
if self.get_widget("desc_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_description(titanic.get_description())
|
||||
if self.get_widget("marker_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_marker(titanic.get_marker())
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
# cause is deprecated.
|
||||
|
||||
query = MergeEventQuery(self.dbstate, phoenix, titanic)
|
||||
query.execute()
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Event Query
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeEventQuery(object):
|
||||
"""
|
||||
Create database query to merge two events.
|
||||
"""
|
||||
def __init__(self, dbstate, phoenix, titanic):
|
||||
self.database = dbstate.db
|
||||
self.phoenix = phoenix
|
||||
self.titanic = titanic
|
||||
|
||||
def execute(self):
|
||||
"""
|
||||
Merges two events into a single event.
|
||||
"""
|
||||
new_handle = self.phoenix.get_handle()
|
||||
old_handle = self.titanic.get_handle()
|
||||
|
||||
self.phoenix.merge(self.titanic)
|
||||
|
||||
trans = self.database.transaction_begin()
|
||||
for person in self.database.iter_people():
|
||||
if person.has_handle_reference("Event", old_handle):
|
||||
bri = person.birth_ref_index
|
||||
dri = person.death_ref_index
|
||||
person.replace_handle_reference("Event", old_handle, new_handle)
|
||||
if person.birth_ref_index != bri and person.birth_ref_index==-1:
|
||||
for index, ref in enumerate(person.get_event_ref_list()):
|
||||
if ref.ref == new_handle:
|
||||
event = self.phoenix
|
||||
else:
|
||||
event = self.database.get_event_from_handle(ref.ref)
|
||||
if event.type.is_birth() and ref.role.is_primary():
|
||||
person.birth_ref_index = index
|
||||
break
|
||||
if person.death_ref_index != dri and person.death_ref_index==-1:
|
||||
for index, ref in enumerate(person.get_event_ref_list()):
|
||||
if ref.ref == new_handle:
|
||||
event = self.phoenix
|
||||
else:
|
||||
event = self.database.get_event_from_handle(ref.ref)
|
||||
if event.type.is_death() and ref.role.is_primary():
|
||||
person.death_ref_index = index
|
||||
break
|
||||
self.database.commit_person(person, trans)
|
||||
|
||||
for family in self.database.iter_families():
|
||||
if family.has_handle_reference("Event", old_handle):
|
||||
family.replace_handle_reference("Event", old_handle, new_handle)
|
||||
self.database.commit_family(family, trans)
|
||||
|
||||
self.database.remove_event(old_handle, trans)
|
||||
self.database.commit_event(self.phoenix, trans)
|
||||
self.database.transaction_commit(trans, _("Merge Event Objects"))
|
261
src/Merge/mergefamily.py
Normal file
261
src/Merge/mergefamily.py
Normal file
@ -0,0 +1,261 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provide merge capabilities for families.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import const
|
||||
import GrampsDisplay
|
||||
from QuestionDialog import ErrorDialog
|
||||
from Errors import MergeError
|
||||
import ManagedWindow
|
||||
from Merge.mergeperson import MergePersonQuery
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Merge_Families')
|
||||
_GLADE_FILE = 'mergefamily.glade'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Families
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeFamilies(ManagedWindow.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.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.fy1 = database.get_family_from_handle(handle1)
|
||||
self.fy2 = database.get_family_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergefamily', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget("family_title"),
|
||||
_("Merge Families"))
|
||||
|
||||
# Detailed selection widgets
|
||||
father1 = self.fy1.get_father_handle()
|
||||
father2 = self.fy2.get_father_handle()
|
||||
father1 = database.get_person_from_handle(father1)
|
||||
father2 = database.get_person_from_handle(father2)
|
||||
father_id1 = father1.get_gramps_id()
|
||||
father_id2 = father2.get_gramps_id()
|
||||
father1 = name_displayer.display(father1) if father1 else ""
|
||||
father2 = name_displayer.display(father2) if father2 else ""
|
||||
entry1 = self.get_widget("father1")
|
||||
entry2 = self.get_widget("father2")
|
||||
entry1.set_text("%s [%s]" % (father1, father_id1))
|
||||
entry2.set_text("%s [%s]" % (father2, father_id2))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('father1', 'father2', 'father_btn1',
|
||||
'father_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
mother1 = self.fy1.get_mother_handle()
|
||||
mother2 = self.fy2.get_mother_handle()
|
||||
mother1 = database.get_person_from_handle(mother1)
|
||||
mother2 = database.get_person_from_handle(mother2)
|
||||
mother_id1 = mother1.get_gramps_id()
|
||||
mother_id2 = mother2.get_gramps_id()
|
||||
mother1 = name_displayer.display(mother1) if mother1 else ""
|
||||
mother2 = name_displayer.display(mother2) if mother2 else ""
|
||||
entry1 = self.get_widget("mother1")
|
||||
entry2 = self.get_widget("mother2")
|
||||
entry1.set_text("%s [%s]" % (mother1, mother_id1))
|
||||
entry2.set_text("%s [%s]" % (mother2, mother_id2))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('mother1', 'mother2', 'mother_btn1',
|
||||
'mother_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("rel1")
|
||||
entry2 = self.get_widget("rel2")
|
||||
entry1.set_text(str(self.fy1.get_relationship()))
|
||||
entry2.set_text(str(self.fy2.get_relationship()))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('rel1', 'rel2', 'rel_btn1', 'rel_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("marker1")
|
||||
entry2 = self.get_widget("marker2")
|
||||
entry1.set_text(str(self.fy1.get_marker()))
|
||||
entry2.set_text(str(self.fy2.get_marker()))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('marker1', 'marker2', 'marker_btn1',
|
||||
'marker_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.fy1.get_gramps_id()
|
||||
gramps2 = self.fy2.get_gramps_id()
|
||||
entry1 = self.get_widget("gramps1")
|
||||
entry2 = self.get_widget("gramps2")
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
rbutton_label1.set_label("%s and %s [%s]" %(father1, mother1, gramps1))
|
||||
rbutton_label2.set_label("%s and %s [%s]" %(father2, mother2, gramps2))
|
||||
rbutton1.connect("toggled", self.on_handle1_toggled)
|
||||
|
||||
self.connect_button("family_help", self.cb_help)
|
||||
self.connect_button("family_ok", self.cb_merge)
|
||||
self.connect_button("family_cancel", self.close)
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
"""Preferred family changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget("father_btn1").set_active(True)
|
||||
self.get_widget("mother_btn1").set_active(True)
|
||||
self.get_widget("rel_btn1").set_active(True)
|
||||
self.get_widget("marker_btn1").set_active(True)
|
||||
self.get_widget("gramps_btn1").set_active(True)
|
||||
else:
|
||||
self.get_widget("father_btn2").set_active(True)
|
||||
self.get_widget("mother_btn2").set_active(True)
|
||||
self.get_widget("rel_btn2").set_active(True)
|
||||
self.get_widget("marker_btn2").set_active(True)
|
||||
self.get_widget("gramps_btn2").set_active(True)
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of the Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section = WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Perform the merge of the families when the merge button is clicked.
|
||||
"""
|
||||
self.uistate.set_busy_cursor(True)
|
||||
need_commit = False
|
||||
database = self.dbstate.db
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.fy1
|
||||
titanic = self.fy2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.fy2
|
||||
titanic = self.fy1
|
||||
unselect_path = (0,)
|
||||
|
||||
phoenix_father = database.get_person_from_handle(
|
||||
phoenix.get_father_handle())
|
||||
phoenix_mother = database.get_person_from_handle(
|
||||
phoenix.get_mother_handle())
|
||||
titanic_father = database.get_person_from_handle(
|
||||
titanic.get_father_handle())
|
||||
titanic_mother = database.get_person_from_handle(
|
||||
titanic.get_mother_handle())
|
||||
|
||||
trans = database.transaction_begin("", True)
|
||||
|
||||
# Use merge persons on father and mother to merge a family; The merge
|
||||
# person routine also merges families if necessary. Merging is not
|
||||
# an equal operation, there is one preferred family over the other.
|
||||
# The preferred family is the first listed in a persons
|
||||
# family_handle_list. Since the GUI allows users to chose the
|
||||
# preferred father, mother and family independent of each other, while
|
||||
# the merge person routine fixes preferred family with respect to
|
||||
# father and mother, the father and mother need first to be swapped
|
||||
# into the right family, before the merge person routines can be called.
|
||||
if self.get_widget("father_btn1").get_active() ^ use_handle1:
|
||||
father_handle = phoenix.get_father_handle()
|
||||
phoenix.set_father_handle(titanic.get_father_handle())
|
||||
titanic.set_father_handle(father_handle)
|
||||
phoenix_father.replace_handle_reference('Family',
|
||||
phoenix.get_handle(), titanic.get_handle())
|
||||
titanic_father.replace_handle_reference('Family',
|
||||
titanic.get_handle(), phoenix.get_handle())
|
||||
phoenix_father, titanic_father = titanic_father, phoenix_father
|
||||
database.commit_person(phoenix_father, trans)
|
||||
database.commit_person(titanic_father, trans)
|
||||
database.commit_family(phoenix, trans)
|
||||
database.commit_family(titanic, trans)
|
||||
if self.get_widget("mother_btn1").get_active() ^ use_handle1:
|
||||
mother_handle = phoenix.get_mother_handle()
|
||||
phoenix.set_mother_handle(titanic.get_mother_handle())
|
||||
titanic.set_mother_handle(mother_handle)
|
||||
phoenix_mother.replace_handle_reference('Family',
|
||||
phoenix.get_handle(), titanic.get_handle())
|
||||
titanic_mother.replace_handle_reference('Family',
|
||||
titanic.get_handle(), phoenix.get_handle())
|
||||
phoenix_mother, titanic_mother = titanic_mother, phoenix_mother
|
||||
database.commit_person(phoenix_mother, trans)
|
||||
database.commit_person(titanic_mother, trans)
|
||||
database.commit_family(phoenix, trans)
|
||||
database.commit_family(titanic, trans)
|
||||
|
||||
if self.get_widget("rel_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_relationship(titanic.get_relationship())
|
||||
need_commit = True
|
||||
if self.get_widget("marker_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_marker(titanic.get_marker())
|
||||
need_commit = True
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
need_commit = True
|
||||
if need_commit:
|
||||
database.commit_family(phoenix, trans)
|
||||
|
||||
try:
|
||||
if phoenix_father != titanic_father:
|
||||
query = MergePersonQuery(self.dbstate, phoenix_father,
|
||||
titanic_father)
|
||||
query.execute(trans)
|
||||
if phoenix_mother != titanic_mother:
|
||||
query = MergePersonQuery(self.dbstate, phoenix_mother,
|
||||
titanic_mother)
|
||||
query.execute(trans)
|
||||
except MergeError, e:
|
||||
ErrorDialog( _("Cannot merge people"), str(e))
|
||||
# TODO: rollback
|
||||
else:
|
||||
database.transaction_commit(trans, _('Merge family'))
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
215
src/Merge/mergemedia.py
Normal file
215
src/Merge/mergemedia.py
Normal file
@ -0,0 +1,215 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provide merge capabilities for media objects.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
import const
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
import DateHandler
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Merge_Media_Objects')
|
||||
_GLADE_FILE = 'mergemedia.glade'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Media Objects
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeMediaObjects(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
Displays a dialog box that allows the media objects to be combined into one.
|
||||
"""
|
||||
def __init__(self, dbstate, uistate, handle1, handle2):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.mo1 = database.get_object_from_handle(handle1)
|
||||
self.mo2 = database.get_object_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergeobject', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget('object_title'),
|
||||
_("Merge Media Objects"))
|
||||
|
||||
# Detailed selection Widgets
|
||||
desc1 = self.mo1.get_description()
|
||||
desc2 = self.mo2.get_description()
|
||||
entry1 = self.get_widget("desc1")
|
||||
entry2 = self.get_widget("desc2")
|
||||
entry1.set_text(desc1)
|
||||
entry2.set_text(desc2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('desc1', 'desc2', 'desc_btn1', 'desc_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("path1")
|
||||
entry2 = self.get_widget("path2")
|
||||
entry1.set_text(self.mo1.get_path())
|
||||
entry2.set_text(self.mo2.get_path())
|
||||
entry1.set_position(-1)
|
||||
entry2.set_position(-1)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('path1', 'path2', 'path_btn1', 'path_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("date1")
|
||||
entry2 = self.get_widget("date2")
|
||||
entry1.set_text(DateHandler.get_date(self.mo1))
|
||||
entry2.set_text(DateHandler.get_date(self.mo2))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('date1', 'date2', 'date_btn1', 'date_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.mo1.get_gramps_id()
|
||||
gramps2 = self.mo2.get_gramps_id()
|
||||
entry1 = self.get_widget("gramps1")
|
||||
entry2 = self.get_widget("gramps2")
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
rbutton_label1.set_label("%s [%s]" % (desc1, gramps1))
|
||||
rbutton_label2.set_label("%s [%s]" % (desc2, gramps2))
|
||||
rbutton1.connect('toggled', self.on_handle1_toggled)
|
||||
|
||||
self.connect_button('object_help', self.cb_help)
|
||||
self.connect_button('object_ok', self.cb_merge)
|
||||
self.connect_button('object_cancel', self.close)
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
""" first chosen media object changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget("path_btn1").set_active(True)
|
||||
self.get_widget("desc_btn1").set_active(True)
|
||||
self.get_widget("date_btn1").set_active(True)
|
||||
self.get_widget("gramps_btn1").set_active(True)
|
||||
else:
|
||||
self.get_widget("path_btn2").set_active(True)
|
||||
self.get_widget("desc_btn2").set_active(True)
|
||||
self.get_widget("date_btn2").set_active(True)
|
||||
self.get_widget("gramps_btn2").set_active(True)
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of the Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section = WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Perform the merge of the media objects when the merge button is clicked.
|
||||
"""
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.mo1
|
||||
titanic = self.mo2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.mo2
|
||||
titanic = self.mo1
|
||||
unselect_path = (0,)
|
||||
|
||||
if self.get_widget("path_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_path(titanic.get_path())
|
||||
phoenix.set_mime_type(titanic.get_mime_type())
|
||||
if self.get_widget("desc_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_description(titanic.get_description())
|
||||
if self.get_widget("date_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_date_object(titanic.get_date_object())
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
|
||||
query = MergeMediaQuery(self.dbstate, phoenix, titanic)
|
||||
query.execute()
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.close()
|
||||
|
||||
class MergeMediaQuery(object):
|
||||
"""
|
||||
Create datqabase query to merge two media objects.
|
||||
"""
|
||||
def __init__(self, dbstate, phoenix, titanic):
|
||||
self.database = dbstate.db
|
||||
self.phoenix = phoenix
|
||||
self.titanic = titanic
|
||||
|
||||
def execute(self):
|
||||
"""
|
||||
Merges two media objects into a single object.
|
||||
"""
|
||||
new_handle = self.phoenix.get_handle()
|
||||
old_handle = self.titanic.get_handle()
|
||||
|
||||
self.phoenix.merge(self.titanic)
|
||||
|
||||
trans = self.database.transaction_begin()
|
||||
for person in self.database.iter_people():
|
||||
if person.has_media_reference(old_handle):
|
||||
person.replace_media_references(old_handle, new_handle)
|
||||
self.database.commit_person(person, trans)
|
||||
|
||||
for family in self.database.iter_families():
|
||||
if family.has_media_reference(old_handle):
|
||||
family.replace_media_references(old_handle, new_handle)
|
||||
self.database.commit_family(family, trans)
|
||||
|
||||
for event in self.database.iter_events():
|
||||
if event.has_media_reference(old_handle):
|
||||
event.replace_media_references(old_handle, new_handle)
|
||||
self.database.commit_event(event, trans)
|
||||
|
||||
for source in self.database.iter_sources():
|
||||
if source.has_media_reference(old_handle):
|
||||
source.replace_media_references(old_handle, new_handle)
|
||||
self.database.commit_source(source, trans)
|
||||
|
||||
for place in self.database.iter_places():
|
||||
if place.has_media_reference(old_handle):
|
||||
place.replace_media_references(old_handle, new_handle)
|
||||
self.database.commit_place(place, trans)
|
||||
|
||||
self.database.remove_object(old_handle, trans)
|
||||
self.database.commit_media_object(self.phoenix, trans)
|
||||
self.database.transaction_commit(trans, _("Merge Media Objects"))
|
251
src/Merge/mergenote.py
Normal file
251
src/Merge/mergenote.py
Normal file
@ -0,0 +1,251 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provide merge capabilities for notes.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
import const
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
from gui.widgets.styledtextbuffer import StyledTextBuffer
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Merge_Notes')
|
||||
_GLADE_FILE = 'mergenote.glade'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Notes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeNotes(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
Displays a dialog box that allows two notes to be combined into one.
|
||||
"""
|
||||
def __init__(self, dbstate, uistate, handle1, handle2):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.no1 = database.get_note_from_handle(handle1)
|
||||
self.no2 = database.get_note_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergenote', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget("note_title"),
|
||||
_("Merge Notes"))
|
||||
|
||||
# Detailed selection widgets
|
||||
text1 = self.no1.get_styledtext()
|
||||
tv1 = self.get_widget("text1")
|
||||
tb1 = StyledTextBuffer()
|
||||
tv1.set_buffer(tb1)
|
||||
tb1.set_text(text1)
|
||||
text2 = self.no2.get_styledtext()
|
||||
tv2 = self.get_widget("text2")
|
||||
tb2 = StyledTextBuffer()
|
||||
tv2.set_buffer(tb2)
|
||||
tb2.set_text(text2)
|
||||
if text1 == text2:
|
||||
for widget_name in ('text1', 'text2', 'text_btn1', 'text_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("type1")
|
||||
entry2 = self.get_widget("type2")
|
||||
entry1.set_text(str(self.no1.get_type()))
|
||||
entry2.set_text(str(self.no2.get_type()))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('type1', 'type2', 'type_btn1', 'type_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
format_names = (_('flowed'), _('preformatted'))
|
||||
entry1 = self.get_widget("format1")
|
||||
entry2 = self.get_widget("format2")
|
||||
entry1.set_text(format_names[self.no1.get_format()])
|
||||
entry2.set_text(format_names[self.no2.get_format()])
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('format1', 'format2', 'format_btn1',
|
||||
'format_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("marker1")
|
||||
entry2 = self.get_widget("marker2")
|
||||
entry1.set_text(str(self.no1.get_marker()))
|
||||
entry2.set_text(str(self.no2.get_marker()))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('marker1', 'marker2', 'marker_btn1',
|
||||
'marker_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.no1.get_gramps_id()
|
||||
gramps2 = self.no2.get_gramps_id()
|
||||
entry1 = self.get_widget("gramps1")
|
||||
entry2 = self.get_widget("gramps2")
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
text1short = self.no1.get()
|
||||
if len(text1short) > 50:
|
||||
text1short = text1short[0:47] + "..."
|
||||
text2short = self.no2.get()
|
||||
if len(text2short) > 50:
|
||||
text2short = text2short[0:47] + "..."
|
||||
rbutton_label1.set_label("%s [%s]" % (text1short, gramps1))
|
||||
rbutton_label2.set_label("%s [%s]" % (text2short, gramps2))
|
||||
rbutton1.connect("toggled", self.on_handle1_toggled)
|
||||
|
||||
self.connect_button("note_help", self.cb_help)
|
||||
self.connect_button("note_ok", self.cb_merge)
|
||||
self.connect_button("note_cancel", self.close)
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
""" preferred note changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget("text_btn1").set_active(True)
|
||||
self.get_widget("type_btn1").set_active(True)
|
||||
self.get_widget("format_btn1").set_active(True)
|
||||
self.get_widget("marker_btn1").set_active(True)
|
||||
self.get_widget("gramps_btn1").set_active(True)
|
||||
else:
|
||||
self.get_widget("text_btn2").set_active(True)
|
||||
self.get_widget("type_btn2").set_active(True)
|
||||
self.get_widget("format_btn2").set_active(True)
|
||||
self.get_widget("marker_btn2").set_active(True)
|
||||
self.get_widget("gramps_btn2").set_active(True)
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of the Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section= WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Perform the merge of the notes when the merge button is clicked.
|
||||
"""
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.no1
|
||||
titanic = self.no2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.no2
|
||||
titanic = self.no1
|
||||
unselect_path = (0,)
|
||||
|
||||
if self.get_widget("text_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_styledtext(titanic.get_styledtext())
|
||||
if self.get_widget("type_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_type(titanic.get_type())
|
||||
if self.get_widget("format_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_format(titanic.get_format())
|
||||
if self.get_widget("marker_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_marker(titanic.get_marker())
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
|
||||
query = MergeNoteQuery(self.dbstate, phoenix, titanic)
|
||||
query.execute()
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.close()
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Note Query
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeNoteQuery(object):
|
||||
"""
|
||||
Create database query to merge two notes.
|
||||
"""
|
||||
def __init__(self, dbstate, phoenix, titanic):
|
||||
self.database = dbstate.db
|
||||
self.phoenix = phoenix
|
||||
self.titanic = titanic
|
||||
|
||||
def execute(self):
|
||||
"""
|
||||
Merges two notes into a single note.
|
||||
"""
|
||||
new_handle = self.phoenix.get_handle()
|
||||
old_handle = self.titanic.get_handle()
|
||||
self.phoenix.merge(self.titanic)
|
||||
trans = self.database.transaction_begin()
|
||||
|
||||
for person in self.database.iter_people():
|
||||
if person.has_note_reference(old_handle):
|
||||
person.replace_note_references(old_handle, new_handle)
|
||||
self.database.commit_person(person, trans)
|
||||
|
||||
for family in self.database.iter_families():
|
||||
if family.has_note_reference(old_handle):
|
||||
family.replace_note_references(old_handle, new_handle)
|
||||
self.database.commit_family(family, trans)
|
||||
|
||||
for event in self.database.iter_events():
|
||||
if event.has_note_reference(old_handle):
|
||||
event.replace_note_references(old_handle, new_handle)
|
||||
self.database.commit_event(event, trans)
|
||||
|
||||
for source in self.database.iter_sources():
|
||||
if source.has_note_reference(old_handle):
|
||||
source.replace_note_references(old_handle, new_handle)
|
||||
self.database.commit_source(source, trans)
|
||||
|
||||
for place in self.database.iter_places():
|
||||
if place.has_note_reference(old_handle):
|
||||
place.replace_note_references(old_handle, new_handle)
|
||||
self.database.commit_place(place, trans)
|
||||
|
||||
for obj in self.database.iter_media_objects():
|
||||
if obj.has_note_reference(old_handle):
|
||||
obj.replace_note_references(old_handle, new_handle)
|
||||
self.database.commit_media_object(obj, trans)
|
||||
|
||||
for repo in self.database.iter_repositories():
|
||||
if repo.has_note_reference(old_handle):
|
||||
repo.replace_note_references(old_handle, new_handle)
|
||||
self.database.commit_repository(repo, trans)
|
||||
|
||||
self.database.remove_note(old_handle, trans)
|
||||
self.database.commit_note(self.phoenix, trans)
|
||||
self.database.transaction_commit(trans, _("Merge Notes"))
|
463
src/Merge/mergeperson.py
Normal file
463
src/Merge/mergeperson.py
Normal file
@ -0,0 +1,463 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
# Copyright (C) 2010 Jakim Friant
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provide merge capabilities for persons.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import pango
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
from gen.plug.report import utils as ReportUtils
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import const
|
||||
import GrampsDisplay
|
||||
import DateHandler
|
||||
from QuestionDialog import ErrorDialog
|
||||
from Errors import MergeError
|
||||
import ManagedWindow
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = "%s_-_Entering_and_Editing_Data:_Detailed_-_part_3" % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _("manual|Merge_People")
|
||||
_GLADE_FILE = "mergeperson.glade"
|
||||
|
||||
sex = ( _("female"), _("male"), _("unknown") )
|
||||
|
||||
def name_of(person):
|
||||
"""Return string with name and ID of a person."""
|
||||
if not person:
|
||||
return ""
|
||||
return "%s [%s]" % (name_displayer.display(person), person.get_gramps_id())
|
||||
|
||||
class MergePeople(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
Displays a dialog box that allows the persons to be combined into one.
|
||||
"""
|
||||
def __init__(self, dbstate, uistate, handle1, handle2):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.pr1 = database.get_person_from_handle(handle1)
|
||||
self.pr2 = database.get_person_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergeperson', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget("person_title"),
|
||||
_("Merge People"))
|
||||
|
||||
# Detailed selection widgets
|
||||
name1 = name_displayer.display_name(self.pr1.get_primary_name())
|
||||
name2 = name_displayer.display_name(self.pr2.get_primary_name())
|
||||
entry1 = self.get_widget("name1")
|
||||
entry2 = self.get_widget("name2")
|
||||
entry1.set_text(name1)
|
||||
entry2.set_text(name2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('name1', 'name2', 'name_btn1', 'name_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("gender1")
|
||||
entry2 = self.get_widget("gender2")
|
||||
entry1.set_text(sex[self.pr1.get_gender()])
|
||||
entry2.set_text(sex[self.pr2.get_gender()])
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gender1', 'gender2', 'gender_btn1',
|
||||
'gender_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("marker1")
|
||||
entry2 = self.get_widget("marker2")
|
||||
entry1.set_text(str(self.pr1.get_marker()))
|
||||
entry2.set_text(str(self.pr2.get_marker()))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('marker1', 'marker2', 'marker_btn1',
|
||||
'marker_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.pr1.get_gramps_id()
|
||||
gramps2 = self.pr2.get_gramps_id()
|
||||
entry1 = self.get_widget("gramps1")
|
||||
entry2 = self.get_widget("gramps2")
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
rbutton_label1.set_label(name1 + " [" + gramps1 + "]")
|
||||
rbutton_label2.set_label(name2 + " [" + gramps2 + "]")
|
||||
rbutton1.connect("toggled", self.on_handle1_toggled)
|
||||
expander2 = self.get_widget("expander2")
|
||||
self.expander_handler = \
|
||||
expander2.connect("activate", self.on_expander2_activated)
|
||||
|
||||
self.connect_button("person_help", self.cb_help)
|
||||
self.connect_button("person_ok", self.cb_merge)
|
||||
self.connect_button("person_cancel", self.close)
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
"""Preferred person changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget("name_btn1").set_active(True)
|
||||
self.get_widget("gender_btn1").set_active(True)
|
||||
self.get_widget("marker_btn1").set_active(True)
|
||||
self.get_widget("gramps_btn1").set_active(True)
|
||||
else:
|
||||
self.get_widget("name_btn2").set_active(True)
|
||||
self.get_widget("gender_btn2").set_active(True)
|
||||
self.get_widget("marker_btn2").set_active(True)
|
||||
self.get_widget("gramps_btn2").set_active(True)
|
||||
|
||||
def on_expander2_activated(self, obj):
|
||||
"""Context Information expander is activated"""
|
||||
text1 = self.get_widget('text1')
|
||||
text2 = self.get_widget('text2')
|
||||
self.display(text1.get_buffer(), self.pr1)
|
||||
self.display(text2.get_buffer(), self.pr2)
|
||||
expander2 = self.get_widget("expander2")
|
||||
expander2.disconnect(self.expander_handler)
|
||||
|
||||
def add(self, tobj, tag, text):
|
||||
"""Add text text to text buffer tobj with formatting tag."""
|
||||
text += "\n"
|
||||
tobj.insert_with_tags(tobj.get_end_iter(), text, tag)
|
||||
|
||||
def display(self, tobj, person):
|
||||
"""Fill text buffer tobj with detailed info on person person."""
|
||||
database = self.dbstate.db
|
||||
normal = tobj.create_tag()
|
||||
normal.set_property('indent', 10)
|
||||
normal.set_property('pixels-above-lines', 1)
|
||||
normal.set_property('pixels-below-lines', 1)
|
||||
indent = tobj.create_tag()
|
||||
indent.set_property('indent', 30)
|
||||
indent.set_property('pixels-above-lines', 1)
|
||||
indent.set_property('pixels-below-lines', 1)
|
||||
title = tobj.create_tag()
|
||||
title.set_property('weight', pango.WEIGHT_BOLD)
|
||||
title.set_property('scale', pango.SCALE_LARGE)
|
||||
self.add(tobj, title, name_displayer.display(person))
|
||||
self.add(tobj, normal, "%s:\t%s" % (_('ID'),
|
||||
person.get_gramps_id()))
|
||||
self.add(tobj, normal, "%s:\t%s" % (_('Gender'),
|
||||
sex[person.get_gender()]))
|
||||
bref = person.get_birth_ref()
|
||||
if bref:
|
||||
self.add(tobj, normal, "%s:\t%s" % (_('Birth'),
|
||||
self.get_event_info(bref.ref)))
|
||||
dref = person.get_death_ref()
|
||||
if dref:
|
||||
self.add(tobj, normal, "%s:\t%s" % (_('Death'),
|
||||
self.get_event_info(dref.ref)))
|
||||
|
||||
nlist = person.get_alternate_names()
|
||||
if len(nlist) > 0:
|
||||
self.add(tobj, title, _("Alternate Names"))
|
||||
for name in nlist:
|
||||
self.add(tobj, normal,
|
||||
name_displayer.display_name(name))
|
||||
|
||||
elist = person.get_event_ref_list()
|
||||
if len(elist) > 0:
|
||||
self.add(tobj, title, _("Events"))
|
||||
for event_ref in person.get_event_ref_list():
|
||||
event_handle = event_ref.ref
|
||||
name = str(
|
||||
database.get_event_from_handle(event_handle).get_type())
|
||||
self.add(tobj, normal, "%s:\t%s" %
|
||||
(name, self.get_event_info(event_handle)))
|
||||
plist = person.get_parent_family_handle_list()
|
||||
|
||||
if len(plist) > 0:
|
||||
self.add(tobj, title, _("Parents"))
|
||||
for fid in person.get_parent_family_handle_list():
|
||||
(fname, mname, gid) = self.get_parent_info(fid)
|
||||
self.add(tobj, normal, "%s:\t%s" % (_('Family ID'), gid))
|
||||
if fname:
|
||||
self.add(tobj, indent, "%s:\t%s" % (_('Father'), fname))
|
||||
if mname:
|
||||
self.add(tobj, indent, "%s:\t%s" % (_('Mother'), mname))
|
||||
else:
|
||||
self.add(tobj, normal, _("No parents found"))
|
||||
|
||||
self.add(tobj, title, _("Spouses"))
|
||||
slist = person.get_family_handle_list()
|
||||
if len(slist) > 0:
|
||||
for fid in slist:
|
||||
(fname, mname, pid) = self.get_parent_info(fid)
|
||||
family = database.get_family_from_handle(fid)
|
||||
self.add(tobj, normal, "%s:\t%s" % (_('Family ID'), pid))
|
||||
spouse_id = ReportUtils.find_spouse(person, family)
|
||||
if spouse_id:
|
||||
spouse = database.get_person_from_handle(spouse_id)
|
||||
self.add(tobj, indent, "%s:\t%s" % (_('Spouse'),
|
||||
name_of(spouse)))
|
||||
relstr = str(family.get_relationship())
|
||||
self.add(tobj, indent, "%s:\t%s" % (_('Type'), relstr))
|
||||
event = ReportUtils.find_marriage(database, family)
|
||||
if event:
|
||||
self.add(tobj, indent, "%s:\t%s" % (
|
||||
_('Marriage'),
|
||||
self.get_event_info(event.get_handle())))
|
||||
for child_ref in family.get_child_ref_list():
|
||||
child = database.get_person_from_handle(child_ref.ref)
|
||||
self.add(tobj, indent, "%s:\t%s" % (_('Child'),
|
||||
name_of(child)))
|
||||
else:
|
||||
self.add(tobj, normal, _("No spouses or children found"))
|
||||
|
||||
alist = person.get_address_list()
|
||||
if len(alist) > 0:
|
||||
self.add(tobj, title, _("Addresses"))
|
||||
for addr in alist:
|
||||
location = ", ".join([addr.get_street(), addr.get_city(),
|
||||
addr.get_state(), addr.get_country(),
|
||||
addr.get_postal_code(), addr.get_phone()])
|
||||
self.add(tobj, normal, location.strip())
|
||||
|
||||
def get_parent_info(self, fid):
|
||||
"""Return tuple of father name, mother name and family ID"""
|
||||
database = self.dbstate.db
|
||||
family = database.get_family_from_handle(fid)
|
||||
father_id = family.get_father_handle()
|
||||
mother_id = family.get_mother_handle()
|
||||
if father_id:
|
||||
father = database.get_person_from_handle(father_id)
|
||||
fname = name_of(father)
|
||||
else:
|
||||
fname = u""
|
||||
if mother_id:
|
||||
mother = database.get_person_from_handle(mother_id)
|
||||
mname = name_of(mother)
|
||||
else:
|
||||
mname = u""
|
||||
return (fname, mname, family.get_gramps_id())
|
||||
|
||||
def get_event_info(self, handle):
|
||||
"""Return date and place of an event as string."""
|
||||
date = ""
|
||||
place = ""
|
||||
if handle:
|
||||
event = self.dbstate.db.get_event_from_handle(handle)
|
||||
date = DateHandler.get_date(event)
|
||||
place = self.place_name(event)
|
||||
if date:
|
||||
return ("%s, %s" % (date, place)) if place else date
|
||||
else:
|
||||
return place or ""
|
||||
else:
|
||||
return ""
|
||||
|
||||
def place_name(self, event):
|
||||
"""Return place name of an event as string."""
|
||||
place_id = event.get_place_handle()
|
||||
if place_id:
|
||||
place = self.dbstate.db.get_place_from_handle(place_id)
|
||||
return place.get_title()
|
||||
else:
|
||||
return ""
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section = WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Perform the merge of the persons when the merge button is clicked.
|
||||
"""
|
||||
self.uistate.set_busy_cursor(True)
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.pr1
|
||||
titanic = self.pr2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.pr2
|
||||
titanic = self.pr1
|
||||
unselect_path = (0,)
|
||||
|
||||
if self.get_widget("name_btn1").get_active() ^ use_handle1:
|
||||
swapname = phoenix.get_primary_name()
|
||||
phoenix.set_primary_name(titanic.get_primary_name())
|
||||
titanic.set_primary_name(swapname)
|
||||
if self.get_widget("gender_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gender(titanic.get_gender())
|
||||
if self.get_widget("marker_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_marker(titanic.get_marker())
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
swapid = phoenix.get_gramps_id()
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
titanic.set_gramps_id(swapid)
|
||||
|
||||
try:
|
||||
query = MergePersonQuery(self.dbstate, phoenix, titanic)
|
||||
query.execute()
|
||||
except MergeError, errstr:
|
||||
ErrorDialog( _("Cannot merge people"), errstr)
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
||||
|
||||
class MergePersonQuery(object):
|
||||
"""
|
||||
Create database query to merge two persons.
|
||||
"""
|
||||
def __init__(self, dbstate, phoenix, titanic):
|
||||
self.database = dbstate.db
|
||||
self.phoenix = phoenix
|
||||
self.titanic = titanic
|
||||
if self.check_for_spouse(self.phoenix, self.titanic):
|
||||
raise MergeError(_("Spouses cannot be merged. To merge these "
|
||||
"people, you must first break the relationship between them."))
|
||||
if self.check_for_child(self.phoenix, self.titanic):
|
||||
raise MergeError(_("A parent and child cannot be merged. To merge "
|
||||
"these people, you must first break the relationship between "
|
||||
"them"))
|
||||
|
||||
def check_for_spouse(self, person1, person2):
|
||||
"""Return if person1 and person2 are spouses of eachother."""
|
||||
fs1 = set(person1.get_family_handle_list())
|
||||
fs2 = set(person2.get_family_handle_list())
|
||||
return len(fs1.intersection(fs2)) != 0
|
||||
|
||||
def check_for_child(self, person1, person2):
|
||||
"""Return if person1 and person2 have a child-parent relationship."""
|
||||
fs1 = set(person1.get_family_handle_list())
|
||||
fp1 = set(person1.get_parent_family_handle_list())
|
||||
fs2 = set(person2.get_family_handle_list())
|
||||
fp2 = set(person2.get_parent_family_handle_list())
|
||||
return len(fs1.intersection(fp2)) != 0 or len(fs2.intersection(fp1))
|
||||
|
||||
def merge_families(self, main_family_handle, family, trans):
|
||||
new_handle = self.phoenix.get_handle()
|
||||
family_handle = family.get_handle()
|
||||
main_family = self.database.get_family_from_handle(main_family_handle)
|
||||
main_family.merge(family)
|
||||
for childref in family.get_child_ref_list():
|
||||
child = self.database.get_person_from_handle(
|
||||
childref.get_reference_handle())
|
||||
if main_family_handle in child.parent_family_list:
|
||||
child.remove_handle_references('Family', [family_handle])
|
||||
else:
|
||||
child.replace_handle_reference('Family', family_handle,
|
||||
main_family_handle)
|
||||
self.database.commit_person(child, trans)
|
||||
self.phoenix.remove_family_handle(family_handle)
|
||||
family_father_handle = family.get_father_handle()
|
||||
spouse_handle = family.get_mother_handle() if \
|
||||
new_handle == family_father_handle else family_father_handle
|
||||
spouse = self.database.get_person_from_handle(spouse_handle)
|
||||
spouse.remove_family_handle(family_handle)
|
||||
self.database.commit_person(spouse, trans)
|
||||
self.database.remove_family(family_handle, trans)
|
||||
self.database.commit_family(main_family, trans)
|
||||
|
||||
def execute(self, trans=None):
|
||||
"""
|
||||
Merges two persons into a single person.
|
||||
"""
|
||||
new_handle = self.phoenix.get_handle()
|
||||
old_handle = self.titanic.get_handle()
|
||||
|
||||
self.phoenix.merge(self.titanic)
|
||||
|
||||
# For now use a batch transaction, because merger of persons is
|
||||
# complicated, thus is done in several steps and the database should
|
||||
# be updated after each step for the calculation of the next step.
|
||||
# Normal Gramps transactions only touch the database upon
|
||||
# transaction_commit, not after each commit_person/commit_family.
|
||||
# Unfortunately batch transactions are no transactions at all, so there
|
||||
# is not possibility of rollback in case of trouble.
|
||||
if trans is None:
|
||||
need_commit = True
|
||||
trans = self.database.transaction_begin("", True)
|
||||
else:
|
||||
need_commit = False
|
||||
|
||||
commit_persons = []
|
||||
for person in self.database.iter_people():
|
||||
if person.has_handle_reference('Person', old_handle):
|
||||
person.replace_handle_reference('Person', old_handle,new_handle)
|
||||
#self.database.commit_person(person, trans) # DEADLOCK
|
||||
person_handle = person.get_handle()
|
||||
if person_handle == new_handle:
|
||||
self.phoenix.replace_handle_reference('Person', old_handle,
|
||||
new_handle)
|
||||
elif person_handle != old_handle:
|
||||
commit_persons.append(person)
|
||||
for person in commit_persons:
|
||||
self.database.commit_person(person, trans)
|
||||
|
||||
for family_handle in self.phoenix.get_parent_family_handle_list():
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
if family.has_handle_reference('Person', old_handle):
|
||||
family.replace_handle_reference('Person', old_handle,new_handle)
|
||||
self.database.commit_family(family, trans)
|
||||
|
||||
parent_list = []
|
||||
family_handle_list = self.phoenix.get_family_handle_list()[:]
|
||||
for family_handle in family_handle_list:
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
parents = (family.get_father_handle(), family.get_mother_handle())
|
||||
if family.has_handle_reference('Person', old_handle):
|
||||
family.replace_handle_reference('Person', old_handle,new_handle)
|
||||
parents = (family.get_father_handle(),
|
||||
family.get_mother_handle())
|
||||
# prune means merging families in this case.
|
||||
if parents in parent_list:
|
||||
# also merge when father_handle or mother_handle == None!
|
||||
idx = parent_list.index(parents)
|
||||
main_family_handle = family_handle_list[idx]
|
||||
self.merge_families(main_family_handle, family, trans)
|
||||
continue
|
||||
self.database.commit_family(family, trans)
|
||||
parent_list.append(parents)
|
||||
|
||||
self.database.remove_person(old_handle, trans)
|
||||
self.database.commit_person(self.phoenix, trans)
|
||||
if need_commit:
|
||||
self.database.transaction_commit(trans, _('Merge Person'))
|
231
src/Merge/mergeplace.py
Normal file
231
src/Merge/mergeplace.py
Normal file
@ -0,0 +1,231 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id: _MergePlace.py 14135 2010-01-25 17:45:21Z gbritton $
|
||||
|
||||
"""
|
||||
Provide merge capabilities for places.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
import const
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Merge_Places')
|
||||
_GLADE_FILE = 'mergeplace.glade'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Places
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergePlaces(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
Displays a dialog box that allows the places to be combined into one.
|
||||
"""
|
||||
def __init__(self, dbstate, uistate, handle1, handle2):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.pl1 = database.get_place_from_handle(handle1)
|
||||
self.pl2 = database.get_place_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergeplace', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget('place_title'),
|
||||
_("Merge Places"))
|
||||
|
||||
# Detailed selection widgets
|
||||
title1 = self.pl1.get_title()
|
||||
title2 = self.pl2.get_title()
|
||||
entry1 = self.get_widget("title1")
|
||||
entry2 = self.get_widget("title2")
|
||||
entry1.set_text(title1)
|
||||
entry2.set_text(title2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('title1', 'title2', 'title_btn1', 'title_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("lat1")
|
||||
entry2 = self.get_widget("lat2")
|
||||
entry1.set_text(self.pl1.get_latitude())
|
||||
entry2.set_text(self.pl2.get_latitude())
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('lat1', 'lat2', 'lat_btn1', 'lat_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("long1")
|
||||
entry2 = self.get_widget("long2")
|
||||
entry1.set_text(self.pl1.get_longitude())
|
||||
entry2.set_text(self.pl2.get_longitude())
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('long1', 'long2', 'long_btn1', 'long_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
loc1 = self.pl1.get_main_location().get_text_data_list()
|
||||
loc2 = self.pl2.get_main_location().get_text_data_list()
|
||||
tv1 = self.get_widget("loc1")
|
||||
tv2 = self.get_widget("loc2")
|
||||
tb1 = gtk.TextBuffer()
|
||||
tb2 = gtk.TextBuffer()
|
||||
tv1.set_buffer(tb1)
|
||||
tv2.set_buffer(tb2)
|
||||
tb1.set_text("\n".join(loc1))
|
||||
tb2.set_text("\n".join(loc2))
|
||||
if loc1 == loc2:
|
||||
for widget_name in ('loc1', 'loc2', 'loc_btn1', 'loc_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.pl1.get_gramps_id()
|
||||
gramps2 = self.pl2.get_gramps_id()
|
||||
entry1 = self.get_widget("gramps1")
|
||||
entry2 = self.get_widget("gramps2")
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
rbutton_label1.set_label(title1 + " [" + gramps1 + "]")
|
||||
rbutton_label2.set_label(title2 + " [" + gramps2 + "]")
|
||||
rbutton1.connect("toggled", self.on_handle1_toggled)
|
||||
|
||||
self.connect_button('place_help', self.cb_help)
|
||||
self.connect_button('place_ok', self.cb_merge)
|
||||
self.connect_button('place_cancel', self.close)
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
"""first chosen place changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget("title_btn1").set_active(True)
|
||||
self.get_widget("lat_btn1").set_active(True)
|
||||
self.get_widget("long_btn1").set_active(True)
|
||||
self.get_widget("loc_btn1").set_active(True)
|
||||
self.get_widget("gramps_btn1").set_active(True)
|
||||
else:
|
||||
self.get_widget("title_btn2").set_active(True)
|
||||
self.get_widget("lat_btn2").set_active(True)
|
||||
self.get_widget("long_btn2").set_active(True)
|
||||
self.get_widget("loc_btn2").set_active(True)
|
||||
self.get_widget("gramps_btn2").set_active(True)
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section = WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Performs the merge of the places when the merge button is clicked.
|
||||
"""
|
||||
self.uistate.set_busy_cursor(True)
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.pl1
|
||||
titanic = self.pl2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.pl2
|
||||
titanic = self.pl1
|
||||
unselect_path = (0,)
|
||||
|
||||
if self.get_widget("title_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_title(titanic.get_title())
|
||||
if self.get_widget("lat_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_latitude(titanic.get_latitude())
|
||||
if self.get_widget("long_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_longitude(titanic.get_longitude())
|
||||
if self.get_widget("loc_btn1").get_active() ^ use_handle1:
|
||||
swaploc = phoenix.get_main_location()
|
||||
phoenix.set_main_location(titanic.get_main_location())
|
||||
titanic.set_main_location(swaploc)
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
|
||||
query = MergePlaceQuery(self.dbstate, phoenix, titanic)
|
||||
query.execute()
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
||||
|
||||
class MergePlaceQuery(object):
|
||||
"""
|
||||
Create database query to merge two places.
|
||||
"""
|
||||
def __init__(self, dbstate, phoenix, titanic):
|
||||
self.database = dbstate.db
|
||||
self.phoenix = phoenix
|
||||
self.titanic = titanic
|
||||
|
||||
def execute(self):
|
||||
"""
|
||||
Merges to places into a single place.
|
||||
"""
|
||||
new_handle = self.phoenix.get_handle()
|
||||
old_handle = self.titanic.get_handle()
|
||||
|
||||
self.phoenix.merge(self.titanic)
|
||||
|
||||
trans = self.database.transaction_begin()
|
||||
for person in self.database.iter_people():
|
||||
if person.has_handle_reference('Place', old_handle):
|
||||
person.replace_handle_reference('Place', old_handle, new_handle)
|
||||
self.database.commit_person(person, trans)
|
||||
|
||||
for family in self.database.iter_families():
|
||||
if family.has_handle_reference('Place', old_handle):
|
||||
family.replace_handle_reference('Place', old_handle, new_handle)
|
||||
self.database.commit_family(family, trans)
|
||||
|
||||
for event in self.database.iter_events():
|
||||
if event.has_handle_reference('Place', old_handle):
|
||||
event.replace_handle_reference('Place', old_handle, new_handle)
|
||||
self.database.commit_event(event, trans)
|
||||
|
||||
self.database.remove_place(old_handle, trans)
|
||||
self.database.commit_place(self.phoenix, trans)
|
||||
self.database.transaction_commit(trans, _("Merge Places"))
|
181
src/Merge/mergerepository.py
Normal file
181
src/Merge/mergerepository.py
Normal file
@ -0,0 +1,181 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Provide merge capabilities for repositories.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
import const
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Merge_Repositories')
|
||||
_GLADE_FILE = 'mergerepository.glade'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Repositories
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeRepositories(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
Displays a dialog box that allows two repositories to be combined into one.
|
||||
"""
|
||||
def __init__(self, dbstate, uistate, handle1, handle2):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.rp1 = database.get_repository_from_handle(handle1)
|
||||
self.rp2 = database.get_repository_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergerepository', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget('repository_title'),
|
||||
_("Merge Repositories"))
|
||||
|
||||
# Detailed selection widgets
|
||||
name1 = self.rp1.get_name()
|
||||
name2 = self.rp2.get_name()
|
||||
entry1 = self.get_widget('name1')
|
||||
entry2 = self.get_widget('name2')
|
||||
entry1.set_text(name1)
|
||||
entry2.set_text(name2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('name1', 'name2', 'name_btn1', 'name_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget('type1')
|
||||
entry2 = self.get_widget('type2')
|
||||
entry1.set_text(str(self.rp1.get_type()))
|
||||
entry2.set_text(str(self.rp2.get_type()))
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('type1', 'type2', 'type_btn1', 'type_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.rp1.get_gramps_id()
|
||||
gramps2 = self.rp2.get_gramps_id()
|
||||
entry1 = self.get_widget('gramps1')
|
||||
entry2 = self.get_widget('gramps2')
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
rbutton_label1.set_label("%s [%s]" % (name1, gramps1))
|
||||
rbutton_label2.set_label("%s [%s]" % (name2, gramps2))
|
||||
rbutton1.connect('toggled', self.on_handle1_toggled)
|
||||
|
||||
self.connect_button('repository_help', self.cb_help)
|
||||
self.connect_button('repository_ok', self.cb_merge)
|
||||
self.connect_button('repository_cancel', self.close)
|
||||
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
""" preferred repository changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget('name_btn1').set_active(True)
|
||||
self.get_widget('type_btn1').set_active(True)
|
||||
self.get_widget('gramps_btn1').set_active(True)
|
||||
else:
|
||||
self.get_widget('name_btn2').set_active(True)
|
||||
self.get_widget('type_btn2').set_active(True)
|
||||
self.get_widget('gramps_btn2').set_active(True)
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of the Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section = WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Perform the merge of the repositories when the merge button is clicked.
|
||||
"""
|
||||
self.uistate.set_busy_cursor(True)
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.rp1
|
||||
titanic = self.rp2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.rp2
|
||||
titanic = self.rp1
|
||||
unselect_path = (0,)
|
||||
|
||||
if self.get_widget("name_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_name(titanic.get_name())
|
||||
if self.get_widget("type_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_type(titanic.get_type())
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
|
||||
query = MergeRepoQuery(self.dbstate, phoenix, titanic)
|
||||
query.execute()
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
||||
|
||||
class MergeRepoQuery(object):
|
||||
"""
|
||||
Create database query to merge two repositories.
|
||||
"""
|
||||
def __init__(self, dbstate, phoenix, titanic):
|
||||
self.database = dbstate.db
|
||||
self.phoenix = phoenix
|
||||
self.titanic = titanic
|
||||
|
||||
def execute(self):
|
||||
"""
|
||||
Merges two repositories into a single repository.
|
||||
"""
|
||||
new_handle = self.phoenix.get_handle()
|
||||
old_handle = self.titanic.get_handle()
|
||||
|
||||
self.phoenix.merge(self.titanic)
|
||||
|
||||
trans = self.database.transaction_begin()
|
||||
for source in self.database.iter_sources():
|
||||
if source.has_repo_reference(old_handle):
|
||||
source.replace_repo_references(old_handle, new_handle)
|
||||
self.database.commit_source(source, trans)
|
||||
self.database.remove_repository(old_handle, trans)
|
||||
self.database.commit_repository(self.phoenix, trans)
|
||||
self.database.transaction_commit(trans, _("Merge Repositories"))
|
238
src/Merge/mergesource.py
Normal file
238
src/Merge/mergesource.py
Normal file
@ -0,0 +1,238 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2005 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id: _MergeSource.py 14135 2010-01-25 17:45:21Z gbritton $
|
||||
|
||||
"""
|
||||
Provide merge capabilities for sources.
|
||||
"""
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
import const
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Gramps constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
|
||||
const.URL_MANUAL_PAGE
|
||||
WIKI_HELP_SEC = _('manual|Merge_Sources')
|
||||
_GLADE_FILE = 'mergesource.glade'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Merge Sources
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class MergeSources(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
Displays a dialog box that allows the sources to be combined into one.
|
||||
"""
|
||||
def __init__(self, dbstate, uistate, handle1, handle2):
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
|
||||
self.dbstate = dbstate
|
||||
database = dbstate.db
|
||||
self.src1 = database.get_source_from_handle(handle1)
|
||||
self.src2 = database.get_source_from_handle(handle2)
|
||||
|
||||
self.define_glade('mergesource', _GLADE_FILE)
|
||||
self.set_window(self._gladeobj.toplevel,
|
||||
self.get_widget('source_title'),
|
||||
_("Merge Sources"))
|
||||
|
||||
# Detailed Selection widgets
|
||||
title1 = self.src1.get_title()
|
||||
title2 = self.src2.get_title()
|
||||
entry1 = self.get_widget("title1")
|
||||
entry2 = self.get_widget("title2")
|
||||
entry1.set_text(title1)
|
||||
entry2.set_text(title2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('title1', 'title2', 'title_btn1', 'title_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("author1")
|
||||
entry2 = self.get_widget("author2")
|
||||
entry1.set_text(self.src1.get_author())
|
||||
entry2.set_text(self.src2.get_author())
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('author1', 'author2', 'author_btn1',
|
||||
'author_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("abbrev1")
|
||||
entry2 = self.get_widget("abbrev2")
|
||||
entry1.set_text(self.src1.get_abbreviation())
|
||||
entry2.set_text(self.src2.get_abbreviation())
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('abbrev1', 'abbrev2', 'abbrev_btn1',
|
||||
'abbrev_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
entry1 = self.get_widget("pub1")
|
||||
entry2 = self.get_widget("pub2")
|
||||
entry1.set_text(self.src1.get_publication_info())
|
||||
entry2.set_text(self.src2.get_publication_info())
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('pub1', 'pub2', 'pub_btn1', 'pub_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
gramps1 = self.src1.get_gramps_id()
|
||||
gramps2 = self.src2.get_gramps_id()
|
||||
entry1 = self.get_widget("gramps1")
|
||||
entry2 = self.get_widget("gramps2")
|
||||
entry1.set_text(gramps1)
|
||||
entry2.set_text(gramps2)
|
||||
if entry1.get_text() == entry2.get_text():
|
||||
for widget_name in ('gramps1', 'gramps2', 'gramps_btn1',
|
||||
'gramps_btn2'):
|
||||
self.get_widget(widget_name).set_sensitive(False)
|
||||
|
||||
# Main window widgets that determine which handle survives
|
||||
rbutton1 = self.get_widget("handle_btn1")
|
||||
rbutton_label1 = self.get_widget("label_handle_btn1")
|
||||
rbutton_label2 = self.get_widget("label_handle_btn2")
|
||||
rbutton_label1.set_label(title1 + " [" + gramps1 + "]")
|
||||
rbutton_label2.set_label(title2 + " [" + gramps2 + "]")
|
||||
rbutton1.connect("toggled", self.on_handle1_toggled)
|
||||
|
||||
self.connect_button('source_help', self.cb_help)
|
||||
self.connect_button('source_ok', self.cb_merge)
|
||||
self.connect_button('source_cancel', self.close)
|
||||
self.show()
|
||||
|
||||
def on_handle1_toggled(self, obj):
|
||||
"""first chosen source changes"""
|
||||
if obj.get_active():
|
||||
self.get_widget("title_btn1").set_active(True)
|
||||
self.get_widget("author_btn1").set_active(True)
|
||||
self.get_widget("abbrev_btn1").set_active(True)
|
||||
self.get_widget("pub_btn1").set_active(True)
|
||||
self.get_widget("gramps_btn1").set_active(True)
|
||||
else:
|
||||
self.get_widget("title_btn2").set_active(True)
|
||||
self.get_widget("author_btn2").set_active(True)
|
||||
self.get_widget("abbrev_btn2").set_active(True)
|
||||
self.get_widget("pub_btn2").set_active(True)
|
||||
self.get_widget("gramps_btn2").set_active(True)
|
||||
|
||||
def cb_help(self, obj):
|
||||
"""Display the relevant portion of Gramps manual"""
|
||||
GrampsDisplay.help(webpage = WIKI_HELP_PAGE, section = WIKI_HELP_SEC)
|
||||
|
||||
def cb_merge(self, obj):
|
||||
"""
|
||||
Performs the merge of the sources when the merge button is clicked.
|
||||
"""
|
||||
self.uistate.set_busy_cursor(True)
|
||||
use_handle1 = self.get_widget("handle_btn1").get_active()
|
||||
if use_handle1:
|
||||
phoenix = self.src1
|
||||
titanic = self.src2
|
||||
unselect_path = (1,)
|
||||
else:
|
||||
phoenix = self.src2
|
||||
titanic = self.src1
|
||||
unselect_path = (0,)
|
||||
|
||||
if self.get_widget("title_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_title(titanic.get_title())
|
||||
if self.get_widget("author_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_author(titanic.get_author())
|
||||
if self.get_widget("abbrev_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_abbreviation(titanic.get_abbreviation())
|
||||
if self.get_widget("pub_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_publication_info(titanic.get_publication_info())
|
||||
if self.get_widget("gramps_btn1").get_active() ^ use_handle1:
|
||||
phoenix.set_gramps_id(titanic.get_gramps_id())
|
||||
|
||||
query = MergeSourceQuery(self.dbstate, phoenix, titanic)
|
||||
query.execute()
|
||||
self.uistate.viewmanager.active_page.selection.unselect_path(
|
||||
unselect_path)
|
||||
self.uistate.set_busy_cursor(False)
|
||||
self.close()
|
||||
|
||||
class MergeSourceQuery(object):
|
||||
"""
|
||||
Create database query to merge two sources.
|
||||
"""
|
||||
def __init__(self, dbstate, phoenix, titanic):
|
||||
self.database = dbstate.db
|
||||
self.phoenix = phoenix
|
||||
self.titanic = titanic
|
||||
|
||||
def execute(self):
|
||||
"""
|
||||
Merges to sources into a single source.
|
||||
"""
|
||||
new_handle = self.phoenix.get_handle()
|
||||
old_handle = self.titanic.get_handle()
|
||||
|
||||
self.phoenix.merge(self.titanic)
|
||||
|
||||
trans = self.database.transaction_begin()
|
||||
for person in self.database.iter_people():
|
||||
if person.has_source_reference(old_handle):
|
||||
person.replace_source_references(old_handle, new_handle)
|
||||
self.database.commit_person(person, trans)
|
||||
|
||||
for family in self.database.iter_families():
|
||||
if family.has_source_reference(old_handle):
|
||||
family.replace_source_references(old_handle, new_handle)
|
||||
self.database.commit_family(family, trans)
|
||||
|
||||
for event in self.database.iter_events():
|
||||
if event.has_source_reference(old_handle):
|
||||
event.replace_source_references(old_handle, new_handle)
|
||||
self.database.commit_event(event, trans)
|
||||
|
||||
for source in self.database.iter_sources():
|
||||
if source.has_source_reference(old_handle):
|
||||
source.replace_source_references(old_handle, new_handle)
|
||||
self.database.commit_source(source, trans)
|
||||
|
||||
for place in self.database.iter_places():
|
||||
if place.has_source_reference(old_handle):
|
||||
place.replace_source_references(old_handle, new_handle)
|
||||
self.database.commit_place(place, trans)
|
||||
|
||||
for obj in self.database.iter_media_objects():
|
||||
if obj.has_source_reference(old_handle):
|
||||
obj.replace_source_references(old_handle, new_handle)
|
||||
self.database.commit_media_object(obj, trans)
|
||||
|
||||
for repo in self.database.iter_repositories():
|
||||
if repo.has_source_reference(old_handle):
|
||||
repo.replace_source_references(old_handle, new_handle)
|
||||
self.database.commit_repository(repo, trans)
|
||||
|
||||
self.database.remove_source(old_handle, trans)
|
||||
self.database.commit_source(self.phoenix, trans)
|
||||
self.database.transaction_commit(trans, _("Merge Sources"))
|
@ -1322,7 +1322,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
cursor.close()
|
||||
if 'cursor' in locals():
|
||||
cursor.close()
|
||||
|
||||
def commit_base(self, obj, data_map, key, transaction, change_time):
|
||||
"""
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -35,6 +36,7 @@ from gen.lib.srcbase import SourceBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.datebase import DateBase
|
||||
from gen.lib.locationbase import LocationBase
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -124,3 +126,36 @@ class Address(SecondaryObject, PrivacyBase, SourceBase, NoteBase, DateBase,
|
||||
:rtype: list
|
||||
"""
|
||||
return self.get_referenced_note_handles()
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this address is equivalent, that is agrees in location and
|
||||
date, to other.
|
||||
|
||||
:param other: The address to compare this one to.
|
||||
:rtype other: Address
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.get_text_data_list() != other.get_text_data_list() or \
|
||||
self.get_date_object() != other.get_date_object():
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this address.
|
||||
|
||||
Lost: date, street, city, county, state, country, postal and phone of
|
||||
acquisition.
|
||||
|
||||
:param acquisition: The address to merge with the present address.
|
||||
:rtype acquisition: Address
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2006 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +31,7 @@ AddressBase class for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib.address import Address
|
||||
from gen.lib.const import IDENTICAL, EQUAL
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -111,3 +113,23 @@ class AddressBase(object):
|
||||
:type address_list: list
|
||||
"""
|
||||
self.address_list = address_list
|
||||
|
||||
def _merge_address_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of addresses from acquisition with our own.
|
||||
|
||||
:param acquisition: the address list of this object will be merged with
|
||||
the current address list.
|
||||
:rtype acquisition: AddressBase
|
||||
"""
|
||||
address_list = self.address_list[:]
|
||||
for addendum in acquisition.get_address_list():
|
||||
for address in address_list:
|
||||
equi = address.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
address.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.address_list.append(addendum)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2006 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +31,7 @@ AttributeBase class for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib.attribute import Attribute
|
||||
from gen.lib.const import IDENTICAL, EQUAL
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -117,3 +119,23 @@ class AttributeBase(object):
|
||||
:type attribute_list: list
|
||||
"""
|
||||
self.attribute_list = attribute_list
|
||||
|
||||
def _merge_attribute_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of attributes from acquisition with our own.
|
||||
|
||||
:param acquisition: the attribute list of this object will be merged
|
||||
with the current attribute list.
|
||||
:rtype acquisition: AttributeBase
|
||||
"""
|
||||
attr_list = self.attribute_list[:]
|
||||
for addendum in acquisition.get_attribute_list():
|
||||
for attr in attr_list:
|
||||
equi = attr.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
attr.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.attribute_list.append(addendum)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -34,6 +35,7 @@ from gen.lib.privacybase import PrivacyBase
|
||||
from gen.lib.srcbase import SourceBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.attrtype import AttributeType
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -139,6 +141,37 @@ class Attribute(SecondaryObject, PrivacyBase, SourceBase, NoteBase):
|
||||
"""
|
||||
return self.get_referenced_note_handles()
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this attribute is equivalent, that is agrees in type and
|
||||
value, to other.
|
||||
|
||||
:param other: The attribute to compare this one to.
|
||||
:rtype other: Attribute
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.type != other.type or self.value != other.value:
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this attribute.
|
||||
|
||||
Lost: type and value of acquisition.
|
||||
|
||||
:param acquisition: the attribute to merge with the present attribute.
|
||||
:rtype acquisition: Attribute
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
|
||||
def set_type(self, val):
|
||||
"""Set the type (or key) of the Attribute instance."""
|
||||
self.type.set(val)
|
||||
|
@ -171,3 +171,18 @@ class BaseObject(object):
|
||||
for obj in self.get_handle_referents():
|
||||
ret += obj.get_referenced_handles_recursively()
|
||||
return ret
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge content of this object with that of acquisition.
|
||||
|
||||
There are two sides to merger. First, the content of acquisition needs
|
||||
to be incorporated. Second, handles that reference acquisition (if
|
||||
there are any) need to be updated. Only the first part is handled in
|
||||
gen.lib, the second part needs access to the database and should be
|
||||
done in its own routines.
|
||||
|
||||
:param acquisition: The object to incorporate.
|
||||
:type acquisition: BaseObject
|
||||
"""
|
||||
pass
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2006-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -34,6 +35,7 @@ from gen.lib.srcbase import SourceBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.refbase import RefBase
|
||||
from gen.lib.childreftype import ChildRefType
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -138,6 +140,42 @@ class ChildRef(SecondaryObject, PrivacyBase, SourceBase, NoteBase, RefBase):
|
||||
"""
|
||||
return self.source_list
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this child reference is equivalent, that is agrees in hlink,
|
||||
to other.
|
||||
|
||||
:param other: The childref to compare this one to.
|
||||
:rtype other: ChildRef
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.ref != other.ref:
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this child reference.
|
||||
|
||||
Lost: hlink, mrel and frel of acquisition.
|
||||
|
||||
:param acquisition: The childref to merge with the present childref.
|
||||
:rtype acquisition: ChildRef
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
if (self.mrel != acquisition.mrel) or (self.frel != acquisition.frel):
|
||||
if self.mrel == ChildRefType.UNKNOWN:
|
||||
self.set_mother_relation(acquisition.mrel)
|
||||
if self.frel == ChildRefType.UNKNOWN:
|
||||
self.set_father_relation(acquisition.frel)
|
||||
|
||||
def set_mother_relation(self, rel):
|
||||
"""Set relation between the person and mother."""
|
||||
self.mrel.set(rel)
|
||||
|
29
src/gen/lib/const.py
Normal file
29
src/gen/lib/const.py
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
Constants
|
||||
"""
|
||||
|
||||
DIFFERENT = 0
|
||||
EQUAL = 1
|
||||
IDENTICAL = 2
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -278,7 +279,22 @@ class Event(SourceBase, NoteBase, MediaBase, AttributeBase,
|
||||
index += 1
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this event.
|
||||
|
||||
Lost: handle, id, marker, type, date, place, description of acquisition.
|
||||
|
||||
:param acquisition: The event to merge with the present event.
|
||||
:rtype acquisition: Event
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_attribute_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
self._merge_media_list(acquisition)
|
||||
|
||||
def set_type(self, the_type):
|
||||
"""
|
||||
Set the type of the Event to the passed (int,str) tuple.
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -35,6 +36,7 @@ from gen.lib.notebase import NoteBase
|
||||
from gen.lib.attrbase import AttributeBase
|
||||
from gen.lib.refbase import RefBase
|
||||
from gen.lib.eventroletype import EventRoleType
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -180,7 +182,7 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase):
|
||||
def replace_source_references(self, old_handle, new_handle):
|
||||
"""
|
||||
Replace references to source handles in the list in this object and
|
||||
all child objects.
|
||||
all child objects and merge equivalent entries.
|
||||
|
||||
:param old_handle: The source handle to be replaced.
|
||||
:type old_handle: str
|
||||
@ -190,6 +192,37 @@ class EventRef(SecondaryObject, PrivacyBase, NoteBase, AttributeBase, RefBase):
|
||||
for item in self.get_sourcref_child_list():
|
||||
item.replace_source_references(old_handle, new_handle)
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this eventref is equivalent, that is agrees in handle and
|
||||
role, to other.
|
||||
|
||||
:param other: The eventref to compare this one to.
|
||||
:rtype other: EventRef
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.ref != other.ref or self.role != other.role:
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this eventref.
|
||||
|
||||
Lost: hlink and role of acquisition.
|
||||
|
||||
:param acquisition: The eventref to merge with the present eventref.
|
||||
:param acquisition: EventRef
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_attribute_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
|
||||
def get_role(self):
|
||||
"""
|
||||
Return the tuple corresponding to the preset role.
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -46,6 +47,7 @@ from gen.lib.ldsordbase import LdsOrdBase
|
||||
from gen.lib.childref import ChildRef
|
||||
from gen.lib.familyreltype import FamilyRelType
|
||||
from gen.lib.markertype import MarkerType
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -205,17 +207,41 @@ class Family(SourceBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
|
||||
:type new_handle: str
|
||||
"""
|
||||
if classname == 'Event':
|
||||
handle_list = [ref.ref for ref in self.event_ref_list]
|
||||
while old_handle in handle_list:
|
||||
ix = handle_list.index(old_handle)
|
||||
self.event_ref_list[ix].ref = new_handle
|
||||
handle_list[ix] = ''
|
||||
refs_list = [ ref.ref for ref in self.event_ref_list ]
|
||||
new_ref = None
|
||||
if new_handle in refs_list:
|
||||
new_ref = self.event_ref_list[refs_list.index(new_handle)]
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
idx = refs_list.index(old_handle)
|
||||
self.event_ref_list[idx].ref = new_handle
|
||||
refs_list[idx] = new_handle
|
||||
if new_ref:
|
||||
evt_ref = self.event_ref_list[idx]
|
||||
equi = new_ref.is_equivalent(evt_ref)
|
||||
if equi != DIFFERENT:
|
||||
if equi == EQUAL:
|
||||
new_ref.merge(evt_ref)
|
||||
self.event_ref_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
elif classname == 'Person':
|
||||
handle_list = [ref.ref for ref in self.child_ref_list]
|
||||
while old_handle in handle_list:
|
||||
ix = handle_list.index(old_handle)
|
||||
self.child_ref_list[ix].ref = new_handle
|
||||
handle_list[ix] = ''
|
||||
refs_list = [ ref.ref for ref in self.child_ref_list ]
|
||||
new_ref = None
|
||||
if new_handle in refs_list:
|
||||
new_ref = self.child_ref_list[refs_list.index(new_handle)]
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
idx = refs_list.index(old_handle)
|
||||
self.child_ref_list[idx].ref = new_handle
|
||||
refs_list[idx] = new_handle
|
||||
if new_ref:
|
||||
child_ref = self.child_ref_list[idx]
|
||||
equi = new_ref.is_equivalent(child_ref)
|
||||
if equi != DIFFERENT:
|
||||
if equi == EQUAL:
|
||||
new_ref.merge(child_ref)
|
||||
self.child_ref_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
if self.father_handle == old_handle:
|
||||
self.father_handle = new_handle
|
||||
if self.mother_handle == old_handle:
|
||||
@ -296,6 +322,26 @@ class Family(SourceBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
|
||||
"""
|
||||
return self.get_sourcref_child_list() + self.source_list
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this family.
|
||||
|
||||
Lost: handle, id, marker, relation, father, mother of acquisition.
|
||||
|
||||
:param acquisition: The family to merge with the present family.
|
||||
:rtype acquisition: Family
|
||||
"""
|
||||
if self.type != acquisition.type and self.type == FamilyRelType.UNKNOWN:
|
||||
self.set_relationship(acquisition.get_relationship())
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_event_ref_list(acquisition)
|
||||
self._merge_lds_ord_list(acquisition)
|
||||
self._merge_media_list(acquisition)
|
||||
self._merge_child_ref_list(acquisition)
|
||||
self._merge_attribute_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
|
||||
def set_relationship(self, relationship_type):
|
||||
"""
|
||||
Set the relationship type between the people identified as the
|
||||
@ -441,6 +487,26 @@ class Family(SourceBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
|
||||
"""
|
||||
self.child_ref_list = child_ref_list
|
||||
|
||||
def _merge_child_ref_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of child references from acquisition with our own.
|
||||
|
||||
:param acquisition: the childref list of this family will be merged
|
||||
with the current childref list.
|
||||
:rtype acquisition: Family
|
||||
"""
|
||||
childref_list = self.child_ref_list[:]
|
||||
for addendum in acquisition.get_child_ref_list():
|
||||
for childref in childref_list:
|
||||
equi = childref.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
childref.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.child_ref_list.append(addendum)
|
||||
|
||||
def add_event_ref(self, event_ref):
|
||||
"""
|
||||
Add the :class:`~gen.lib.eventref.EventRef` to the Family instance's :class:`~gen.lib.eventref.EventRef` list.
|
||||
@ -485,3 +551,24 @@ class Family(SourceBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase,
|
||||
:type event_ref_list: list
|
||||
"""
|
||||
self.event_ref_list = event_ref_list
|
||||
|
||||
def _merge_event_ref_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of event references from acquisition with our own.
|
||||
|
||||
:param acquisition: the event references list of this object will be
|
||||
merged with the current event references list.
|
||||
:rtype acquisition: Person
|
||||
"""
|
||||
eventref_list = self.event_ref_list[:]
|
||||
for addendum in acquisition.get_event_ref_list():
|
||||
for eventref in eventref_list:
|
||||
equi = eventref.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
eventref.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.event_ref_list.append(addendum)
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -43,6 +44,7 @@ from gen.lib.notebase import NoteBase
|
||||
from gen.lib.datebase import DateBase
|
||||
from gen.lib.placebase import PlaceBase
|
||||
from gen.lib.privacybase import PrivacyBase
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -204,6 +206,41 @@ class LdsOrd(SecondaryObject, SourceBase, NoteBase,
|
||||
"""
|
||||
return self.source_list
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this ldsord is equivalent, that is agrees in date, temple,
|
||||
place, status, sealed_to, to other.
|
||||
|
||||
:param other: The ldsord to compare this one to.
|
||||
:rtype other: LdsOrd
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.type != other.type or \
|
||||
self.get_date_object() != other.get_date_object() or \
|
||||
self.temple != other.temple or \
|
||||
self.status != other.status or \
|
||||
self.famc != other.famc:
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this ldsord.
|
||||
|
||||
Lost: type, date, temple, place, status, sealed_to of acquistion.
|
||||
|
||||
:param acquisition: The ldsord to merge with the present ldsord.
|
||||
:rtype acquisition: LdsOrd
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
|
||||
def get_type(self):
|
||||
"""
|
||||
Return the type of the Event.
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2006 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +31,7 @@ LdsOrdBase class for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib.ldsord import LdsOrd
|
||||
from gen.lib.const import IDENTICAL, EQUAL
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -115,3 +117,23 @@ class LdsOrdBase(object):
|
||||
:type lds_ord_list: list
|
||||
"""
|
||||
self.lds_ord_list = lds_ord_list
|
||||
|
||||
def _merge_lds_ord_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of ldsord from acquisition with our own.
|
||||
|
||||
:param acquisition: the ldsord list of this object will be merged with
|
||||
the current ldsord list.
|
||||
:rtype acquisition: LdsOrdBase
|
||||
"""
|
||||
ldsord_list = self.lds_ord_list[:]
|
||||
for addendum in acquisition.get_lds_ord_list():
|
||||
for ldsord in ldsord_list:
|
||||
equi = ldsord.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
ldsord.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.lds_ord_list.append(addendum)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2006 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -31,6 +32,7 @@ Location class for GRAMPS.
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib.secondaryobj import SecondaryObject
|
||||
from gen.lib.locationbase import LocationBase
|
||||
from gen.lib.const import IDENTICAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -79,6 +81,31 @@ class Location(SecondaryObject, LocationBase):
|
||||
"""
|
||||
return [self.parish] + LocationBase.get_text_data_list(self)
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this location is equivalent to other.
|
||||
|
||||
:param other: The location to compare this one to.
|
||||
:rtype other: Location
|
||||
:returns: Constant inidicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return DIFFERENT
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this location.
|
||||
|
||||
Lost: everything of acquisition.
|
||||
|
||||
:param acquisition: The location to merge with the present location.
|
||||
:rtype acquisition: Location
|
||||
"""
|
||||
pass
|
||||
|
||||
def is_empty(self):
|
||||
return not self.city and not self.county and not self.state and \
|
||||
not self.country and not self.postal and not self.phone
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2006 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +31,7 @@ MediaBase class for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib.mediaref import MediaRef
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -92,6 +94,26 @@ class MediaBase(object):
|
||||
"""
|
||||
self.media_list = media_ref_list
|
||||
|
||||
def _merge_media_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of media references from acquisition with our own.
|
||||
|
||||
:param acquisition: the media list of this object will be merged with
|
||||
the current media reference list.
|
||||
:rtype acquisition: MediaBase
|
||||
"""
|
||||
media_list = self.media_list[:]
|
||||
for addendum in acquisition.get_media_list():
|
||||
for obj in media_list:
|
||||
equi = obj.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
obj.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.media_list.append(addendum)
|
||||
|
||||
def has_media_reference(self, obj_handle) :
|
||||
"""
|
||||
Return True if the object or any of it's child objects has reference
|
||||
@ -118,7 +140,8 @@ class MediaBase(object):
|
||||
|
||||
def replace_media_references(self, old_handle, new_handle):
|
||||
"""
|
||||
Replace all references to old media handle with the new handle.
|
||||
Replace all references to old media handle with the new handle and
|
||||
merge equivalent entries.
|
||||
|
||||
:param old_handle: The media handle to be replaced.
|
||||
:type old_handle: str
|
||||
@ -126,8 +149,19 @@ class MediaBase(object):
|
||||
:type new_handle: str
|
||||
"""
|
||||
refs_list = [ media_ref.ref for media_ref in self.media_list ]
|
||||
new_ref = None
|
||||
if new_handle in refs_list:
|
||||
new_ref = self.media_list[refs_list.index(new_handle)]
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
ix = refs_list.index(old_handle)
|
||||
self.media_list[ix].ref = new_handle
|
||||
refs_list[ix] = new_handle
|
||||
idx = refs_list.index(old_handle)
|
||||
self.media_list[idx].ref = new_handle
|
||||
refs_list[idx] = new_handle
|
||||
if new_ref:
|
||||
media_ref = self.media_list[idx]
|
||||
equi = new_ref.is_equivalent(media_ref)
|
||||
if equi != DIFFERENT:
|
||||
if equi == EQUAL:
|
||||
new_ref.merge(media_ref)
|
||||
self.media_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -186,6 +187,20 @@ class MediaObject(SourceBase, NoteBase, DateBase, AttributeBase,
|
||||
"""
|
||||
return self.attribute_list + self.source_list
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this media object.
|
||||
|
||||
Lost: handle, id, marker, file, date of acquisition.
|
||||
|
||||
:param acquisition: The media object to merge with the present object.
|
||||
:rtype acquisition: MediaObject
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_attribute_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
|
||||
def set_mime_type(self, mime_type):
|
||||
"""
|
||||
Set the MIME type associated with the MediaObject.
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -35,6 +36,7 @@ from gen.lib.srcbase import SourceBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.refbase import RefBase
|
||||
from gen.lib.attrbase import AttributeBase
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -131,6 +133,38 @@ class MediaRef(SecondaryObject, PrivacyBase, SourceBase, NoteBase, RefBase,
|
||||
"""
|
||||
return self.attribute_list + self.source_list
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this object reference is equivalent, that is agrees in
|
||||
reference and region, to other.
|
||||
|
||||
:param other: The object reference to compare this one to.
|
||||
:rtype other: MediaRef
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.ref != other.ref or self.rect != other.rect:
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this object reference.
|
||||
|
||||
Lost: hlink and region or acquisition.
|
||||
|
||||
:param acquisition: The object reference to merge with the present one.
|
||||
:rtype acquisition: MediaRef
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_attribute_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
|
||||
def set_rectangle(self, coord):
|
||||
"""Set subsection of an image."""
|
||||
self.rect = coord
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -35,6 +36,7 @@ from gen.lib.srcbase import SourceBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.datebase import DateBase
|
||||
from gen.lib.nametype import NameType
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -185,6 +187,41 @@ class Name(SecondaryObject, PrivacyBase, SourceBase, NoteBase, DateBase):
|
||||
"""
|
||||
return self.get_referenced_note_handles()
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this name is equivalent, that is agrees in type, first
|
||||
call, last, suffix, patronymic, title and date, to other.
|
||||
|
||||
:param other: The name to compare this name to.
|
||||
:rtype other: Name
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
# TODO what to do with sort and display?
|
||||
if self.get_text_data_list() != other.get_text_data_list() or \
|
||||
self.get_date_object() != other.get_date_object():
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this name.
|
||||
|
||||
Lost: type, first, call, last, suffix, patronymic, title and date of
|
||||
acquisition.
|
||||
|
||||
:param acquisition: The name to merge with the present name.
|
||||
:rtype acquisition: Name
|
||||
"""
|
||||
# TODO what to do with sort and display?
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
|
||||
def set_group_as(self, name):
|
||||
"""
|
||||
Set the grouping name for a person.
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -120,6 +121,17 @@ class Note(BasicPrimaryObject):
|
||||
"""
|
||||
return [str(self.text)]
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this note.
|
||||
|
||||
Lost: handle, id, marker, type, format, text and tags of acquisition.
|
||||
|
||||
:param acquisition: The note to merge with the present note.
|
||||
:rtype acquisition: Note
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
|
||||
def set(self, text):
|
||||
"""Set the text associated with the note to the passed string.
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -110,6 +111,27 @@ class NoteBase(object):
|
||||
"""
|
||||
return self.note_list
|
||||
|
||||
def has_note_reference(self, note_handle):
|
||||
"""
|
||||
Return True if the object or any of its child objects has reference
|
||||
to this note handle.
|
||||
|
||||
:param note_handle: The note handle to be checked.
|
||||
:type note_handle: str
|
||||
:returns: Returns whether the object or any of its child objects has
|
||||
reference to this note handle.
|
||||
:rtype: bool
|
||||
"""
|
||||
for note_ref in self.note_list:
|
||||
if note_ref == note_handle:
|
||||
return True
|
||||
|
||||
for item in self.get_note_child_list():
|
||||
if item.has_note_reference(note_handle):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def set_note_list(self, note_list):
|
||||
"""
|
||||
Assign the passed list to be object's list of :class:`~gen.lib.note.Note` handles.
|
||||
@ -119,6 +141,17 @@ class NoteBase(object):
|
||||
"""
|
||||
self.note_list = note_list
|
||||
|
||||
def _merge_note_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of notes from acquisition with our own.
|
||||
|
||||
:param acquisition: The note list of this object will be merged with
|
||||
the current note list.
|
||||
:rtype acquisition: NoteBase
|
||||
"""
|
||||
for addendum in acquisition.note_list:
|
||||
self.add_note(addendum)
|
||||
|
||||
def get_referenced_note_handles(self):
|
||||
"""
|
||||
Return the list of (classname, handle) tuples for all referenced notes.
|
||||
@ -130,3 +163,29 @@ class NoteBase(object):
|
||||
:rtype: list
|
||||
"""
|
||||
return [('Note', handle) for handle in self.note_list]
|
||||
|
||||
def replace_note_references(self, old_handle, new_handle):
|
||||
"""
|
||||
Replace references to note handles in the list of this object and
|
||||
all child objects and merge equivalent entries.
|
||||
|
||||
:param old_handle: The note handle to be replaced.
|
||||
:type old_handle: str
|
||||
:param new_handle: The note handle to replace the old one with.
|
||||
:type new_handle: str
|
||||
"""
|
||||
refs_list = self.note_list[:]
|
||||
new_ref = None
|
||||
if new_handle in self.note_list:
|
||||
new_ref = new_handle
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
idx = refs_list.index(old_handle)
|
||||
if new_ref:
|
||||
self.note_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
else:
|
||||
self.note_list[idx] = new_handle
|
||||
|
||||
for item in self.get_note_child_list():
|
||||
item.replace_note_references(old_handle, new_handle)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -43,6 +44,8 @@ from gen.lib.personref import PersonRef
|
||||
from gen.lib.attrtype import AttributeType
|
||||
from gen.lib.eventroletype import EventRoleType
|
||||
from gen.lib.markertype import MarkerType
|
||||
from gen.lib.attribute import Attribute
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -107,6 +110,9 @@ class Person(SourceBase, NoteBase, AttributeBase, MediaBase,
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, Person) and self.handle == other.handle
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
def serialize(self):
|
||||
"""
|
||||
@ -269,17 +275,53 @@ class Person(SourceBase, NoteBase, AttributeBase, MediaBase,
|
||||
|
||||
def _replace_handle_reference(self, classname, old_handle, new_handle):
|
||||
if classname == 'Event':
|
||||
handle_list = [ref.ref for ref in self.event_ref_list]
|
||||
while old_handle in handle_list:
|
||||
ix = handle_list.index(old_handle)
|
||||
self.event_ref_list[ix].ref = new_handle
|
||||
handle_list[ix] = ''
|
||||
refs_list = [ ref.ref for ref in self.event_ref_list ]
|
||||
new_ref = None
|
||||
if new_handle in refs_list:
|
||||
new_ref = self.event_ref_list[refs_list.index(new_handle)]
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
idx = refs_list.index(old_handle)
|
||||
self.event_ref_list[idx].ref = new_handle
|
||||
refs_list[idx] = new_handle
|
||||
if new_ref:
|
||||
evt_ref = self.event_ref_list[idx]
|
||||
equi = new_ref.is_equivalent(evt_ref)
|
||||
if equi != DIFFERENT:
|
||||
if equi == EQUAL:
|
||||
new_ref.merge(evt_ref)
|
||||
self.event_ref_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
if idx < self.birth_ref_index:
|
||||
self.birth_ref_index -= 1
|
||||
elif idx == self.birth_ref_index:
|
||||
self.birth_ref_index = -1
|
||||
# birth_ref_index should be recalculated which
|
||||
# needs database access!
|
||||
if idx < self.death_ref_index:
|
||||
self.death_ref_index -= 1
|
||||
elif idx == self.death_ref_index:
|
||||
self.death_ref_index = -1
|
||||
# death_ref_index should be recalculated which
|
||||
# needs database access!
|
||||
elif classname == 'Person':
|
||||
handle_list = [ref.ref for ref in self.person_ref_list]
|
||||
while old_handle in handle_list:
|
||||
ix = handle_list.index(old_handle)
|
||||
self.person_ref_list[ix].ref = new_handle
|
||||
handle_list[ix] = ''
|
||||
refs_list = [ ref.ref for ref in self.person_ref_list ]
|
||||
new_ref = None
|
||||
if new_handle in refs_list:
|
||||
new_ref = self.person_ref_list[refs_list.index(new_handle)]
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
idx = refs_list.index(old_handle)
|
||||
self.person_ref_list[idx].ref = new_handle
|
||||
refs_list[idx] = new_handle
|
||||
if new_ref:
|
||||
person_ref = self.person_ref_list[idx]
|
||||
equi = new_ref.is_equivalent(person_ref)
|
||||
if equi != DIFFERENT:
|
||||
if equi == EQUAL:
|
||||
new_ref.merge(person_ref)
|
||||
self.person_ref_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
elif classname == 'Family':
|
||||
while old_handle in self.family_list:
|
||||
ix = self.family_list.index(old_handle)
|
||||
@ -369,6 +411,37 @@ class Person(SourceBase, NoteBase, AttributeBase, MediaBase,
|
||||
#don't count double, notes can be found in sourcref
|
||||
return self.get_sourcref_child_list() + self.source_list
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this person.
|
||||
|
||||
:param acquisition: The person to merge with the present person.
|
||||
:rtype acquisition: Person
|
||||
"""
|
||||
acquisition_id = acquisition.get_gramps_id()
|
||||
if acquisition_id:
|
||||
attr = Attribute()
|
||||
attr.set_type("Merged Gramps ID")
|
||||
attr.set_value(acquisition.get_gramps_id())
|
||||
self.add_attribute(attr)
|
||||
|
||||
self._merge_privacy(acquisition)
|
||||
acquisition.alternate_names.insert(0, acquisition.get_primary_name())
|
||||
self._merge_alternate_names(acquisition)
|
||||
self._merge_event_ref_list(acquisition)
|
||||
self._merge_lds_ord_list(acquisition)
|
||||
self._merge_media_list(acquisition)
|
||||
self._merge_address_list(acquisition)
|
||||
self._merge_attribute_list(acquisition)
|
||||
self._merge_url_list(acquisition)
|
||||
self._merge_person_ref_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
|
||||
map(self.add_parent_family_handle,
|
||||
acquisition.get_parent_family_handle_list())
|
||||
map(self.add_family_handle, acquisition.get_family_handle_list())
|
||||
|
||||
def set_primary_name(self, name):
|
||||
"""
|
||||
Set the primary name of the Person to the specified :class:`~gen.lib.name.Name` instance.
|
||||
@ -405,6 +478,29 @@ class Person(SourceBase, NoteBase, AttributeBase, MediaBase,
|
||||
"""
|
||||
self.alternate_names = alt_name_list
|
||||
|
||||
def _merge_alternate_names(self, acquisition):
|
||||
"""
|
||||
Merge the list of alternate names from acquisition with our own.
|
||||
|
||||
:param acquisition: the list of alternate names of this object will be
|
||||
merged with the current alternate name list.
|
||||
:rtype acquisition: Person
|
||||
"""
|
||||
name_list = self.alternate_names[:]
|
||||
primary_name = self.get_primary_name()
|
||||
if primary_name and not primary_name.is_empty():
|
||||
name_list.insert(0, primary_name)
|
||||
for addendum in acquisition.get_alternate_names():
|
||||
for name in name_list:
|
||||
equi = name.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
name.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.alternate_names.append(addendum)
|
||||
|
||||
def add_alternate_name(self, name):
|
||||
"""
|
||||
Add a :class:`~gen.lib.name.Name` instance to the list of alternative names.
|
||||
@ -579,6 +675,32 @@ class Person(SourceBase, NoteBase, AttributeBase, MediaBase,
|
||||
"""
|
||||
self.event_ref_list = event_ref_list
|
||||
|
||||
def _merge_event_ref_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of event references from acquisition with our own.
|
||||
|
||||
:param acquisition: the event references list of this object will be
|
||||
merged with the current event references list.
|
||||
:rtype acquisition: Person
|
||||
"""
|
||||
eventref_list = self.event_ref_list[:]
|
||||
for idx, addendum in enumerate(acquisition.get_event_ref_list()):
|
||||
for eventref in eventref_list:
|
||||
equi = eventref.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
eventref.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.event_ref_list.append(addendum)
|
||||
if self.birth_ref_index == -1 and \
|
||||
idx == acquisition.birth_ref_index:
|
||||
self.birth_ref_index = len(self.event_ref_list) - 1
|
||||
if self.death_ref_index == -1 and \
|
||||
idx == acquisition.death_ref_index:
|
||||
self.death_ref_index = len(self.event_ref_list) - 1
|
||||
|
||||
def add_family_handle(self, family_handle):
|
||||
"""
|
||||
Add the :class:`~gen.lib.family.Family` handle to the Person instance's :class:`~gen.lib.family.Family` list.
|
||||
@ -807,3 +929,23 @@ class Person(SourceBase, NoteBase, AttributeBase, MediaBase,
|
||||
:type person_ref_list: list
|
||||
"""
|
||||
self.person_ref_list = person_ref_list
|
||||
|
||||
def _merge_person_ref_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of person references from acquisition with our own.
|
||||
|
||||
:param acquisition: the list of person references of this person will b
|
||||
merged with the current person references list.
|
||||
:rtype acquisition: Person
|
||||
"""
|
||||
personref_list = self.person_ref_list[:]
|
||||
for addendum in acquisition.get_person_ref_list():
|
||||
for personref in personref_list:
|
||||
equi = personref.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
personref.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.person_ref_list.append(addendum)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2006-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -34,6 +35,7 @@ from gen.lib.privacybase import PrivacyBase
|
||||
from gen.lib.srcbase import SourceBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.refbase import RefBase
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -131,6 +133,38 @@ class PersonRef(SecondaryObject, PrivacyBase, SourceBase, NoteBase, RefBase):
|
||||
"""
|
||||
return self.source_list
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this person reference is equivalent, that is agrees in handle
|
||||
and relation, to other.
|
||||
|
||||
:param other: The personref to compare this one to.
|
||||
:rtype other: PersonRef
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.ref != other.ref or \
|
||||
self.get_text_data_list() != other.get_text_data_list():
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this person reference.
|
||||
|
||||
Lost: hlink and relation of acquisition.
|
||||
|
||||
:param acquisition: The personref to merge with the present personref.
|
||||
:param acquisition: PersonRef
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
|
||||
def set_relation(self, rel):
|
||||
"""Set relation to a person."""
|
||||
self.rel = rel
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -194,6 +195,19 @@ class Place(SourceBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
|
||||
"""
|
||||
return self.get_referenced_note_handles()
|
||||
|
||||
def merge(self, acquisition):
|
||||
""" Merge the content of acquisition into this place.
|
||||
|
||||
:param acquisition: The place to merge with the present place.
|
||||
:rtype acquisition: Place
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_locations(acquisition)
|
||||
self._merge_media_list(acquisition)
|
||||
self._merge_url_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_source_reference_list(acquisition)
|
||||
|
||||
def set_title(self, title):
|
||||
"""
|
||||
Set the descriptive title of the Place object.
|
||||
@ -307,6 +321,28 @@ class Place(SourceBase, NoteBase, MediaBase, UrlBase, PrimaryObject):
|
||||
if location not in self.alt_loc:
|
||||
self.alt_loc.append(location)
|
||||
|
||||
def _merge_locations(self, acquisition):
|
||||
"""
|
||||
Add the main and alternate locations of acquisition to the alternate
|
||||
location list.
|
||||
|
||||
:param acquisition: instance to merge
|
||||
:type acquisition: :class:'~gen.lib.place.Place
|
||||
"""
|
||||
altloc_list = self.alt_loc[:]
|
||||
if self.main_loc and not self.main_loc.is_empty():
|
||||
altloc_list.insert(0, self.main_loc)
|
||||
add_list = acquisition.get_alternate_locations()
|
||||
acq_main_loc = acquisition.get_main_location()
|
||||
if acq_main_loc and not acq_main_loc.is_empty():
|
||||
add_list.insert(0, acquisition.get_main_location())
|
||||
for addendum in add_list:
|
||||
for altloc in altloc_list:
|
||||
if altloc.is_equal(addendum):
|
||||
break
|
||||
else:
|
||||
self.alt_loc.append(addendum)
|
||||
|
||||
def get_display_info(self):
|
||||
"""
|
||||
Get the display information associated with the object.
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2005 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -81,3 +82,12 @@ class PrivacyBase(object):
|
||||
:rtype: bool
|
||||
"""
|
||||
return self.private
|
||||
|
||||
def _merge_privacy(self, other):
|
||||
"""
|
||||
Merge the privacy level of this object with that of other.
|
||||
|
||||
:returns: Privacy of merged objects.
|
||||
:rtype: bool
|
||||
"""
|
||||
self.private = self.private or other.private
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -171,7 +172,7 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
|
||||
def replace_source_references(self, old_handle, new_handle):
|
||||
"""
|
||||
Replace references to source handles in the list in this object and
|
||||
all child objects.
|
||||
all child objects and merge equivalent entries.
|
||||
|
||||
:param old_handle: The source handle to be replaced.
|
||||
:type old_handle: str
|
||||
@ -181,6 +182,18 @@ class Repository(NoteBase, AddressBase, UrlBase, PrimaryObject):
|
||||
for item in self.get_sourcref_child_list():
|
||||
item.replace_source_references(old_handle, new_handle)
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this repository.
|
||||
|
||||
:param acquisition: The repository to merge with the present repository.
|
||||
:rtype acquisition: Repository
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_address_list(acquisition)
|
||||
self._merge_url_list(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
|
||||
def set_type(self, the_type):
|
||||
"""
|
||||
:param the_type: descriptive type of the Repository
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -34,6 +35,7 @@ from gen.lib.privacybase import PrivacyBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.refbase import RefBase
|
||||
from gen.lib.srcmediatype import SourceMediaType
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -101,6 +103,36 @@ class RepoRef(SecondaryObject, PrivacyBase, NoteBase, RefBase):
|
||||
ret += [('Repository', self.ref)]
|
||||
return ret
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this repository reference is equivalent, that is agrees in
|
||||
reference, call number and medium, to other.
|
||||
|
||||
:param other: The repository reference to compare this one to.
|
||||
:rtype other: RepoRef
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.ref != other.ref or \
|
||||
self.get_text_data_list() != other.get_text_data_list():
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this repository reference.
|
||||
|
||||
:param acquisition: The repository reference to merge with the present
|
||||
repository reference.
|
||||
:rtype acquisition: RepoRef
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
|
||||
def set_call_number(self, number):
|
||||
self.call_number = number
|
||||
|
||||
|
@ -44,3 +44,11 @@ class SecondaryObject(BaseObject):
|
||||
|
||||
def is_equal(self, source):
|
||||
return cmp(self.serialize(), source.serialize()) == 0
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this object is equivalent to other.
|
||||
|
||||
Should be overwritten by objects that inherit from this class.
|
||||
"""
|
||||
pass
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -34,6 +35,7 @@ from gen.lib.mediabase import MediaBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.reporef import RepoRef
|
||||
from gen.lib.markertype import MarkerType
|
||||
from gen.lib.const import DIFFERENT, EQUAL, IDENTICAL
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -129,9 +131,9 @@ class Source(MediaBase, NoteBase, PrimaryObject):
|
||||
if classname == 'Repository':
|
||||
handle_list = [ref.ref for ref in self.reporef_list]
|
||||
while old_handle in handle_list:
|
||||
ix = handle_list.index(old_handle)
|
||||
self.reporef_list[ix].ref = new_handle
|
||||
handle_list[ix] = ''
|
||||
idx = handle_list.index(old_handle)
|
||||
self.reporef_list[idx].ref = new_handle
|
||||
handle_list[idx] = ''
|
||||
|
||||
def get_text_data_list(self):
|
||||
"""
|
||||
@ -222,8 +224,8 @@ class Source(MediaBase, NoteBase, PrimaryObject):
|
||||
|
||||
def replace_source_references(self, old_handle, new_handle):
|
||||
"""
|
||||
Replace references to source handles in the list in this object and
|
||||
all child objects.
|
||||
Replace references to source_handles in the list in this object and
|
||||
all child objects and merge equivalent entries.
|
||||
|
||||
:param old_handle: The source handle to be replaced.
|
||||
:type old_handle: str
|
||||
@ -233,6 +235,23 @@ class Source(MediaBase, NoteBase, PrimaryObject):
|
||||
for item in self.get_sourcref_child_list():
|
||||
item.replace_source_references(old_handle, new_handle)
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this source.
|
||||
|
||||
:param acquisition: The source to merge with the present source.
|
||||
:rtype acquisition: Source
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
self._merge_media_list(acquisition)
|
||||
my_datamap = self.get_data_map()
|
||||
acquisition_map = acquisition.get_data_map()
|
||||
for key in acquisition.get_data_map():
|
||||
if key not in my_datamap:
|
||||
self.datamap[key] = acquisition_map[key]
|
||||
self._merge_reporef_list(acquisition)
|
||||
|
||||
def get_data_map(self):
|
||||
"""Return the data map of attributes for the source."""
|
||||
return self.datamap
|
||||
@ -317,6 +336,26 @@ class Source(MediaBase, NoteBase, PrimaryObject):
|
||||
"""
|
||||
self.reporef_list = reporef_list
|
||||
|
||||
def _merge_reporef_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of repository references from acquisition with our own.
|
||||
|
||||
:param acquisition: the repository references list of this object will
|
||||
be merged with the current repository references list.
|
||||
:rtype acquisition: RepoRef
|
||||
"""
|
||||
reporef_list = self.reporef_list[:]
|
||||
for addendum in acquisition.get_reporef_list():
|
||||
for reporef in reporef_list:
|
||||
equi = reporef.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
reporef.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.reporef_list.append(addendum)
|
||||
|
||||
def has_repo_reference(self, repo_handle):
|
||||
"""
|
||||
Return True if the Source has reference to this Repository handle.
|
||||
@ -342,17 +381,29 @@ class Source(MediaBase, NoteBase, PrimaryObject):
|
||||
|
||||
def replace_repo_references(self, old_handle, new_handle):
|
||||
"""
|
||||
Replace all references to old Repository handle with the new handle.
|
||||
Replace all references to old Repository handle with the new handle
|
||||
and merge equivalent entries.
|
||||
|
||||
:param old_handle: The Repository handle to be replaced.
|
||||
:type old_handle: str
|
||||
:param new_handle: The Repository handle to replace the old one with.
|
||||
:type new_handle: str
|
||||
indikken
|
||||
"""
|
||||
refs_list = [ repo_ref.ref for repo_ref in self.reporef_list ]
|
||||
new_ref = None
|
||||
if new_handle in refs_list:
|
||||
new_ref = self.reporef_list[refs_list.index(new_handle)]
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
ix = refs_list.index(old_handle)
|
||||
self.reporef_list[ix].ref = new_handle
|
||||
refs_list.pop(ix)
|
||||
|
||||
idx = refs_list.index(old_handle)
|
||||
self.reporef_list[idx].ref = new_handle
|
||||
refs_list[idx] = new_handle
|
||||
if new_ref:
|
||||
repo_ref = self.reporef_list[idx]
|
||||
equi = new_ref.is_equivalent(repo_ref)
|
||||
if equi != DIFFERENT:
|
||||
if equi == EQUAL:
|
||||
new_ref.merge(repo_ref)
|
||||
self.reporef_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2006 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +31,7 @@ SourceBase class for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib.srcref import SourceRef
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -132,8 +134,8 @@ class SourceBase(object):
|
||||
|
||||
def replace_source_references(self, old_handle, new_handle):
|
||||
"""
|
||||
Replace references to source handles in the list in this object and
|
||||
all child objects.
|
||||
Replace references to source handles in the list in this object and
|
||||
all child objects and merge equivalent entries.
|
||||
|
||||
:param old_handle: The source handle to be replaced.
|
||||
:type old_handle: str
|
||||
@ -141,12 +143,23 @@ class SourceBase(object):
|
||||
:type new_handle: str
|
||||
"""
|
||||
refs_list = [ src_ref.ref for src_ref in self.source_list ]
|
||||
new_ref = None
|
||||
if new_handle in refs_list:
|
||||
new_ref = self.source_list[refs_list.index(new_handle)]
|
||||
n_replace = refs_list.count(old_handle)
|
||||
for ix_replace in xrange(n_replace):
|
||||
ix = refs_list.index(old_handle)
|
||||
self.source_list[ix].ref = new_handle
|
||||
refs_list[ix] = new_handle
|
||||
|
||||
idx = refs_list.index(old_handle)
|
||||
self.source_list[idx].ref = new_handle
|
||||
refs_list[idx] = new_handle
|
||||
if new_ref:
|
||||
src_ref = self.source_list[idx]
|
||||
equi = new_ref.is_equivalent(src_ref)
|
||||
if equi != DIFFERENT:
|
||||
if equi == EQUAL:
|
||||
new_ref.merge(src_ref)
|
||||
self.source_list.pop(idx)
|
||||
refs_list.pop(idx)
|
||||
|
||||
for item in self.get_sourcref_child_list():
|
||||
item.replace_source_references(old_handle, new_handle)
|
||||
|
||||
@ -159,3 +172,23 @@ class SourceBase(object):
|
||||
:type src_ref_list: list of :class:`~gen.lib.srcref.SourceRef` instances
|
||||
"""
|
||||
self.source_list = src_ref_list
|
||||
|
||||
def _merge_source_reference_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of source references from acquisition with our own.
|
||||
|
||||
:param acquisition: the source references list of this object will be
|
||||
merged with the current source references list.
|
||||
:rtype acquisition: SourceRef
|
||||
"""
|
||||
srcref_list = self.source_list[:]
|
||||
for addendum in acquisition.get_source_references():
|
||||
for srcref in srcref_list:
|
||||
equi = srcref.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
srcref.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.source_list.append(addendum)
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
# Copyright (C) 2010 Michiel D. Nauta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -41,6 +42,7 @@ from gen.lib.datebase import DateBase
|
||||
from gen.lib.privacybase import PrivacyBase
|
||||
from gen.lib.notebase import NoteBase
|
||||
from gen.lib.refbase import RefBase
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -117,6 +119,41 @@ class SourceRef(SecondaryObject, DateBase, PrivacyBase, NoteBase, RefBase):
|
||||
ret += [('Source', self.ref)]
|
||||
return ret
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this source reference is equivalent, that is agreees in
|
||||
reference, source page and date, to other.
|
||||
|
||||
:param other: The source reference to compare this one to.
|
||||
:rtype other: SourceRef
|
||||
;returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.ref != other.ref or \
|
||||
self.page != other.page or \
|
||||
self.get_date_object() != other.get_date_object():
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.is_equal(other):
|
||||
return IDENTICAL
|
||||
else:
|
||||
return EQUAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this source reference.
|
||||
|
||||
:param acquisition: The source reference to merge with the present one.
|
||||
:rtype acquisition: SourceRef
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
self._merge_note_list(acquisition)
|
||||
# merge confidence
|
||||
level_priority = [0, 4, 1, 3, 2]
|
||||
idx = min(level_priority.index(self.confidence),
|
||||
level_priority.index(acquisition.confidence))
|
||||
self.confidence = level_priority[idx]
|
||||
|
||||
def set_confidence_level(self, val):
|
||||
"""Set the confidence level."""
|
||||
self.confidence = val
|
||||
|
@ -120,6 +120,12 @@ class StyledText(object):
|
||||
return self.__class__("".join([self._string, str(other)]),
|
||||
self._tags)
|
||||
|
||||
def __eq__(self, other):
|
||||
return self._string == other._string and self._tags == other._tags
|
||||
|
||||
def __ne__(self, other):
|
||||
return self._string != other._string or self._tags != other._tags
|
||||
|
||||
# private methods
|
||||
|
||||
|
||||
|
@ -41,6 +41,7 @@ from urlparse import urlparse
|
||||
from gen.lib.secondaryobj import SecondaryObject
|
||||
from gen.lib.privacybase import PrivacyBase
|
||||
from gen.lib.urltype import UrlType
|
||||
from gen.lib.const import IDENTICAL, EQUAL, DIFFERENT
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -82,6 +83,35 @@ class Url(SecondaryObject, PrivacyBase):
|
||||
"""
|
||||
return [self.path, self.desc]
|
||||
|
||||
def is_equivalent(self, other):
|
||||
"""
|
||||
Return if this url is equivalent, that is agrees in type, full path
|
||||
name and description, to other.
|
||||
|
||||
:param other: The url to compare this one to.
|
||||
:rtype other: Url
|
||||
:returns: Constant indicating degree of equivalence.
|
||||
:rtype: int
|
||||
"""
|
||||
if self.type != other.type or \
|
||||
self.get_full_path() != other.get_full_path() or \
|
||||
self.desc != other.desc:
|
||||
return DIFFERENT
|
||||
else:
|
||||
if self.get_privacy() != other.get_privacy():
|
||||
return EQUAL
|
||||
else:
|
||||
return IDENTICAL
|
||||
|
||||
def merge(self, acquisition):
|
||||
"""
|
||||
Merge the content of acquisition into this url.
|
||||
|
||||
:param acquisition: The url to merge with the present url.
|
||||
:rtype acquisition: Url
|
||||
"""
|
||||
self._merge_privacy(acquisition)
|
||||
|
||||
def set_path(self, path):
|
||||
"""Set the URL path."""
|
||||
self.path = path
|
||||
|
@ -30,6 +30,7 @@ UrlBase class for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.lib.url import Url
|
||||
from gen.lib.const import IDENTICAL, EQUAL
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -83,6 +84,26 @@ class UrlBase(object):
|
||||
"""
|
||||
self.urls = url_list
|
||||
|
||||
def _merge_url_list(self, acquisition):
|
||||
"""
|
||||
Merge the list of urls from acquisition with our own.
|
||||
|
||||
:param acquisition: The url list of this object will be merged with
|
||||
the current url list.
|
||||
:rtype acquisition: UrlBase
|
||||
"""
|
||||
url_list = self.urls[:]
|
||||
for addendum in acquisition.get_url_list():
|
||||
for url in url_list:
|
||||
equi = url.is_equivalent(addendum)
|
||||
if equi == IDENTICAL:
|
||||
break
|
||||
elif equi == EQUAL:
|
||||
url.merge(addendum)
|
||||
break
|
||||
else:
|
||||
self.urls.append(addendum)
|
||||
|
||||
def add_url(self, url):
|
||||
"""
|
||||
Add a :class:`~gen.lib.url.Url` instance to the object's list of :class:`~gen.lib.url.Url` instances.
|
||||
|
@ -41,4 +41,12 @@ dist_pkgdata_DATA = \
|
||||
editplace.glade \
|
||||
editsourceref.glade \
|
||||
editname.glade \
|
||||
editevent.glade
|
||||
editevent.glade \
|
||||
mergeperson.glade \
|
||||
mergefamily.glade \
|
||||
mergeevent.glade \
|
||||
mergeplace.glade \
|
||||
mergesource.glade \
|
||||
mergerepository.glade \
|
||||
mergemedia.glade \
|
||||
mergenote.glade
|
||||
|
632
src/glade/mergeevent.glade
Normal file
632
src/glade/mergeevent.glade
Normal file
@ -0,0 +1,632 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergeevent">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">500</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="event_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the event that will provide the
|
||||
primary data for the merged event.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">7</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Event 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Event 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="type_btn1">
|
||||
<property name="label" translatable="yes">Type:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="type_btn2">
|
||||
<property name="label" translatable="yes">Type:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">type_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="date_btn1">
|
||||
<property name="label" translatable="yes">Date:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="date_btn2">
|
||||
<property name="label" translatable="yes">Date:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">date_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="place_btn1">
|
||||
<property name="label" translatable="yes">Place:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="place_btn2">
|
||||
<property name="label" translatable="yes">Place:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">place_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="desc_btn1">
|
||||
<property name="label" translatable="yes">Description:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="desc_btn2">
|
||||
<property name="label" translatable="yes">Description:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">desc_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn1">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn2">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">marker_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="type1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="type2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="date1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="date2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="place1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="place2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="desc1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="desc2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Attributes, notes, sources and media objects of both events will be combined.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="event_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="event_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="event_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">event_cancel</action-widget>
|
||||
<action-widget response="-5">event_ok</action-widget>
|
||||
<action-widget response="-11">event_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
570
src/glade/mergefamily.glade
Normal file
570
src/glade/mergefamily.glade
Normal file
@ -0,0 +1,570 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergefamily">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">500</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="family_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the family that will provide the
|
||||
primary data for the merged family.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Family 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Family 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="father_btn1">
|
||||
<property name="label" translatable="yes">Father:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="father_btn2">
|
||||
<property name="label" translatable="yes">Father:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">father_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="mother_btn1">
|
||||
<property name="label" translatable="yes">Mother:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="mother_btn2">
|
||||
<property name="label" translatable="yes">Mother:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">mother_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="rel_btn1">
|
||||
<property name="label" translatable="yes">Relationship:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="rel_btn2">
|
||||
<property name="label" translatable="yes">Relationship:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">rel_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn1">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn2">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">marker_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="father1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="father2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="mother1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="mother2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="rel1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="rel2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Events, lds_ord, media objects, attributes, notes and sources of both families will be combined.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="family_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="family_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="family_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">family_cancel</action-widget>
|
||||
<action-widget response="-5">family_ok</action-widget>
|
||||
<action-widget response="-11">family_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
506
src/glade/mergemedia.glade
Normal file
506
src/glade/mergemedia.glade
Normal file
@ -0,0 +1,506 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergeobject">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">500</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="object_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the object that will provide the
|
||||
primary data for the merged object.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">5</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Object 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Object 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="desc_btn1">
|
||||
<property name="label" translatable="yes">Title:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="desc_btn2">
|
||||
<property name="label" translatable="yes">Title:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">desc_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="path_btn1">
|
||||
<property name="label" translatable="yes">Path:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="path_btn2">
|
||||
<property name="label" translatable="yes">Path:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">path_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="date_btn1">
|
||||
<property name="label" translatable="yes">Date:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="date_btn2">
|
||||
<property name="label" translatable="yes">Date:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">date_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="desc1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="desc2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="path1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="path2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="date1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="date2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Attributes, sources and notes of both objects will be combined.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="object_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="object_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="object_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">object_cancel</action-widget>
|
||||
<action-widget response="-5">object_ok</action-widget>
|
||||
<action-widget response="-11">object_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
587
src/glade/mergenote.glade
Normal file
587
src/glade/mergenote.glade
Normal file
@ -0,0 +1,587 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergenote">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">600</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="note_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the note that will provide the
|
||||
primary data for the merged note.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Note 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Note 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="text_btn1">
|
||||
<property name="label" translatable="yes">Text:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="text_btn2">
|
||||
<property name="label" translatable="yes">Text:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">text_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="type_btn1">
|
||||
<property name="label" translatable="yes">Type:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="type_btn2">
|
||||
<property name="label" translatable="yes">Type:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">type_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="format_btn1">
|
||||
<property name="label" translatable="yes">Format:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="format_btn2">
|
||||
<property name="label" translatable="yes">Format:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">format_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn1">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn2">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">marker_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="text1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="text2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="warp_mode">word</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="type1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="type2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="format1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="format2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="note_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="note_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="note_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">note_cancel</action-widget>
|
||||
<action-widget response="-5">note_ok</action-widget>
|
||||
<action-widget response="-11">note_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
568
src/glade/mergeperson.glade
Normal file
568
src/glade/mergeperson.glade
Normal file
@ -0,0 +1,568 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergeperson">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">700</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="person_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the person that will provide the
|
||||
primary data for the merged person.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">5</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Person 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Person 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="name_btn1">
|
||||
<property name="label" translatable="yes">Name:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="name_btn2">
|
||||
<property name="label" translatable="yes">Name:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">name_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gender_btn1">
|
||||
<property name="label" translatable="yes">Gender:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gender_btn2">
|
||||
<property name="label" translatable="yes">Gender:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gender_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn1">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="marker_btn2">
|
||||
<property name="label" translatable="yes">Marker:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">marker_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="name1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="name2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gender1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gender2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="marker2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Events, media objects, addresses, attributes, urls, notes and sources of both persons will be combined.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="text1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="pixels_above_lines">10</property>
|
||||
<property name="pixels_below_lines">10</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="text2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="pixels_above_lines">10</property>
|
||||
<property name="pixels_below_lines">10</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="left_margin">10</property>
|
||||
<property name="right_margin">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Context Information</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="person_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="person_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="person_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">person_cancel</action-widget>
|
||||
<action-widget response="-5">person_ok</action-widget>
|
||||
<action-widget response="-11">person_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
580
src/glade/mergeplace.glade
Normal file
580
src/glade/mergeplace.glade
Normal file
@ -0,0 +1,580 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergeplace">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">500</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="place_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the place that will provide the
|
||||
primary data for the merged place.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Place 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Place 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="title_btn1">
|
||||
<property name="label" translatable="yes">Title:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="title_btn2">
|
||||
<property name="label" translatable="yes">Title:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">title_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="lat_btn1">
|
||||
<property name="label" translatable="yes">Latitude:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="lat_btn2">
|
||||
<property name="label" translatable="yes">Latitude:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">lat_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="long_btn1">
|
||||
<property name="label" translatable="yes">Longitude:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="long_btn2">
|
||||
<property name="label" translatable="yes">Longitude:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">long_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="loc_btn1">
|
||||
<property name="label" translatable="yes">Location:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="loc_btn2">
|
||||
<property name="label" translatable="yes">Location:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">loc_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="title1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="title2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="lat1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="lat2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="long1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="long2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkViewport" id="viewport1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="loc1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkViewport" id="viewport2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="loc2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Alternate locations, sources, urls, media objects and notes of both places will be combined.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="place_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="place_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="place_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">place_cancel</action-widget>
|
||||
<action-widget response="-5">place_ok</action-widget>
|
||||
<action-widget response="-11">place_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
443
src/glade/mergerepository.glade
Normal file
443
src/glade/mergerepository.glade
Normal file
@ -0,0 +1,443 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergerepository">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">500</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="repository_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the repository that will provide the
|
||||
primary data for the merged repository.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Repository 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Repository 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="name_btn1">
|
||||
<property name="label" translatable="yes">Name:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="name_btn2">
|
||||
<property name="label" translatable="yes">Name:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">name_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="type_btn1">
|
||||
<property name="label" translatable="yes">Type:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="type_btn2">
|
||||
<property name="label" translatable="yes">Type:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">type_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="name1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="name2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="type1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="type2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Addresses, urls and notes of both repositories will be combined.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="repository_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="repository_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="repository_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">repository_cancel</action-widget>
|
||||
<action-widget response="-5">repository_ok</action-widget>
|
||||
<action-widget response="-11">repository_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
569
src/glade/mergesource.glade
Normal file
569
src/glade/mergesource.glade
Normal file
@ -0,0 +1,569 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<object class="GtkDialog" id="mergesource">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">500</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="source_title">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">15</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Select the source that will provide the
|
||||
primary data for the merged source.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn1">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">handle_btn1</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_handle_btn2">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Source 1</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Source 2</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="title_btn1">
|
||||
<property name="label" translatable="yes">Title:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="title_btn2">
|
||||
<property name="label" translatable="yes">Title:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">title_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="author_btn1">
|
||||
<property name="label" translatable="yes">Author:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="author_btn2">
|
||||
<property name="label" translatable="yes">Author:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">author_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="abbrev_btn1">
|
||||
<property name="label" translatable="yes">Abbreviation:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="abbrev_btn2">
|
||||
<property name="label" translatable="yes">Abbreviation:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">abbrev_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="pub_btn1">
|
||||
<property name="label" translatable="yes">Publication:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="pub_btn2">
|
||||
<property name="label" translatable="yes">Publication:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">pub_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn1">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="gramps_btn2">
|
||||
<property name="label" translatable="yes">Gramps ID:</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">gramps_btn1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="title1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="title2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="author1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="author2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="abbrev1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="abbrev2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="pub1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="pub2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="gramps2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Notes, media objects, data-items and repository references of both sources will be combined.</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Detailed Selection</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="source_cancel">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="source_ok">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="source_help">
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">source_cancel</action-widget>
|
||||
<action-widget response="-5">source_ok</action-widget>
|
||||
<action-widget response="-11">source_help</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
@ -123,6 +123,7 @@ def register_stock_icons ():
|
||||
('gramps-geo-altmap', _('GeoView'), gtk.gdk.CONTROL_MASK, 0, ''),
|
||||
('gramps-lock', _('Public'), gtk.gdk.CONTROL_MASK, 0, ''),
|
||||
('gramps-media', _('Media'), gtk.gdk.CONTROL_MASK, 0, ''),
|
||||
('gramps-merge', _('Merge'), gtk.gdk.CONTROL_MASK, 0, ''),
|
||||
('gramps-notes', _('Notes'), gtk.gdk.CONTROL_MASK, 0, ''),
|
||||
('gramps-parents', _('Parents'), gtk.gdk.CONTROL_MASK, 0, ''),
|
||||
('gramps-parents-add', _('Add Parents'), gtk.gdk.CONTROL_MASK, 0, ''),
|
||||
|
@ -199,6 +199,8 @@ class ListView(NavigationView):
|
||||
self.ADD_MSG, self.add),
|
||||
('Remove', gtk.STOCK_REMOVE, _("_Remove"), "<control>Delete",
|
||||
self.DEL_MSG, self.remove),
|
||||
('Merge', 'gramps-merge', _('_Merge...'), None, None,
|
||||
self.merge),
|
||||
('ExportTab', None, _('Export View...'), None, None,
|
||||
self.export),
|
||||
])
|
||||
@ -1017,6 +1019,12 @@ class ListView(NavigationView):
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Template function to allow the merger of two objects.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def remove_object_from_handle(self, handle):
|
||||
"""
|
||||
Template function to allow the removal of an object by its handle
|
||||
|
@ -34,6 +34,7 @@ dist_pkgdata_DATA = \
|
||||
gramps-gramplet.png \
|
||||
gramps-lock.png \
|
||||
gramps-media.png \
|
||||
gramps-merge.png \
|
||||
gramps-notes.png \
|
||||
gramps-parents.png \
|
||||
gramps-parents-add.png \
|
||||
|
@ -34,6 +34,7 @@ dist_pkgdata_DATA = \
|
||||
gramps-gramplet.png \
|
||||
gramps-lock.png \
|
||||
gramps-media.png \
|
||||
gramps-merge.png \
|
||||
gramps-notes.png \
|
||||
gramps-parents.png \
|
||||
gramps-parents-add.png \
|
||||
|
@ -34,6 +34,7 @@ dist_pkgdata_DATA = \
|
||||
gramps-gramplet.png \
|
||||
gramps-lock.png \
|
||||
gramps-media.png \
|
||||
gramps-merge.png \
|
||||
gramps-notes.png \
|
||||
gramps-parents.png \
|
||||
gramps-parents-add.png \
|
||||
|
@ -204,13 +204,10 @@ class BasePersonView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="SetActive"/>
|
||||
<menuitem action="FilterEdit"/>
|
||||
<placeholder name="Merge">
|
||||
<menuitem action="CmpMerge"/>
|
||||
<menuitem action="FastMerge"/>
|
||||
</placeholder>
|
||||
</menu>
|
||||
</menubar>
|
||||
<toolbar name="ToolBar">
|
||||
@ -223,6 +220,7 @@ class BasePersonView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
<popup name="Popup">
|
||||
@ -233,6 +231,7 @@ class BasePersonView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -343,10 +342,8 @@ class BasePersonView(ListView):
|
||||
_("Add a new person"), self.add),
|
||||
('Remove', gtk.STOCK_REMOVE, _("_Remove"), "<control>Delete",
|
||||
_("Remove the Selected Person"), self.remove),
|
||||
('CmpMerge', None, _('Compare and _Merge...'), None, None,
|
||||
self.cmp_merge),
|
||||
('FastMerge', None, _('_Fast Merge...'), None, None,
|
||||
self.fast_merge),
|
||||
('Merge', 'gramps-merge', _('_Merge...'), None, None,
|
||||
self.merge),
|
||||
('ExportTab', None, _('Export View...'), None, None, self.export),
|
||||
])
|
||||
|
||||
@ -365,31 +362,10 @@ class BasePersonView(ListView):
|
||||
self.all_action.set_visible(False)
|
||||
self.edit_action.set_visible(False)
|
||||
|
||||
def cmp_merge(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
ErrorDialog(
|
||||
_("Cannot merge people"),
|
||||
_("Exactly two people must be selected to perform a merge. "
|
||||
"A second person can be selected by holding down the "
|
||||
"control key while clicking on the desired person."))
|
||||
else:
|
||||
import Merge
|
||||
person1 = self.dbstate.db.get_person_from_handle(mlist[0])
|
||||
person2 = self.dbstate.db.get_person_from_handle(mlist[1])
|
||||
if person1 and person2:
|
||||
Merge.PersonCompare(self.dbstate, self.uistate, person1,
|
||||
person2, self.build_tree)
|
||||
else:
|
||||
ErrorDialog(
|
||||
_("Cannot merge people"),
|
||||
_("Exactly two people must be selected to perform a "
|
||||
"merge. A second person can be selected by holding "
|
||||
"down the control key while clicking on the desired "
|
||||
"person."))
|
||||
|
||||
def fast_merge(self, obj):
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected people.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
@ -400,15 +376,4 @@ class BasePersonView(ListView):
|
||||
"control key while clicking on the desired person."))
|
||||
else:
|
||||
import Merge
|
||||
|
||||
person1 = self.dbstate.db.get_person_from_handle(mlist[0])
|
||||
person2 = self.dbstate.db.get_person_from_handle(mlist[1])
|
||||
if person1 and person2:
|
||||
Merge.MergePeopleUI(self.dbstate, self.uistate, person1,
|
||||
person2, self.build_tree)
|
||||
else:
|
||||
ErrorDialog(
|
||||
_("Cannot merge people"),
|
||||
_("Exactly two people must be selected to perform a merge. "
|
||||
"A second person can be selected by holding down the "
|
||||
"control key while clicking on the desired person."))
|
||||
Merge.MergePeople(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
@ -155,8 +155,6 @@ class PlaceBaseView(ListView):
|
||||
|
||||
def define_actions(self):
|
||||
ListView.define_actions(self)
|
||||
self._add_action('FastMerge', None, _('_Merge...'),
|
||||
callback=self.fast_merge)
|
||||
self._add_toolmenu_action('MapsList', _('Loading...'),
|
||||
_("Attempt to see selected locations with a Map "
|
||||
"Service (OpenstreetMap, Google Maps, ...)"),
|
||||
@ -317,11 +315,9 @@ class PlaceBaseView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="FilterEdit"/>
|
||||
<placeholder name="Merge">
|
||||
<menuitem action="FastMerge"/>
|
||||
</placeholder>
|
||||
</menu>
|
||||
</menubar>
|
||||
<toolbar name="ToolBar">
|
||||
@ -333,6 +329,7 @@ class PlaceBaseView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
<separator/>
|
||||
<toolitem action="MapsList"/>
|
||||
</placeholder>
|
||||
@ -344,6 +341,7 @@ class PlaceBaseView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -397,7 +395,10 @@ class PlaceBaseView(ListView):
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def fast_merge(self, obj):
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected places.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
|
@ -53,6 +53,7 @@ import Errors
|
||||
import Bookmarks
|
||||
import config
|
||||
from DdTargets import DdTargets
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gui.editors import EditEvent, DeleteEventQuery
|
||||
from Filters.SideBar import EventSidebarFilter
|
||||
from gen.plug import CATEGORY_QR_EVENT
|
||||
@ -178,6 +179,7 @@ class EventView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="FilterEdit"/>
|
||||
</menu>
|
||||
@ -191,6 +193,7 @@ class EventView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
<popup name="Popup">
|
||||
@ -200,6 +203,7 @@ class EventView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -256,6 +260,22 @@ class EventView(ListView):
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected events.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
msg = _("Cannot merge event objects.")
|
||||
msg2 = _("Exactly two events must be selected to perform a merge. "
|
||||
"A second object can be selected by holding down the "
|
||||
"control key while clicking on the desired event.")
|
||||
ErrorDialog(msg, msg2)
|
||||
else:
|
||||
import Merge
|
||||
Merge.MergeEvents(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
def dummy_report(self, obj):
|
||||
""" For the xml UI definition of popup to work, the submenu
|
||||
Quick Report must have an entry in the xml
|
||||
|
@ -50,6 +50,7 @@ from gui.editors import EditFamily
|
||||
import Bookmarks
|
||||
import Errors
|
||||
import config
|
||||
from QuestionDialog import ErrorDialog
|
||||
from Filters.SideBar import FamilySidebarFilter
|
||||
from gen.plug import CATEGORY_QR_FAMILY
|
||||
|
||||
@ -107,6 +108,7 @@ class FamilyView(ListView):
|
||||
FamilyModel,
|
||||
signal_map, dbstate.db.get_family_bookmarks(),
|
||||
Bookmarks.FamilyBookmarks, nav_group,
|
||||
multiple=True,
|
||||
filter_class=FamilySidebarFilter)
|
||||
|
||||
self.func_list = {
|
||||
@ -143,6 +145,7 @@ class FamilyView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="FilterEdit"/>
|
||||
</menu>
|
||||
@ -162,6 +165,7 @@ class FamilyView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
<popup name="Popup">
|
||||
@ -171,6 +175,7 @@ class FamilyView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -236,6 +241,22 @@ class FamilyView(ListView):
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected families.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
msg = _("Cannot merge families.")
|
||||
msg2 = _("Exactly two families must be selected to perform a merge."
|
||||
" A second family can be selected by holding down the "
|
||||
"control key while clicking on the desired family.")
|
||||
ErrorDialog(msg, msg2)
|
||||
else:
|
||||
import Merge
|
||||
Merge.MergeFamilies(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
||||
def dummy_report(self, obj):
|
||||
""" For the xml UI definition of popup to work, the submenu
|
||||
Quick Report must have an entry in the xml
|
||||
|
@ -62,6 +62,7 @@ from gui.editors import EditMedia, DeleteMediaQuery
|
||||
import Errors
|
||||
from Filters.SideBar import MediaSidebarFilter
|
||||
from DdTargets import DdTargets
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import CATEGORY_QR_MEDIA
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -355,6 +356,7 @@ class MediaView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="FilterEdit"/>
|
||||
</menu>
|
||||
@ -381,6 +383,7 @@ class MediaView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
</placeholder>
|
||||
<separator/>
|
||||
<toolitem action="OpenMedia"/>
|
||||
@ -395,6 +398,7 @@ class MediaView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -441,6 +445,23 @@ class MediaView(ListView):
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected objects.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
msg = _("Cannot merge media objects.")
|
||||
msg2 = _("Exactly two media objects must be selected to perform a "
|
||||
"merge. A second object can be selected by holding down the "
|
||||
"control key while clicking on the desired object.")
|
||||
ErrorDialog(msg, msg2)
|
||||
else:
|
||||
import Merge
|
||||
Merge.MergeMediaObjects(self.dbstate, self.uistate, mlist[0],
|
||||
mlist[1])
|
||||
|
||||
def get_handle_from_gramps_id(self, gid):
|
||||
"""
|
||||
returns the handle of the specified object
|
||||
|
@ -52,6 +52,7 @@ import Bookmarks
|
||||
import config
|
||||
from gen.lib import Note
|
||||
from DdTargets import DdTargets
|
||||
from QuestionDialog import ErrorDialog
|
||||
from Filters.SideBar import NoteSidebarFilter
|
||||
from gui.editors import EditNote, DeleteNoteQuery
|
||||
from gen.plug import CATEGORY_QR_NOTE
|
||||
@ -166,6 +167,7 @@ class NoteView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="FilterEdit"/>
|
||||
</menu>
|
||||
@ -179,6 +181,7 @@ class NoteView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
<popup name="Popup">
|
||||
@ -188,6 +191,7 @@ class NoteView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -239,3 +243,19 @@ class NoteView(ListView):
|
||||
EditNote(self.dbstate, self.uistate, [], note)
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected notes.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
msg = _("Cannot merge notes.")
|
||||
msg2 = _("Exactly two notes must be selected to perform a merge. "
|
||||
"A second note can be selected by holding down the "
|
||||
"control key while clicking on the desired note.")
|
||||
ErrorDialog(msg, msg2)
|
||||
else:
|
||||
import Merge
|
||||
Merge.MergeNotes(self.dbstate, self.uistate, mlist[0], mlist[1])
|
||||
|
@ -44,6 +44,7 @@ import Errors
|
||||
import config
|
||||
from gui.editors import EditRepository, DeleteRepositoryQuery
|
||||
from DdTargets import DdTargets
|
||||
from QuestionDialog import ErrorDialog
|
||||
from Filters.SideBar import RepoSidebarFilter
|
||||
from gen.plug import CATEGORY_QR_REPOSITORY
|
||||
|
||||
@ -182,6 +183,7 @@ class RepositoryView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="FilterEdit"/>
|
||||
</menu>
|
||||
@ -195,6 +197,7 @@ class RepositoryView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
<popup name="Popup">
|
||||
@ -204,6 +207,7 @@ class RepositoryView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -235,6 +239,24 @@ class RepositoryView(ListView):
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected repositories.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
msg = _("Cannot merge repositories.")
|
||||
msg2 = _("Exactly two repositories must be selected to perform a "
|
||||
"merge. A second repository can be selected by holding "
|
||||
"down the control key while clicking on the desired "
|
||||
"repository.")
|
||||
ErrorDialog(msg, msg2)
|
||||
else:
|
||||
import Merge
|
||||
Merge.MergeRepositories(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)
|
||||
if obj:
|
||||
|
@ -130,8 +130,6 @@ class SourceView(ListView):
|
||||
|
||||
def define_actions(self):
|
||||
ListView.define_actions(self)
|
||||
self._add_action('FastMerge', None, _('_Merge'),
|
||||
callback=self.fast_merge)
|
||||
self._add_action('FilterEdit', None, _('Source Filter Editor'),
|
||||
callback=self.filter_editor,)
|
||||
self._add_action('QuickReport', None, _("Quick View"), None, None, None)
|
||||
@ -166,11 +164,9 @@ class SourceView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
</placeholder>
|
||||
<menuitem action="FilterEdit"/>
|
||||
<placeholder name="Merge">
|
||||
<menuitem action="FastMerge"/>
|
||||
</placeholder>
|
||||
</menu>
|
||||
</menubar>
|
||||
<toolbar name="ToolBar">
|
||||
@ -182,6 +178,7 @@ class SourceView(ListView):
|
||||
<toolitem action="Add"/>
|
||||
<toolitem action="Edit"/>
|
||||
<toolitem action="Remove"/>
|
||||
<toolitem action="Merge"/>
|
||||
</placeholder>
|
||||
</toolbar>
|
||||
<popup name="Popup">
|
||||
@ -191,6 +188,7 @@ class SourceView(ListView):
|
||||
<menuitem action="Add"/>
|
||||
<menuitem action="Edit"/>
|
||||
<menuitem action="Remove"/>
|
||||
<menuitem action="Merge"/>
|
||||
<separator/>
|
||||
<menu name="QuickReport" action="QuickReport">
|
||||
<menuitem action="Dummy"/>
|
||||
@ -226,7 +224,10 @@ class SourceView(ListView):
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
|
||||
def fast_merge(self, obj):
|
||||
def merge(self, obj):
|
||||
"""
|
||||
Merge the selected sources.
|
||||
"""
|
||||
mlist = self.selected_handles()
|
||||
|
||||
if len(mlist) != 2:
|
||||
|
Loading…
x
Reference in New Issue
Block a user