diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 46cf99b0d..1cedd3112 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-05-25 Don Allingham + * src/Merge/_MergePlace.py: handle notes + * src/glade/mergedata.glade: handle notes * src/DataViews/_PersonView.py: Merge module support * src/Merge/_MergeSource.py: broken out of MergeData.py * src/Merge/__init__.py: support of module diff --git a/gramps2/src/Merge/_MergePlace.py b/gramps2/src/Merge/_MergePlace.py index 32f7705ba..cba7f121d 100644 --- a/gramps2/src/Merge/_MergePlace.py +++ b/gramps2/src/Merge/_MergePlace.py @@ -66,12 +66,27 @@ class MergePlaces(ManagedWindow.ManagedWindow): self.glade = gtk.glade.XML(const.merge_glade,"merge_places","gramps") self.set_window(self.glade.get_widget("merge_places"), self.glade.get_widget('title'), - _("Select title")) + _("Merge Places")) - self.glade.get_widget("title1_text").set_text(self.p1.get_title()) - self.glade.get_widget("title2_text").set_text(self.p2.get_title()) - self.t3 = self.glade.get_widget("title3_text") - self.t3.set_text(self.p1.get_title()) + title1_text = self.glade.get_widget("title1_text") + title2_text = self.glade.get_widget("title2_text") + self.title3_entry = self.glade.get_widget("title3_text") + + title1_text.set_text(self.p1.get_title()) + title2_text.set_text(self.p2.get_title()) + self.title3_entry.set_text(self.p1.get_title()) + + self.note_p1 = self.glade.get_widget('note_p1') + self.note_p2 = self.glade.get_widget('note_p2') + self.note_merge = self.glade.get_widget('note_merge') + self.note_title = self.glade.get_widget('note_title') + + self.note_conflict = self.p1.get_note() and self.p2.get_note() + if self.note_conflict: + self.note_title.show() + self.note_p1.show() + self.note_p2.show() + self.note_merge.show() self.glade.get_widget('cancel').connect('clicked', self.close_window) self.glade.get_widget('ok').connect('clicked', self.merge) @@ -98,7 +113,7 @@ class MergePlaces(ManagedWindow.ManagedWindow): if t2active: self.p1.set_title(self.p2.get_title()) elif self.glade.get_widget("title3").get_active(): - self.p1.set_title(unicode(self.t3.get_text())) + self.p1.set_title(unicode(self.title3_entry.get_text())) # Set longitude if self.p1.get_longitude() == "" and self.p2.get_longitude() != "": @@ -121,13 +136,18 @@ class MergePlaces(ManagedWindow.ManagedWindow): self.p1.add_source(source) # Add notes from P2 to P1 - note = self.p2.get_note() - if note != "": - if self.p1.get_note() == "": + if self.note_conflict: + note1 = self.p1.get_note() + note2 = self.p2.get_note() + if self.note_p2.get_active(): + self.p1.set_note(note2) + elif self.note_merge.get_active(): + self.p1.set_note("%s\n\n%s" % (note1,note2)) + else: + note = self.p2.get_note() + if note != "" and self.p1.get_note() == "": self.p1.set_note(note) - elif self.p1.get_note() != note: - self.p1.set_note("%s\n\n%s" % (self.p1.get_note(),note)) - + if t2active: lst = [self.p1.get_main_location()] + self.p1.get_alternate_locations() self.p1.set_main_location(self.p2.get_main_location()) diff --git a/gramps2/src/glade/mergedata.glade b/gramps2/src/glade/mergedata.glade index deb5d86bf..0c148c0a3 100644 --- a/gramps2/src/glade/mergedata.glade +++ b/gramps2/src/glade/mergedata.glade @@ -4,11 +4,11 @@ - True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True + 450 True False True @@ -116,10 +116,10 @@ 6 True - 3 - 2 + 8 + 3 False - 0 + 6 6 @@ -135,10 +135,10 @@ False - 1 - 2 - 2 - 3 + 2 + 3 + 3 + 4 @@ -162,10 +162,10 @@ 0 - 1 - 2 - 0 - 1 + 2 + 3 + 1 + 2 fill @@ -189,11 +189,131 @@ False 0 + + 2 + 3 + 2 + 3 + fill + + + + + + + True + <b>Title selection</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 3 + 0 + 1 + fill + + + + + + + <b>Note selection</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 3 + 4 + 5 + fill + + + + + + + True + Select note from Place 1 + True + GTK_RELIEF_NORMAL + True + False + False + True + 1 - 2 - 1 - 2 + 3 + 5 + 6 + fill + + + + + + + True + Select note from Place 2 + True + GTK_RELIEF_NORMAL + True + False + False + True + note_p1 + + + 1 + 3 + 6 + 7 + fill + + + + + + + True + Merge notes + True + GTK_RELIEF_NORMAL + True + False + False + True + note_p1 + + + 1 + 3 + 7 + 8 fill @@ -212,12 +332,10 @@ True - 0 - 1 - 0 - 1 - 5 - 5 + 1 + 2 + 1 + 2 fill @@ -237,12 +355,10 @@ title1 - 0 - 1 - 1 - 2 - 5 - 5 + 1 + 2 + 2 + 3 fill @@ -262,12 +378,10 @@ title1 - 0 - 1 - 2 - 3 - 5 - 5 + 1 + 2 + 3 + 4 fill