* src/gramps_main.py (change_active_person): Cleanup with

enabling/disabling add/edit/remove buttons in different views upon the
active person change.


svn: r2041
This commit is contained in:
Alex Roitman 2003-08-25 05:03:36 +00:00
parent 666428c576
commit fb10339133
2 changed files with 12 additions and 10 deletions

View File

@ -16,6 +16,9 @@
build_child_menu, build_spouse_menu, build_parents_menu, build_child_menu, build_spouse_menu, build_parents_menu,
build_sp_parents_menu, edit_parents, edit_sp_parents): build_sp_parents_menu, edit_parents, edit_sp_parents):
Add navigation portion to all context menus. Add navigation portion to all context menus.
* src/gramps_main.py (change_active_person): Cleanup with
enabling/disabling add/edit/remove buttons in different views upon the
active person change.
2003-08-23 Don Allingham <dallingham@users.sourceforge.net> 2003-08-23 Don Allingham <dallingham@users.sourceforge.net>
* src/BaseDoc.py: New base clase for TextDoc/DrawDoc combination * src/BaseDoc.py: New base clase for TextDoc/DrawDoc combination

View File

@ -372,9 +372,7 @@ class Gramps:
self.source_view = SourceView.SourceView(self.db,self.gtop,self.update_display) self.source_view = SourceView.SourceView(self.db,self.gtop,self.update_display)
self.media_view = MediaView.MediaView(self.db,self.gtop,self.update_display) self.media_view = MediaView.MediaView(self.db,self.gtop,self.update_display)
self.addbtn = self.gtop.get_widget('addbtn') self.add_button = self.gtop.get_widget('addbtn')
self.removebtn = self.gtop.get_widget('removebtn')
self.editbtn = self.gtop.get_widget('editbtn')
self.backbtn = self.gtop.get_widget('back_btn') self.backbtn = self.gtop.get_widget('back_btn')
self.fwdbtn = self.gtop.get_widget('fwd_btn') self.fwdbtn = self.gtop.get_widget('fwd_btn')
self.back = self.gtop.get_widget('back') self.back = self.gtop.get_widget('back')
@ -685,9 +683,9 @@ class Gramps:
self.media_view.on_delete_clicked(obj) self.media_view.on_delete_clicked(obj)
def enable_buttons(self,val): def enable_buttons(self,val):
self.addbtn.set_sensitive(val) self.add_button.set_sensitive(val)
self.removebtn.set_sensitive(val) self.remove_button.set_sensitive(val)
self.editbtn.set_sensitive(val) self.edit_button.set_sensitive(val)
def row_changed(self,obj): def row_changed(self,obj):
mlist = self.person_tree.get_selected_objects() mlist = self.person_tree.get_selected_objects()
@ -1646,10 +1644,11 @@ class Gramps:
self.backbtn.set_sensitive(0) self.backbtn.set_sensitive(0)
self.back.set_sensitive(0) self.back.set_sensitive(0)
if person: if self.views.get_current_page == 1:
self.set_buttons(1) if person:
else: self.set_buttons(1)
self.set_buttons(0) else:
self.set_buttons(0)
def modify_statusbar(self): def modify_statusbar(self):