* src/Reorder.py: Allow for reordering of relationships, enhance
buttons svn: r7527
This commit is contained in:
parent
5926d2c566
commit
e560e50e46
@ -1,5 +1,6 @@
|
|||||||
2006-10-31 Don Allingham <don@gramps-project.org>
|
2006-10-31 Don Allingham <don@gramps-project.org>
|
||||||
* src/Reorder.py: Allow for reordering of relationships
|
* src/Reorder.py: Allow for reordering of relationships, enhance
|
||||||
|
buttons
|
||||||
* src/DataViews/_RelationView.py: add reorder support
|
* src/DataViews/_RelationView.py: add reorder support
|
||||||
* src/glade/gramps.glade: reorder dialog
|
* src/glade/gramps.glade: reorder dialog
|
||||||
* src/Makefile.am: install Reorder.py
|
* src/Makefile.am: install Reorder.py
|
||||||
|
@ -262,9 +262,12 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
def define_actions(self):
|
def define_actions(self):
|
||||||
PageView.PersonNavView.define_actions(self)
|
PageView.PersonNavView.define_actions(self)
|
||||||
|
|
||||||
self.add_action('ChangeOrder', gtk.STOCK_SORT_ASCENDING, _("_Reorder"),
|
self.order_action = gtk.ActionGroup(self.title + '/ChangeOrder')
|
||||||
tip=_("Reorder the relationships"),
|
self.order_action.add_actions([
|
||||||
callback=self.reorder)
|
('ChangeOrder', gtk.STOCK_SORT_ASCENDING, _('_Reorder'), None ,
|
||||||
|
_("Reorder the relationships"), self.reorder)
|
||||||
|
])
|
||||||
|
self.add_action_group(self.order_action)
|
||||||
|
|
||||||
self.add_toggle_action('Details', None, _('Show details'),
|
self.add_toggle_action('Details', None, _('Show details'),
|
||||||
None, None, self.details_toggle,
|
None, None, self.details_toggle,
|
||||||
@ -335,7 +338,12 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
|
|
||||||
self.attach = AttachList()
|
self.attach = AttachList()
|
||||||
self.row = 1
|
self.row = 1
|
||||||
|
|
||||||
|
|
||||||
family_handle_list = person.get_parent_family_handle_list()
|
family_handle_list = person.get_parent_family_handle_list()
|
||||||
|
|
||||||
|
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:
|
||||||
if family_handle:
|
if family_handle:
|
||||||
@ -345,6 +353,10 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
self.row += 1
|
self.row += 1
|
||||||
|
|
||||||
family_handle_list = person.get_family_handle_list()
|
family_handle_list = person.get_family_handle_list()
|
||||||
|
|
||||||
|
if not sensitive:
|
||||||
|
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:
|
||||||
if family_handle:
|
if family_handle:
|
||||||
@ -391,6 +403,9 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
self.vbox.pack_start(self.child, False)
|
self.vbox.pack_start(self.child, False)
|
||||||
self.redrawing = False
|
self.redrawing = False
|
||||||
self.uistate.modify_statusbar(self.dbstate)
|
self.uistate.modify_statusbar(self.dbstate)
|
||||||
|
|
||||||
|
self.order_action.set_sensitive(sensitive)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def write_title(self, person):
|
def write_title(self, person):
|
||||||
|
@ -41,6 +41,12 @@ class Reorder(ManagedWindow.ManagedWindow):
|
|||||||
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
|
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
|
||||||
|
|
||||||
self.person = self.dbstate.db.get_person_from_handle(handle)
|
self.person = self.dbstate.db.get_person_from_handle(handle)
|
||||||
|
self.parent_list = self.person.get_parent_family_handle_list()
|
||||||
|
self.family_list = self.person.get_family_handle_list()
|
||||||
|
|
||||||
|
penable = len(self.parent_list) > 1
|
||||||
|
fenable = len(self.family_list) > 1
|
||||||
|
|
||||||
self.set_window(top, None, _("Reorder Relationships"))
|
self.set_window(top, None, _("Reorder Relationships"))
|
||||||
|
|
||||||
self.ptree = xml.get_widget('ptree')
|
self.ptree = xml.get_widget('ptree')
|
||||||
@ -51,13 +57,23 @@ class Reorder(ManagedWindow.ManagedWindow):
|
|||||||
|
|
||||||
xml.get_widget('ok').connect('clicked', self.ok_clicked)
|
xml.get_widget('ok').connect('clicked', self.ok_clicked)
|
||||||
xml.get_widget('cancel').connect('clicked', self.cancel_clicked)
|
xml.get_widget('cancel').connect('clicked', self.cancel_clicked)
|
||||||
xml.get_widget('fup').connect('clicked', self.fup_clicked)
|
|
||||||
xml.get_widget('fdown').connect('clicked', self.fdown_clicked)
|
|
||||||
xml.get_widget('pup').connect('clicked', self.pup_clicked)
|
|
||||||
xml.get_widget('pdown').connect('clicked', self.pdown_clicked)
|
|
||||||
|
|
||||||
self.parent_list = self.person.get_parent_family_handle_list()
|
fup = xml.get_widget('fup')
|
||||||
self.family_list = self.person.get_family_handle_list()
|
fup.connect('clicked', self.fup_clicked)
|
||||||
|
fup.set_sensitive(fenable)
|
||||||
|
|
||||||
|
fdown = xml.get_widget('fdown')
|
||||||
|
fdown.connect('clicked', self.fdown_clicked)
|
||||||
|
fdown.set_sensitive(fenable)
|
||||||
|
|
||||||
|
pup = xml.get_widget('pup')
|
||||||
|
pup.connect('clicked', self.pup_clicked)
|
||||||
|
pup.set_sensitive(penable)
|
||||||
|
|
||||||
|
pdown = xml.get_widget('pdown')
|
||||||
|
pdown.connect('clicked', self.pdown_clicked)
|
||||||
|
pdown.set_sensitive(penable)
|
||||||
|
|
||||||
self.fill_data()
|
self.fill_data()
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
|
Loading…
Reference in New Issue
Block a user