diff --git a/ChangeLog b/ChangeLog index ee45089cc..c6cf9ed86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-11-08 Don Allingham + * src/DataViews/_RelationView.py: add toolbar buttons + * src/images/Makefile.am: install new svg files + * src/images/parents.svg: button for toolbar + * src/images/spouse.svg: button for toolbar + * src/gramps_main.py: register new stock icons + 2006-11-07 Don Allingham * src/plugins/RemoveUnused.py: general cleanup * src/DataViews/_RelationshipView.py: Optionally hide Edit buttons diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index bf5bea08b..7e0dad7cc 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -227,6 +227,8 @@ class RelationshipView(PageView.PersonNavView): + + @@ -248,6 +250,8 @@ class RelationshipView(PageView.PersonNavView): + + @@ -265,9 +269,19 @@ class RelationshipView(PageView.PersonNavView): self.order_action = gtk.ActionGroup(self.title + '/ChangeOrder') self.order_action.add_actions([ ('ChangeOrder', gtk.STOCK_SORT_ASCENDING, _('_Reorder'), None , - _("Reorder the relationships"), self.reorder) + _("Reorder the relationships"), self.reorder), ]) + + self.family_action = gtk.ActionGroup(self.title + '/Family') + self.family_action.add_actions([ + ('AddSpouse', 'gramps-spouse', _('Add Spouse'), None , + _("Adds a new relationship"), self.add_spouse), + ('AddParents', 'gramps-parents', _('Add Parents'), None , + _("Adds a new set of parents"), self.add_parents), + ]) + self.add_action_group(self.order_action) + self.add_action_group(self.family_action) self.add_toggle_action('Details', None, _('Show details'), None, None, self.details_toggle, @@ -592,8 +606,8 @@ class RelationshipView(PageView.PersonNavView): call_fcn = self.add_family del_fcn = self.delete_family - add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD) - hbox.pack_start(add, False) +# add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD) +# hbox.pack_start(add, False) if is_parent: add = GrampsWidgets.IconButton(self.select_family, None, gtk.STOCK_INDEX) @@ -970,6 +984,21 @@ class RelationshipView(PageView.PersonNavView): except Errors.WindowActiveError: pass + def add_spouse(self, obj): + from Editors import EditFamily + family = RelLib.Family() + person = self.dbstate.active + + if person.gender == RelLib.Person.MALE: + family.set_father_handle(person.handle) + else: + family.set_mother_handle(person.handle) + + try: + EditFamily(self.dbstate, self.uistate, [], family) + except Errors.WindowActiveError: + pass + def select_family(self, obj, event, handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: from Selectors import selector_factory @@ -990,6 +1019,20 @@ class RelationshipView(PageView.PersonNavView): self.dbstate.db, family, child) + + def add_parents(self, obj): + from Editors import EditFamily + family = RelLib.Family() + person = self.dbstate.active + + ref = RelLib.ChildRef() + ref.ref = person.handle + family.add_child_ref(ref) + + try: + EditFamily(self.dbstate, self.uistate, [], family) + except Errors.WindowActiveError: + pass def add_parent_family(self, obj, event, handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: diff --git a/src/gramps_main.py b/src/gramps_main.py index 13c0cebf4..3e425cd66 100644 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -72,6 +72,8 @@ if platform.system() == "Windows": events_icon = "events.png" tools_icon = "tools.png" reports_icon = "reports.png" + parents_icon = "parents.png" + spouse_icon = "spouse.png" else: person_icon = "person.svg" relation_icon = "relation.svg" @@ -82,11 +84,17 @@ else: events_icon = "events.svg" tools_icon = "tools.svg" reports_icon = "reports.svg" + parents_icon = "parents.svg" + spouse_icon = "spouse.svg" def register_stock_icons (): items = [ (os.path.join(const.image_dir, person_icon), ('gramps-person',_('Person'),gtk.gdk.CONTROL_MASK,0,'')), + (os.path.join(const.image_dir, parents_icon), + ('gramps-parents',_('Add Parents'),gtk.gdk.CONTROL_MASK,0,'')), + (os.path.join(const.image_dir, spouse_icon), + ('gramps-spouse',_('Add Spouse'),gtk.gdk.CONTROL_MASK,0,'')), (os.path.join(const.image_dir, relation_icon), ('gramps-family',_('Relationships'),gtk.gdk.CONTROL_MASK,0,'')), (os.path.join(const.image_dir, family_icon), diff --git a/src/images/Makefile.am b/src/images/Makefile.am index 968d0283c..948aee490 100644 --- a/src/images/Makefile.am +++ b/src/images/Makefile.am @@ -67,6 +67,8 @@ dist_pkgdata_DATA = \ person.png\ tools.svg\ tools.png\ + parents.svg\ + spouse.svg\ place.svg\ place.png\ relation.svg\ diff --git a/src/images/parents.svg b/src/images/parents.svg new file mode 100644 index 000000000..e5d642ae2 --- /dev/null +++ b/src/images/parents.svg @@ -0,0 +1,704 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + People + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + users + people + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/images/spouse.svg b/src/images/spouse.svg new file mode 100644 index 000000000..d39034bdb --- /dev/null +++ b/src/images/spouse.svg @@ -0,0 +1,545 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + People + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + users + people + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +