From aef12f25bfc4edfbe24a034768dd43981e3dcb47 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 31 Aug 2003 05:12:30 +0000 Subject: [PATCH] * src/gramps_main.py (load_selected_people): Only invoke Edit person dialog if the active person is selection in the current alpha- page; (change_alpha_page): Enable person-centered buttons only if the selection is visible in the current page; (build_people_context_menu): Enable Add bookmark and Edit/Remove only if the selection is visible in the current page. svn: r2068 --- gramps2/ChangeLog | 6 ++++++ gramps2/src/gramps_main.py | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 54d5e1626..109023f6b 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,12 @@ 2003-08-30 Alex Roitman * src/docgen/PdfDoc.py (page_break): Minor cleanup; (end_page): Was defined twice -- remove the first occurence. + * src/gramps_main.py (load_selected_people): Only invoke Edit person + dialog if the active person is selection in the current alpha- page; + (change_alpha_page): Enable person-centered buttons only if the + selection is visible in the current page; + (build_people_context_menu): Enable Add bookmark and Edit/Remove only + if the selection is visible in the current page. 2003-08-30 Don Allingham * src/docgen/PdfDoc.py: Support drawing functions. diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 8e8201504..473889c49 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -629,12 +629,16 @@ class Gramps: back_sensitivity = self.hindex > 0 fwd_sensitivity = self.hindex + 1 < len(self.history) - sel_sensitivity = 1 + mlist = self.person_tree.get_selected_objects() + if mlist: + sel_sensitivity = 1 + else: + sel_sensitivity = 0 entries = [ (gtk.STOCK_GO_BACK,self.back_clicked,back_sensitivity), (gtk.STOCK_GO_FORWARD,self.fwd_clicked,fwd_sensitivity), (gtk.STOCK_HOME,self.on_home_clicked,1), - (_("Add Bookmark"),self.on_add_bookmark_activate,1), + (_("Add Bookmark"),self.on_add_bookmark_activate,sel_sensitivity), (None,None,0), (gtk.STOCK_ADD, self.add_button_clicked,1), (gtk.STOCK_REMOVE, self.remove_button_clicked,sel_sensitivity), @@ -665,7 +669,12 @@ class Gramps: self.model_used[self.person_tree] = 1 self.apply_filter(self.person_tree) self.person_list.connect('button-press-event',self.on_plist_button_press) - + mlist = self.person_tree.get_selected_objects() + if mlist: + self.set_buttons(1) + else: + self.set_buttons(0) + def edit_button_clicked(self,obj): cpage = self.views.get_current_page() if cpage == PERSON_VIEW: @@ -1512,7 +1521,8 @@ class Gramps: def load_selected_people(self,obj): """Display the selected people in the EditPerson display""" - if self.active_person: + mlist = self.person_tree.get_selected_objects() + if mlist and self.active_person == self.db.getPerson(mlist[0]): self.load_person(self.active_person) def load_active_person(self,obj):