mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 08:27:13 +01:00
Use a hook to implement the shift-click shortcut to keyboard prefs...
This frees EIGHTEEN files from the big strongly connected component!!
They are:
Dependencies
Export
ExportCL
ExportFFmpeg
ExportFFmpegDialogs
ExportFLAC
EportMP2
ExportMP3
ExportOGG
ExportPCM
ExtImportPrefs
Import
ImportRaw
KeyConfigPrefs
KeyView
LibraryPrefs
PrefsDialog
SpectrumPrefs
... and that includes all of the remaining *Prefs files.
It does still leave the nine Export* files in a smaller s.c.c, which could be
broken with a registration system, as was done for import at commit e2cf1d9
This commit is contained in:
@@ -108,6 +108,10 @@ It handles initialization and termination by subclassing wxApp.
|
||||
#include "tracks/ui/Scrubbing.h"
|
||||
#include "widgets/FileHistory.h"
|
||||
|
||||
#ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS
|
||||
#include "../prefs/KeyConfigPrefs.h"
|
||||
#endif
|
||||
|
||||
//temporarily commented out till it is added to all projects
|
||||
//#include "Profiler.h"
|
||||
|
||||
@@ -1593,6 +1597,23 @@ bool AudacityApp::OnInit()
|
||||
mTimer.SetOwner(this, kAudacityAppTimerID);
|
||||
mTimer.Start(200);
|
||||
|
||||
#ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS
|
||||
CommandManager::SetMenuHook( [](const CommandID &id){
|
||||
if (::wxGetMouseState().ShiftDown()) {
|
||||
// Only want one page of the preferences
|
||||
PrefsDialog::Factories factories;
|
||||
factories.push_back(KeyConfigPrefsFactory( id ));
|
||||
auto pWindow = FindProjectFrame( GetActiveProject() );
|
||||
GlobalPrefsDialog dialog( pWindow, factories );
|
||||
dialog.ShowModal();
|
||||
MenuCreator::RebuildAllMenuBars();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
} );
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user