GNOME Bugzilla – Bug 616709
Pressing delete key while editing account name offers to delete account
Last modified: 2018-06-29 22:38:29 UTC
If, while editing the name of an account in the list of accounts by single-clicking on it, you press the delete key to delete a character, it offers to delete the account instead. The delete key should not perform this function while editing the account name.
Whoops, by "name" read "description".
I filed a bug against Fedora for what I imagine is the same problem: https://bugzilla.redhat.com/show_bug.cgi?id=603451
I can confirm this bug still exists in 2.3.14
2.4.11 - still the same :-(
I've researched it a little, and there are two relevant files: src/gnome/gnc-plugin-page-account-tree.c This is where the delete key is bound to the deletion of accounts src/gnome-utils/gnc-tree-view-account.c This is where the editing of cells is handled. I see two options from a conceptual point of view: 1. When editing a cell starts, unbind the delete key from EditDeleteAccountAction. When editing finishes, bind the delete key again. 2. When the deletion callback is called (gnc_plugin_page_account_tree_cmd_delete_account) check to see if any cells within that account are currently being edited. I think #1 is better, since it gives the responsibility to the cell. Not sure how to proceed though. I'm learning how to bind and unbind keys from actions.
I haven't studied the source files yet. However, here's my view on this: Whoever binds the delete key to the callback to delete an account should be responsible for blocking it when needed. I guess it's the treeview that does the binding. In that case the treeview should do the blocking and unblocking action. It can do this by listening for "editing-started", "editing-cancelled" and "edited" signals emitted by the Text Cell Renderers. (This means: it should register a callback that is called when each of these signals is emitted). On "editing-started", the delete-key-removes-account should be blocked, for the other two signals it should be enabled again. Instead of removing the delete key from EditDeleteAccountAction, you may simply disable the delete account action while a cell is being edited ?
Subscribing to this bug and confirming that it remains present in v2.6.6
Subscribing, too. Editing the chart of accounts is difficult due to this bug.
*** Bug 765221 has been marked as a duplicate of this bug. ***
I see the same problem in the Notes field of the COA in release 2.6.15 in Windows 7
Bug title should be corrected to match Comment 1
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
PR 252 Created with a possible fix. Bob
Bob's PR is merged into unstable, so this is fixed for the next major release (which we've decided to call 3.0 instead of 2.8.0).
*** Bug 792487 has been marked as a duplicate of this bug. ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=616709. Please update any external references or bookmarks.