Hotkeys Editor should have a reset button

Bug #1395442 reported by Frode Lillerud
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Wishlist
Jan Dolezal

Bug Description

In the PcbNew->Preferences->Hotkeys Editor dialog there should be a way to revert back to the original setup. Currently you can only undo your last actions, but not return to the default hotkey setup.

There should be a button called 'Reset to default' which removes all your changes, and changes back to the original setup you get with a new KiCad installation.

Using build: (2014-10-27 BZR 5228)-product on Windows.

Tags: hotkey
Revision history for this message
Nick Østergaard (nickoe) wrote :

I retract my previous comment, there does indeed not seem to exist an option to reset the keybindings. I remembered wrong. An option to reset would indeed be good.

Changed in kicad:
importance: Undecided → Wishlist
tags: added: hotkey
tags: added: looks-easy
Jan Dolezal (dolezj21)
Changed in kicad:
assignee: nobody → Jan Dolezal (dolezj21)
Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Jan - I'm the guy who did the recent hotkeys editor rework. I looked into implementing this, and it's a lot harder than it looks -- was still considering doing it, but... Good luck, and feel free to ask me about the hotkeys code.

tags: removed: looks-easy
Revision history for this message
Jan Dolezal (dolezj21) wrote :

Chris thank you,
I prepared a solution and it would be great if you (and possibly others) could review it and tell me if this is acceptable way of implementing this feature. I would appreciate hints.

The commits are available in my fork on github:
https://github.com/dolezaljan/kicad-source-mirror/commits

If it looks good to you I will send patches to the mailing list.

Also in the description of this "bug" is that the button should be called 'Reset to default' which seemed a little bit long to me, so I used label 'Defaults' instead.

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

I don't mind it. The list isn't pretty, but I can't really think of a _better_ way to do it, so...

It'd be nice if we had a way to make sure no hotkeys were omitted from the list. Would you be willing to add a debug-mode test-and-assert to the hotkeys editor to check that every hotkey in the list also appears in default_values_Hotkey_List? It'd be nice to detect a mistake there early.

With that change, I'd be more than willing to commit it. I've been meaning to do a bit more work on this bit for quite a while but haven't had time, nice to have a helper. :)

Changed in kicad:
status: New → In Progress
Revision history for this message
jean-pierre charras (jp-charras) wrote :

I am not especially thrilled by a double list approach.

The EDA_HOTKEY class can easily store a copy of the default key in a private member by its constructor and have a method to reset the actual key to the default.

Il just needs a new member and a few lines of code to do that, and avoids a double list (a double list is never a good approach).

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Okay, yes - I second this, that is definitely a better way to do it.

Revision history for this message
Jan Dolezal (dolezj21) wrote :

Thank you Jean-Pierre,
I made changes you proposed and I think it looks much better now.

Changed in kicad:
status: In Progress → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.