diff --git a/ChangeLog b/ChangeLog index 8ec4f9a72..97cf05f52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-16 Don Allingham + * src/DataViews/_RelationView.py: share parents button + * src/images/share-fam.png: share parents button + * src/gramps_main.py: share parents button + 2006-11-16 Alex Roitman * src/Reorder.py: Import gettext. diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index b990bba10..c5d0fd8d6 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -111,14 +111,12 @@ class RelationshipView(PageView.PersonNavView): self, _('Relationships'), dbstate, uistate) dbstate.connect('database-changed', self.change_db) - #dbstate.connect('active-changed', self.redraw) self.show_siblings = Config.get(Config.FAMILY_SIBLINGS) self.show_details = Config.get(Config.FAMILY_DETAILS) self.connect_to_db(dbstate.db) self.redrawing = False self.use_shade = Config.get(Config.RELATION_SHADE) self.color = gtk.TextView().style.white - #self.color = gtk.Label().style.light[gtk.STATE_NORMAL] self.child = None Config.client.notify_add("/apps/gramps/preferences/relation-shade", self.shade_update) @@ -254,6 +252,7 @@ class RelationshipView(PageView.PersonNavView): + @@ -276,6 +275,7 @@ class RelationshipView(PageView.PersonNavView): + @@ -303,6 +303,8 @@ class RelationshipView(PageView.PersonNavView): _("Adds a new relationship"), self.add_spouse), ('AddParents', 'gramps-parents', _('Add Parents'), None , _("Adds a new set of parents"), self.add_parents), + ('ShareFamily', 'gramps-sharefamily', _('Share Parents'), None , + _("Adds to an existing set of parents"), self.select_parents), ]) self.add_action_group(self.order_action) @@ -1054,6 +1056,26 @@ class RelationshipView(PageView.PersonNavView): family, child) + def select_parents(self, obj): + from Selectors import selector_factory + SelectFamily = selector_factory('Family') + + phandle = self.dbstate.get_active_person().handle + person = self.dbstate.db.get_person_from_handle(phandle) + skip = set(person.get_family_handle_list()) + + dialog = SelectFamily(self.dbstate, self.uistate, skip=skip) + family = dialog.run() + + if family: + active_handle = self.dbstate.active.handle + child = self.dbstate.db.get_person_from_handle(active_handle) + + GrampsDb.add_child_to_family( + self.dbstate.db, + family, + child) + def add_parents(self, obj): from Editors import EditFamily family = RelLib.Family() diff --git a/src/gramps_main.py b/src/gramps_main.py index 3e425cd66..225ff5428 100644 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -87,6 +87,8 @@ else: parents_icon = "parents.svg" spouse_icon = "spouse.svg" +sharefam_icon = "share-fam.png" + def register_stock_icons (): items = [ (os.path.join(const.image_dir, person_icon), @@ -127,6 +129,8 @@ def register_stock_icons (): ('gramps-edit-bookmark',_('Edit bookmarks'),gtk.gdk.CONTROL_MASK,0,'')), (os.path.join(const.image_dir,'stock_insert-url.png'), ('gramps-url',_('URL'),gtk.gdk.CONTROL_MASK,0,'')), + (os.path.join(const.image_dir,'share-fam.png'), + ('gramps-sharefamily',_('Share Family'),gtk.gdk.CONTROL_MASK,0,'')), ] # Register our stock items diff --git a/src/images/share-fam.png b/src/images/share-fam.png new file mode 100644 index 000000000..ae7546588 Binary files /dev/null and b/src/images/share-fam.png differ