From: <ben...@ug...> - 2007-01-26 23:04:28
|
Ok, I found why enter does not work on my system: the numlock is registered as a modify key. So I can only press enter in GRAMPS and have results when numlock is off :-( The following makes enter work in my system, and adds the bonus of adding the keypad enter as enter key. On my keyboard that enter is easier to find than the return: def key_press(self,obj,event): ret_key = gtk.gdk.keyval_from_name("Return") keypad_enter = gtk.gdk.keyval_from_name("KP_Enter") if (event.keyval == ret_key or event.keyval == keypad_enter) \ and (event.get_state() == 0 \ or event.get_state() == gtk.gdk.MOD2_MASK ) : self.edit(obj) return True return False So, my numlock is by X assigned to gtk.gdk.MOD2_MASK. From http://www.pygtk.org/docs/pygtk/gdk-constants.html#gdk-modifier-constants it is clear that this key cannot be CTRL or Shift, so it cannot be a problem to catch it generally. In attachment a patch which changes above in Pageview. However, this piece of code appears elsewhere too ... (eg find on filters) The patch also contains code to make on enter on parent node open the parent node, so edit only happens when enter is pressed on child. This is very handy: def edit(self, obj): store, paths = self.tree.get_selection().get_selected_rows() if paths and len(paths[0]) == 1 : self.tree.expand_row(paths[0], 0) return True else : self.edit_sel_person(obj) where the last method is the edit method of today. Finally, a question: in Pageview.py, class ListView has method key_press, but this looks identical to me as in parent class (which is what changes in the patch). I think it can be deleted. About the delete, I understand the concern. CTRL-Del is fine. We should just change doc, and I would vote for addition to the menu. The documentation in wiki-style would really be welcome to change small parts in the docs. Benny Quoting Alex Roitman <sh...@gr...>: > On Fri, 2007-01-26 at 15:56 +0100, ben...@ug... wrote: >> Anyway, concerning delete, I you hit delete, you get a pop-up asking if >> you are sure. Hardly any possibility of an error. > > Not true: you only get a pop-up if the object being deleted has > references from other objects. Otherwise there's no confirmation. > There's also no confirmation when deleting families from the list. > >> Should you still hit yes, you can undo it without problem. > > If there was no warning and the list is more than just a few > entries long, you may not even notice that you deleted something. > How would you know to Undo in that case? > >> The way I see it, there is little use for options only the developers know >> about. CTRL-Del is ok for me, but should then be advertised somehow, like by >> adding it to the delete option in the menu as 'Remove CTRL-DEL' (see eg >> firefox menu). > > Yes. On the other hand, it's better to have undocumented bindings > in 2.2.5 than not to have any :-) At least we can test them somewhat > and maybe revise and then document them in the next release. > > Alex > > -- > Alexander Roitman http://www.gramps-project.org > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. |