2006-11-16 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: share parents button * src/images/share-fam.png: share parents button * src/gramps_main.py: share parents button svn: r7638
This commit is contained in:
parent
ddebbc6664
commit
d24d0eaae0
@ -1,3 +1,8 @@
|
|||||||
|
2006-11-16 Don Allingham <don@gramps-project.org>
|
||||||
|
* 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 <shura@phy.ucsf.edu>
|
2006-11-16 Alex Roitman <shura@phy.ucsf.edu>
|
||||||
* src/Reorder.py: Import gettext.
|
* src/Reorder.py: Import gettext.
|
||||||
|
|
||||||
|
@ -111,14 +111,12 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
self, _('Relationships'), dbstate, uistate)
|
self, _('Relationships'), dbstate, uistate)
|
||||||
|
|
||||||
dbstate.connect('database-changed', self.change_db)
|
dbstate.connect('database-changed', self.change_db)
|
||||||
#dbstate.connect('active-changed', self.redraw)
|
|
||||||
self.show_siblings = Config.get(Config.FAMILY_SIBLINGS)
|
self.show_siblings = Config.get(Config.FAMILY_SIBLINGS)
|
||||||
self.show_details = Config.get(Config.FAMILY_DETAILS)
|
self.show_details = Config.get(Config.FAMILY_DETAILS)
|
||||||
self.connect_to_db(dbstate.db)
|
self.connect_to_db(dbstate.db)
|
||||||
self.redrawing = False
|
self.redrawing = False
|
||||||
self.use_shade = Config.get(Config.RELATION_SHADE)
|
self.use_shade = Config.get(Config.RELATION_SHADE)
|
||||||
self.color = gtk.TextView().style.white
|
self.color = gtk.TextView().style.white
|
||||||
#self.color = gtk.Label().style.light[gtk.STATE_NORMAL]
|
|
||||||
self.child = None
|
self.child = None
|
||||||
Config.client.notify_add("/apps/gramps/preferences/relation-shade",
|
Config.client.notify_add("/apps/gramps/preferences/relation-shade",
|
||||||
self.shade_update)
|
self.shade_update)
|
||||||
@ -254,6 +252,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
<menu action="EditMenu">
|
<menu action="EditMenu">
|
||||||
<menuitem action="AddParents"/>
|
<menuitem action="AddParents"/>
|
||||||
<menuitem action="AddSpouse"/>
|
<menuitem action="AddSpouse"/>
|
||||||
|
<menuitem action="ShareFamily"/>
|
||||||
<menuitem action="ChangeOrder"/>
|
<menuitem action="ChangeOrder"/>
|
||||||
<menuitem action="FilterEdit"/>
|
<menuitem action="FilterEdit"/>
|
||||||
</menu>
|
</menu>
|
||||||
@ -276,6 +275,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
</placeholder>
|
</placeholder>
|
||||||
<placeholder name="CommonEdit">
|
<placeholder name="CommonEdit">
|
||||||
<toolitem action="AddParents"/>
|
<toolitem action="AddParents"/>
|
||||||
|
<toolitem action="ShareFamily"/>
|
||||||
<toolitem action="AddSpouse"/>
|
<toolitem action="AddSpouse"/>
|
||||||
<toolitem action="ChangeOrder"/>
|
<toolitem action="ChangeOrder"/>
|
||||||
</placeholder>
|
</placeholder>
|
||||||
@ -303,6 +303,8 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
_("Adds a new relationship"), self.add_spouse),
|
_("Adds a new relationship"), self.add_spouse),
|
||||||
('AddParents', 'gramps-parents', _('Add Parents'), None ,
|
('AddParents', 'gramps-parents', _('Add Parents'), None ,
|
||||||
_("Adds a new set of parents"), self.add_parents),
|
_("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)
|
self.add_action_group(self.order_action)
|
||||||
@ -1054,6 +1056,26 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
family,
|
family,
|
||||||
child)
|
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):
|
def add_parents(self, obj):
|
||||||
from Editors import EditFamily
|
from Editors import EditFamily
|
||||||
family = RelLib.Family()
|
family = RelLib.Family()
|
||||||
|
@ -87,6 +87,8 @@ else:
|
|||||||
parents_icon = "parents.svg"
|
parents_icon = "parents.svg"
|
||||||
spouse_icon = "spouse.svg"
|
spouse_icon = "spouse.svg"
|
||||||
|
|
||||||
|
sharefam_icon = "share-fam.png"
|
||||||
|
|
||||||
def register_stock_icons ():
|
def register_stock_icons ():
|
||||||
items = [
|
items = [
|
||||||
(os.path.join(const.image_dir, person_icon),
|
(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,'')),
|
('gramps-edit-bookmark',_('Edit bookmarks'),gtk.gdk.CONTROL_MASK,0,'')),
|
||||||
(os.path.join(const.image_dir,'stock_insert-url.png'),
|
(os.path.join(const.image_dir,'stock_insert-url.png'),
|
||||||
('gramps-url',_('URL'),gtk.gdk.CONTROL_MASK,0,'')),
|
('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
|
# Register our stock items
|
||||||
|
BIN
gramps2/src/images/share-fam.png
Normal file
BIN
gramps2/src/images/share-fam.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Loading…
x
Reference in New Issue
Block a user