* src/DataViews/_RelationView.py: Show buttons for reorder and add parents in case the toolbar is not visible.

svn: r7742
This commit is contained in:
Martin Hawlisch 2006-12-01 16:17:26 +00:00
parent 4987b9b9b4
commit 2c4d5d0750
2 changed files with 25 additions and 11 deletions

View File

@ -1,3 +1,7 @@
2006-12-01 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/DataViews/_RelationView.py: Show buttons for reorder and add
parents in case the toolbar is not visible.
2006-12-01 Alex Roitman <shura@gramps-project.org> 2006-12-01 Alex Roitman <shura@gramps-project.org>
* src/ArgHandler.py (cl_action): Properly call CLI tool. * src/ArgHandler.py (cl_action): Properly call CLI tool.
* src/plugins/DumpGenderStats.py (__init__): Fix CLI mode. * src/plugins/DumpGenderStats.py (__init__): Fix CLI mode.

View File

@ -116,12 +116,15 @@ class RelationshipView(PageView.PersonNavView):
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.toolbar_visible = Config.get(Config.TOOLBAR_ON)
self.color = gtk.TextView().style.white self.color = gtk.TextView().style.white
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)
Config.client.notify_add("/apps/gramps/interface/editbutton", Config.client.notify_add("/apps/gramps/interface/editbutton",
self.config_update) self.config_update)
Config.client.notify_add("/apps/gramps/interface/toolbar-on",
self.shade_update)
def set_active(self): def set_active(self):
PageView.PersonNavView.set_active(self) PageView.PersonNavView.set_active(self)
@ -135,6 +138,7 @@ class RelationshipView(PageView.PersonNavView):
def shade_update(self, client, cnxn_id, entry, data): def shade_update(self, client, cnxn_id, entry, data):
self.use_shade = Config.get(Config.RELATION_SHADE) self.use_shade = Config.get(Config.RELATION_SHADE)
self.toolbar_visible = Config.get(Config.TOOLBAR_ON)
self.uistate.modify_statusbar(self.dbstate) self.uistate.modify_statusbar(self.dbstate)
self.redraw() self.redraw()
@ -382,7 +386,7 @@ class RelationshipView(PageView.PersonNavView):
family_handle_list = person.get_parent_family_handle_list() family_handle_list = person.get_parent_family_handle_list()
sensitive = len(family_handle_list)> 1 self.reorder_sensitive = len(family_handle_list)> 1
if family_handle_list: if family_handle_list:
for family_handle in family_handle_list: for family_handle in family_handle_list:
@ -394,8 +398,8 @@ class RelationshipView(PageView.PersonNavView):
family_handle_list = person.get_family_handle_list() family_handle_list = person.get_family_handle_list()
if not sensitive: if not self.reorder_sensitive:
sensitive = len(family_handle_list)> 1 self.reorder_sensitive = len(family_handle_list)> 1
if family_handle_list: if family_handle_list:
for family_handle in family_handle_list: for family_handle in family_handle_list:
@ -444,7 +448,7 @@ class RelationshipView(PageView.PersonNavView):
self.redrawing = False self.redrawing = False
self.uistate.modify_statusbar(self.dbstate) self.uistate.modify_statusbar(self.dbstate)
self.order_action.set_sensitive(sensitive) self.order_action.set_sensitive(self.reorder_sensitive)
return True return True
@ -613,13 +617,19 @@ class RelationshipView(PageView.PersonNavView):
else: else:
call_fcn = self.add_family call_fcn = self.add_family
del_fcn = self.delete_family del_fcn = self.delete_family
# add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD) if not self.toolbar_visible:
# hbox.pack_start(add, False) # Show edit-Buttons if toolbar is not visible
if self.reorder_sensitive:
add = GrampsWidgets.IconButton(self.reorder, None, gtk.STOCK_SORT_ASCENDING)
hbox.pack_start(add, False)
# if is_parent: add = GrampsWidgets.IconButton(call_fcn, None, gtk.STOCK_ADD)
# add = GrampsWidgets.IconButton(self.select_family, None, gtk.STOCK_INDEX) hbox.pack_start(add, False)
# hbox.pack_start(add, False)
if is_parent:
add = GrampsWidgets.IconButton(self.select_family, None, gtk.STOCK_INDEX)
hbox.pack_start(add, False)
if family: if family:
edit = GrampsWidgets.IconButton(self.edit_family, family.handle, edit = GrampsWidgets.IconButton(self.edit_family, family.handle,
@ -1069,7 +1079,7 @@ class RelationshipView(PageView.PersonNavView):
def change_to(self, obj, handle): def change_to(self, obj, handle):
self.dbstate.change_active_handle(handle) self.dbstate.change_active_handle(handle)
def reorder(self,obj): def reorder(self,obj,dumm1=None,dummy2=None):
if self.dbstate.active: if self.dbstate.active:
try: try:
import Reorder import Reorder