From c6bfc584f1468fe8e94d58bdb0279dedc15533e1 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 17 Jan 2008 09:14:40 +0000 Subject: [PATCH] 2008-01-17 Benny Malengier * src/DataViews/PersonView.py: issue 1451, double click to expand nodes svn: r9861 --- ChangeLog | 3 +++ src/DataViews/PersonView.py | 25 ++++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30c561b29..84ba62ff9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2008-01-17 Benny Malengier + * src/DataViews/PersonView.py: issue 1451, double click to expand nodes + 2008-01-13 Jerome Rapinat * src/plugins/NarrativeWeb.py: make Filter translatable 0001490: Cannot translate few 'filter' labels diff --git a/src/DataViews/PersonView.py b/src/DataViews/PersonView.py index 27bf23eb6..a66f658c7 100644 --- a/src/DataViews/PersonView.py +++ b/src/DataViews/PersonView.py @@ -832,6 +832,9 @@ class PersonView(PageView.PersonNavView): except Errors.WindowActiveError: pass return True + else: + #press on a parent node + return self.expand_collapse() elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3: @@ -871,13 +874,21 @@ class PersonView(PageView.PersonNavView): self.edit(obj) return True else: - store, paths = self.selection.get_selected_rows() - if paths and len(paths[0]) == 1 : - if self.tree.row_expanded(paths[0]): - self.tree.collapse_row(paths[0]) - else: - self.tree.expand_row(paths[0], 0) - return True + return self.expand_collapse() + return False + + def expand_collapse(self): + """ + Expand or collapse the selected parent name node. + Return True if change done, False otherwise + """ + store, paths = self.selection.get_selected_rows() + if paths and len(paths[0]) == 1 : + if self.tree.row_expanded(paths[0]): + self.tree.collapse_row(paths[0]) + else: + self.tree.expand_row(paths[0], 0) + return True return False def key_goto_home_person(self):