From 35f731f15ca8134ea28c102552b623a4669194be Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 8 Jan 2006 04:40:33 +0000 Subject: [PATCH] * src/PageView.py: support for ctrl-j for jump to person by gramps id * src/PersonView.py: support for ctrl-j for jump to person by gramps id svn: r5693 --- gramps2/ChangeLog | 2 ++ gramps2/src/PageView.py | 29 +++++++++++++++++++++++++++++ gramps2/src/PersonView.py | 3 +++ 3 files changed, 34 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index c996f7514..d1cf5d9bf 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-01-07 Don Allingham + * src/PageView.py: support for ctrl-j for jump to person by gramps id + * src/PersonView.py: support for ctrl-j for jump to person by gramps id * src/ToolTips.py: fix spacing * src/ViewManager.py: remember toolbar/sidebar status. * src/FamilyView.py: fix gtk.Table's bizzare way of handling empty diff --git a/gramps2/src/PageView.py b/gramps2/src/PageView.py index ed4544a48..7d51c83c5 100644 --- a/gramps2/src/PageView.py +++ b/gramps2/src/PageView.py @@ -199,6 +199,35 @@ class PersonNavView(PageView): if defperson: self.dbstate.change_active_person(defperson) + def jumpto(self,obj): + dialog = gtk.Dialog(_('Jump to by GRAMPS ID'),None, + gtk.DIALOG_NO_SEPARATOR) + dialog.set_border_width(12) + label = gtk.Label('%s' % _('Jump to by GRAMPS ID')) + label.set_use_markup(True) + dialog.vbox.add(label) + dialog.vbox.set_spacing(10) + dialog.vbox.set_border_width(12) + hbox = gtk.HBox() + hbox.pack_start(gtk.Label("%s: " % _('ID')),False) + text = gtk.Entry() + text.set_activates_default(True) + hbox.pack_start(text,False) + dialog.vbox.pack_start(hbox,False) + dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, + gtk.STOCK_JUMP_TO, gtk.RESPONSE_OK) + dialog.set_default_response(gtk.RESPONSE_OK) + dialog.vbox.show_all() + + if dialog.run() == gtk.RESPONSE_OK: + gid = text.get_text() + person = self.dbstate.db.get_person_from_gramps_id(gid) + if person: + self.dbstate.change_active_person(person) + else: + self.uistate.push_message(_("Error: %s is not a valid GRAMPS ID") % gid) + dialog.destroy() + def fwd_clicked(self,obj,step=1): hobj = self.uistate.phistory hobj.lock = True diff --git a/gramps2/src/PersonView.py b/gramps2/src/PersonView.py index 5cb41be3c..212b82164 100644 --- a/gramps2/src/PersonView.py +++ b/gramps2/src/PersonView.py @@ -102,6 +102,8 @@ class PersonView(PageView.PersonNavView): callback=self.edit) self.add_action('Remove', gtk.STOCK_REMOVE, "_Remove", callback=self.remove) + self.add_action('Jump', None, "_Jump", + accel="j",callback=self.jumpto) self.add_toggle_action('Filter', None, '_Filter', None, None, self.filter_toggle) @@ -179,6 +181,7 @@ class PersonView(PageView.PersonNavView): associated with the interface. """ return ''' +