mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 08:27:13 +01:00
Bug 2329 - Keyboard shortcuts: new or changed defaults can create duplicates
Problem: If a new version of Audacity introduces a new default shortcut, or changes an existing one, then this may be the same shortcut as a user has previously assigned to another command. Both commands will have the same shortcut, and the shortcut will only execute one of those commands. Fix: Check for any such duplicates when a user opens a version of audacity using an audacity.cfg file which was created with a different version. For each duplicate found, remove the shortcut from the command which has a new or changed default. If duplicates where found, open a message box informing the user of the removed shortcuts.
This commit is contained in:
@@ -1587,6 +1587,13 @@ bool AudacityApp::OnInit()
|
||||
|
||||
// Bug1561: delay the recovery dialog, to avoid crashes.
|
||||
CallAfter( [=] () mutable {
|
||||
// Remove duplicate shortcuts when there's a change of version
|
||||
int vMajorInit, vMinorInit, vMicroInit;
|
||||
gPrefs->GetVersionKeysInit(vMajorInit, vMinorInit, vMicroInit);
|
||||
if (vMajorInit != AUDACITY_VERSION || vMinorInit != AUDACITY_RELEASE
|
||||
|| vMicroInit != AUDACITY_REVISION) {
|
||||
CommandManager::Get(*project).RemoveDuplicateShortcuts();
|
||||
}
|
||||
//
|
||||
// Auto-recovery
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user