Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
KeyConfigPrefs Class Referencefinal

A PrefsPanel for keybindings. More...

#include <KeyConfigPrefs.h>

Inheritance diagram for KeyConfigPrefs:
[legend]
Collaboration diagram for KeyConfigPrefs:
[legend]

Public Member Functions

 KeyConfigPrefs (wxWindow *parent, wxWindowID winid, AudacityProject *pProject, const CommandID &name)
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
bool Commit () override
 
void Cancel () override
 
ManualPageID HelpPageName () override
 If not empty string, the Help button is added below the panel. More...
 
void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool Commit ()=0
 
virtual PluginPath GetPath () const override
 
virtual VendorSymbol GetVendor () const override
 
virtual wxString GetVersion () const override
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual ManualPageID HelpPageName ()
 If not empty string, the Help button is added below the panel. More...
 
virtual void Cancel ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void Populate ()
 
void RefreshBindings (bool bSort)
 
void RefreshKeyInfo ()
 
void ClearAllKeys ()
 
bool ContainsIllegalDups (TranslatableString &fMatching, TranslatableString &sMatching) const
 
TranslatableString MergeWithExistingKeys (const std::vector< NormalizedKeyString > &toAdd)
 
void FilterKeys (std::vector< NormalizedKeyString > &arr)
 
CommandID NameFromKey (const NormalizedKeyString &key)
 
void SetKeyForSelected (const NormalizedKeyString &key)
 
void OnShow (wxShowEvent &e)
 
void OnViewBy (wxCommandEvent &e)
 
void OnDefaults (wxCommandEvent &e)
 
void OnImportDefaults (wxCommandEvent &e)
 
void OnImport (wxCommandEvent &e)
 
void OnExport (wxCommandEvent &e)
 
void OnSet (wxCommandEvent &e)
 
void OnClear (wxCommandEvent &e)
 
void OnSelected (wxCommandEvent &e)
 
void OnHotkeyKeyDown (wxKeyEvent &e)
 
void OnHotkeyChar (wxEvent &e)
 
void OnHotkeyKillFocus (wxEvent &e)
 
void OnHotkeyContext (wxEvent &e)
 
void OnFilterTimer (wxTimerEvent &e)
 
void OnFilterKeyDown (wxKeyEvent &e)
 
void OnFilterChar (wxEvent &e)
 

Private Attributes

KeyViewmView
 
wxTextCtrl * mKey
 
wxButton * mSet
 
wxButton * mClear
 
wxTextCtrl * mFilter
 
wxStaticText * mFilterLabel
 
wxTimer mFilterTimer
 
bool mFilterPending
 
ViewByType mViewType
 
wxRadioButton * mViewByTree
 
wxRadioButton * mViewByName
 
wxRadioButton * mViewByKey
 
AudacityProjectmProject {}
 
CommandManagermManager
 
int mCommandSelected
 
CommandIDs mNames
 
std::vector< NormalizedKeyStringmDefaultKeys
 
std::vector< NormalizedKeyStringmStandardDefaultKeys
 
std::vector< NormalizedKeyStringmKeys
 
std::vector< NormalizedKeyStringmNewKeys
 

Additional Inherited Members

- Public Types inherited from PrefsPanel
using Factories = std::vector< PrefsPanel::PrefsNode >
 
using Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) >
 
- Static Public Member Functions inherited from PrefsPanel
static FactoriesDefaultFactories ()
 

Detailed Description

A PrefsPanel for keybindings.

The code for displaying keybindings is similar to code in MousePrefs. It would be nice to create a NEW 'Bindings' class which both KeyConfigPrefs and MousePrefs use.

Definition at line 32 of file KeyConfigPrefs.h.

Constructor & Destructor Documentation

◆ KeyConfigPrefs()

KeyConfigPrefs::KeyConfigPrefs ( wxWindow *  parent,
wxWindowID  winid,
AudacityProject pProject,
const CommandID name 
)

Definition at line 88 of file KeyConfigPrefs.cpp.

91: PrefsPanel(parent, winid, XO("Shortcuts")),
92 mView(NULL),
93 mKey(NULL),
94 mFilter(NULL),
96 mFilterPending(false)
97 , mProject{ pProject }
98{
99 Populate();
100 if (!name.empty()) {
101 auto index = mView->GetIndexByName(name);
102 mView->SelectNode(index);
103 }
104
105 // See bug #2315 for discussion. This should be reviewed
106 // and (possibly) removed after wx3.1.3.
107 Bind(wxEVT_SHOW, &KeyConfigPrefs::OnShow, this);
108}
const TranslatableString name
Definition: Distortion.cpp:76
XO("Cut/Copy/Paste")
#define FilterTimerID
wxTextCtrl * mKey
AudacityProject * mProject
KeyView * mView
wxTextCtrl * mFilter
wxTimer mFilterTimer
void OnShow(wxShowEvent &e)
int GetIndexByName(const CommandID &name) const
Definition: KeyView.cpp:246
void SelectNode(int index)
Definition: KeyView.cpp:1105
PrefsPanel(wxWindow *parent, wxWindowID winid, const TranslatableString &title)
Definition: PrefsPanel.h:94

Member Function Documentation

◆ Cancel()

void KeyConfigPrefs::Cancel ( )
overridevirtual

Reimplemented from PrefsPanel.

Definition at line 926 of file KeyConfigPrefs.cpp.

927{
928 // Restore original key values
929 for (size_t i = 0; i < mNames.size(); i++) {
931 }
932
933 return;
934}
void SetKeyFromIndex(int i, const NormalizedKeyString &key)
CommandManager * mManager
std::vector< NormalizedKeyString > mKeys
CommandIDs mNames

References mKeys, mManager, mNames, and CommandManager::SetKeyFromIndex().

Here is the call graph for this function:

◆ ClearAllKeys()

void KeyConfigPrefs::ClearAllKeys ( )
private

Definition at line 369 of file KeyConfigPrefs.cpp.

370{
371 const NormalizedKeyString noKey{ NO_SHORTCUT };
372 for (const auto & command : mNames)
373 mManager->SetKeyFromName(command, noKey);
374}
#define NO_SHORTCUT
void SetKeyFromName(const CommandID &name, const NormalizedKeyString &key)

References mManager, mNames, NO_SHORTCUT, and CommandManager::SetKeyFromName().

Referenced by OnImport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Commit()

bool KeyConfigPrefs::Commit ( )
overridevirtual

Implements PrefsPanel.

Definition at line 887 of file KeyConfigPrefs.cpp.

888{
889 // On the Mac, preferences may be changed without any active
890 // projects. This means that the CommandManager isn't available
891 // either. So we can't attempt to save preferences, otherwise
892 // NULL ptr dereferences will happen in ShuttleGui because the
893 // radio buttons are never created. (See Populate() above.)
894 if ( !mProject ) {
895 return true;
896 }
897
900
901 bool bFull = gPrefs->ReadBool(wxT("/GUI/Shortcuts/FullDefaults"), false);
902 for (size_t i = 0; i < mNames.size(); i++) {
903 const auto &dkey = bFull ? mDefaultKeys[i] : mStandardDefaultKeys[i];
904 // using GET to interpret CommandID as a config path component
905 auto name = wxT("/NewKeys/") + mNames[i].GET();
906 const auto &key = mNewKeys[i];
907
908 if (gPrefs->HasEntry(name)) {
910 gPrefs->Write(name, key);
911 }
912 if (key == dkey) {
914 }
915 }
916 else {
917 if (key != dkey) {
918 gPrefs->Write(name, key);
919 }
920 }
921 }
922
923 return gPrefs->Flush();
924}
wxT("CloseDown"))
static const AudacityProject::AttachedObjects::RegisteredFactory key
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
void PopulateOrExchange(ShuttleGui &S) override
std::vector< NormalizedKeyString > mDefaultKeys
std::vector< NormalizedKeyString > mStandardDefaultKeys
std::vector< NormalizedKeyString > mNewKeys
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
T ReadObject(const wxString &key, const T &defaultValue) const
virtual bool Flush() noexcept=0
virtual bool HasEntry(const wxString &key) const =0
Checks whether specified key exists within the current group.
virtual bool Write(const wxString &key, bool value)=0
bool ReadBool(const wxString &key, bool defaultValue) const
bool DeleteEntry(const wxString &key)
Deletes specified entry if exists.

References audacity::BasicSettings::DeleteEntry(), eIsSavingToPrefs, audacity::BasicSettings::Flush(), gPrefs, audacity::BasicSettings::HasEntry(), key, mDefaultKeys, mNames, mNewKeys, mProject, mStandardDefaultKeys, name, PopulateOrExchange(), audacity::BasicSettings::ReadBool(), audacity::BasicSettings::ReadObject(), S, audacity::BasicSettings::Write(), and wxT().

Here is the call graph for this function:

◆ ContainsIllegalDups()

bool KeyConfigPrefs::ContainsIllegalDups ( TranslatableString fMatching,
TranslatableString sMatching 
) const
private

Definition at line 381 of file KeyConfigPrefs.cpp.

383{
384 using IndexesArray = std::vector<int>;
385 std::unordered_map<NormalizedKeyString, IndexesArray> seen;
386
387 for (size_t i{ 0 }; i < mKeys.size(); i++)
388 {
389 if (mKeys[i] == EMPTY_SHORTCUT || mKeys[i] == NO_SHORTCUT)
390 continue;
391
392 if (seen.count(mKeys[i]) == 0)
393 seen.insert({ mKeys[i], {(int)i} });
394 else
395 {
396 IndexesArray checkMe{ seen.at(mKeys[i]) };
397 for (int index : checkMe)
398 {
399 if (mDefaultKeys[i] == EMPTY_SHORTCUT ||
400 mDefaultKeys[i] != mDefaultKeys[index])
401 {
403 sMatching = mManager->GetPrefixedLabelFromName(mNames[index]);
404 return true;
405 }
406 else
407 seen.at(mKeys[i]).push_back(index);
408 }
409 }
410 }
411 return false;
412}
#define EMPTY_SHORTCUT
TranslatableString GetPrefixedLabelFromName(const CommandID &name) const

References EMPTY_SHORTCUT, CommandManager::GetPrefixedLabelFromName(), mDefaultKeys, mKeys, mManager, mNames, and NO_SHORTCUT.

Referenced by OnImport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FilterKeys()

void KeyConfigPrefs::FilterKeys ( std::vector< NormalizedKeyString > &  arr)
private

Definition at line 603 of file KeyConfigPrefs.cpp.

604{
605 const auto &MaxListOnly = CommandManager::ExcludedList();
606
607 // Remove items that are in MaxList.
608 for (size_t i = 0; i < arr.size(); i++) {
609 if( std::binary_search(MaxListOnly.begin(), MaxListOnly.end(), arr[i]) )
610 arr[i] = {};
611 }
612}
static const std::vector< NormalizedKeyString > & ExcludedList()

References CommandManager::ExcludedList().

Referenced by OnImportDefaults(), and RefreshBindings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDescription()

TranslatableString KeyConfigPrefs::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 115 of file KeyConfigPrefs.cpp.

116{
117 return XO("Preferences for KeyConfig");
118}

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol KeyConfigPrefs::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 110 of file KeyConfigPrefs.cpp.

111{
113}
#define KEY_CONFIG_PREFS_PLUGIN_SYMBOL

References KEY_CONFIG_PREFS_PLUGIN_SYMBOL.

◆ HelpPageName()

ManualPageID KeyConfigPrefs::HelpPageName ( )
overridevirtual

If not empty string, the Help button is added below the panel.

Default returns empty string.

Reimplemented from PrefsPanel.

Definition at line 120 of file KeyConfigPrefs.cpp.

121{
122 return "Keyboard_Preferences";
123}

◆ MergeWithExistingKeys()

TranslatableString KeyConfigPrefs::MergeWithExistingKeys ( const std::vector< NormalizedKeyString > &  toAdd)
private

Definition at line 421 of file KeyConfigPrefs.cpp.

423{
424 TranslatableString disabledShortcuts;
425
426 auto searchAddInKeys = [&](size_t index)
427 {
428 for (size_t k{ 0 }; k < toAdd.size(); k++)
429 if (k == index)
430 continue;
431 else if (toAdd[index] == mKeys[k] &&
433 mDefaultKeys[k] != mDefaultKeys[index]))
434 return (int)k;
435
436 return -1;
437 };
438
439 const NormalizedKeyString noKey{ EMPTY_SHORTCUT };
440
441 for (size_t i{ 0 }; i < toAdd.size(); i++)
442 {
443 if (mKeys[i] != NO_SHORTCUT)
444 continue;
445 else if (toAdd[i] == EMPTY_SHORTCUT)
446 mManager->SetKeyFromIndex(i, noKey);
447 else
448 {
449 int sRes{ searchAddInKeys(i) };
450
451 if (sRes == -1)
452 mManager->SetKeyFromIndex(i, toAdd[i]);
453 else
454 {
456
457 disabledShortcuts +=
458 XO(
459"\n * \"%s\" (because the shortcut \'%s\' is used by \"%s\")\n")
460 .Format(
462 name,
464
465 mManager->SetKeyFromIndex(i, noKey);
466 }
467 }
468 }
469
470 return disabledShortcuts;
471}
NormalizedKeyString GetKeyFromName(const CommandID &name) const
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
Holds a msgid for the translation catalog; may also bind format arguments.

References EMPTY_SHORTCUT, Identifier::GET(), CommandManager::GetKeyFromName(), CommandManager::GetPrefixedLabelFromName(), mDefaultKeys, mKeys, mManager, mNames, name, NO_SHORTCUT, CommandManager::SetKeyFromIndex(), and XO().

Referenced by OnImport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NameFromKey()

CommandID KeyConfigPrefs::NameFromKey ( const NormalizedKeyString key)
private

Definition at line 733 of file KeyConfigPrefs.cpp.

734{
735 return mView->GetNameByKey(key);
736}
CommandID GetNameByKey(const NormalizedKeyString &key) const
Definition: KeyView.cpp:282

References KeyView::GetNameByKey(), key, and mView.

Here is the call graph for this function:

◆ OnClear()

void KeyConfigPrefs::OnClear ( wxCommandEvent &  e)
private

Definition at line 837 of file KeyConfigPrefs.cpp.

838{
839 mKey->Clear();
840
841 if (mCommandSelected != wxNOT_FOUND) {
843 }
844}
void SetKeyForSelected(const NormalizedKeyString &key)

References mCommandSelected, mKey, and SetKeyForSelected().

Here is the call graph for this function:

◆ OnDefaults()

void KeyConfigPrefs::OnDefaults ( wxCommandEvent &  e)
private

Definition at line 594 of file KeyConfigPrefs.cpp.

595{
596 wxMenu Menu;
597 Menu.Append( 1, _("Standard") );
598 Menu.Append( 2, _("Full") );
599 Menu.Bind( wxEVT_COMMAND_MENU_SELECTED, &KeyConfigPrefs::OnImportDefaults, this );
601}
#define _(s)
Definition: Internat.h:73
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
Definition: BasicMenu.cpp:209
void OnImportDefaults(wxCommandEvent &e)
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
Definition: MenuRegistry.h:445
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.

References _, MenuRegistry::Menu, OnImportDefaults(), and BasicMenu::Handle::Popup().

Here is the call graph for this function:

◆ OnExport()

void KeyConfigPrefs::OnExport ( wxCommandEvent &  e)
private

Definition at line 566 of file KeyConfigPrefs.cpp.

567{
568 wxString file = wxT("Audacity-keys.xml");
569
570 file = SelectFile(FileNames::Operation::Export,
571 XO("Export Keyboard Shortcuts As:"),
572 wxEmptyString,
573 file,
574 wxT("xml"),
576 wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
577 this);
578
579 if (!file) {
580 return;
581 }
582
583 GuardedCall( [&] {
584 XMLFileWriter prefFile{ file, XO("Error Exporting Keyboard Shortcuts") };
585 mManager->WriteXML(prefFile);
586 prefFile.Commit();
587 } );
588}
R GuardedCall(const F1 &body, const F2 &handler=F2::Default(), F3 delayedHandler=DefaultDelayedHandlerAction) noexcept(noexcept(handler(std::declval< AudacityException * >())) &&noexcept(handler(nullptr)) &&noexcept(std::function< void(AudacityException *)>{std::move(delayedHandler)}))
Execute some code on any thread; catch any AudacityException; enqueue error report on the main thread...
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
void WriteXML(XMLWriter &xmlFile) const
FILES_API const FileType XMLFiles
Definition: FileNames.h:73
FILES_API const FileType AllFiles
Definition: FileNames.h:70
Wrapper to output XML data to files.
Definition: XMLWriter.h:84

References FileNames::AllFiles, GuardedCall(), mManager, SelectFile(), CommandManager::WriteXML(), wxT(), FileNames::XMLFiles, and XO().

Here is the call graph for this function:

◆ OnFilterChar()

void KeyConfigPrefs::OnFilterChar ( wxEvent &  e)
private

Definition at line 723 of file KeyConfigPrefs.cpp.

724{
725 if (mViewType != ViewByKey)
726 {
727 e.Skip();
728 }
729}
@ ViewByKey
Definition: KeyView.h:64
ViewByType mViewType

References mViewType, and ViewByKey.

Referenced by PopulateOrExchange().

Here is the caller graph for this function:

◆ OnFilterKeyDown()

void KeyConfigPrefs::OnFilterKeyDown ( wxKeyEvent &  e)
private

Definition at line 681 of file KeyConfigPrefs.cpp.

682{
683 wxTextCtrl *t = (wxTextCtrl *)e.GetEventObject();
684 int keycode = e.GetKeyCode();
685
686 // Make sure we can navigate away from the hotkey textctrl.
687 // On Linux and OSX, it an get stuck, but it doesn't hurt
688 // to do it for Windows as well.
689 if (keycode == WXK_TAB) {
690 wxNavigationKeyEvent nevent;
691 nevent.SetWindowChange(e.ControlDown());
692 nevent.SetDirection(!e.ShiftDown());
693 nevent.SetEventObject(t);
694 nevent.SetCurrentFocus(t);
695 t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
696
697 return;
698 }
699
700 if (mViewType == ViewByKey) {
701 wxString key = KeyEventToKeyString(e).Display();
702 t->SetValue(key);
703
704 if (!key.empty()) {
705 mView->SetFilter(t->GetValue());
706 }
707 }
708 else
709 {
710 if (keycode == WXK_RETURN) {
711 mFilterPending = false;
712 mView->SetFilter(t->GetValue());
713 }
714 else {
715 mFilterPending = true;
716 mFilterTimer.Start(500, wxTIMER_ONE_SHOT);
717
718 e.Skip();
719 }
720 }
721}
NormalizedKeyString KeyEventToKeyString(const wxKeyEvent &event)
void SetFilter(const wxString &filter)
Definition: KeyView.cpp:472
wxString Display(bool usesSpecialChars=false) const
Definition: Keyboard.cpp:56

References NormalizedKeyString::Display(), key, KeyEventToKeyString(), mFilterPending, mFilterTimer, mView, mViewType, KeyView::SetFilter(), and ViewByKey.

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFilterTimer()

void KeyConfigPrefs::OnFilterTimer ( wxTimerEvent &  e)
private

Definition at line 671 of file KeyConfigPrefs.cpp.

672{
673 // The filter timer has expired, so set the filter
674 if (mFilterPending)
675 {
676 // Do not reset mFilterPending here...possible race
677 mView->SetFilter(mFilter->GetValue());
678 }
679}

References mFilter, mFilterPending, mView, and KeyView::SetFilter().

Here is the call graph for this function:

◆ OnHotkeyChar()

void KeyConfigPrefs::OnHotkeyChar ( wxEvent &  e)
private

Definition at line 652 of file KeyConfigPrefs.cpp.

653{
654 // event.Skip() not performed, so event will not be processed further.
655}

Referenced by PopulateOrExchange().

Here is the caller graph for this function:

◆ OnHotkeyContext()

void KeyConfigPrefs::OnHotkeyContext ( wxEvent &  e)
private

Definition at line 666 of file KeyConfigPrefs.cpp.

667{
668 // event.Skip() not performed, so event will not be processed further.
669}

Referenced by PopulateOrExchange().

Here is the caller graph for this function:

◆ OnHotkeyKeyDown()

void KeyConfigPrefs::OnHotkeyKeyDown ( wxKeyEvent &  e)
private

Definition at line 630 of file KeyConfigPrefs.cpp.

631{
632 wxTextCtrl *t = (wxTextCtrl *)e.GetEventObject();
633
634 // Make sure we can navigate away from the hotkey textctrl.
635 // On Linux and OSX, it can get stuck, but it doesn't hurt
636 // to do it for Windows as well.
637 //
638 // Mac note: Don't waste time trying to figure out why the
639 // focus goes back to the prefs tree. Unless Voiceover is
640 // active, buttons on the Mac do not accept focus and all the
641 // controls between this one and the tree control are buttons.
642 if (e.GetKeyCode() == WXK_TAB) {
643 t->Navigate(e.ShiftDown()
644 ? wxNavigationKeyEvent::IsBackward
645 : wxNavigationKeyEvent::IsForward);
646 return;
647 }
648
649 t->SetValue(KeyEventToKeyString(e).Display());
650}

References NormalizedKeyString::Display(), and KeyEventToKeyString().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnHotkeyKillFocus()

void KeyConfigPrefs::OnHotkeyKillFocus ( wxEvent &  e)
private

Definition at line 657 of file KeyConfigPrefs.cpp.

658{
659 if (mKey->GetValue().empty() && mCommandSelected != wxNOT_FOUND) {
660 mKey->AppendText(mView->GetKey(mCommandSelected).Display());
661 }
662
663 e.Skip();
664}
NormalizedKeyString GetKey(int index) const
Definition: KeyView.cpp:322

References NormalizedKeyString::Display(), KeyView::GetKey(), mCommandSelected, mKey, and mView.

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnImport()

void KeyConfigPrefs::OnImport ( wxCommandEvent &  e)
private

Definition at line 487 of file KeyConfigPrefs.cpp.

488{
489 wxString file = wxT("Audacity-keys.xml");
490
491 file = SelectFile(FileNames::Operation::Open,
492 XO("Select an XML file containing Audacity keyboard shortcuts..."),
493 wxEmptyString,
494 file,
495 wxT(""),
497 wxRESIZE_BORDER,
498 this);
499
500 if (!file) {
501 return;
502 }
503
504 // this RefreshKeyInfo is here to account for
505 // potential OnSet() function executions before importing
507
508 // saving pre-import settings
509 const std::vector<NormalizedKeyString> oldKeys{ mKeys };
510
511 // clearing all pre-import settings
512 ClearAllKeys();
513
514 // getting new settings
515 XMLFileReader reader;
516 if (!reader.Parse(mManager, file)) {
518 reader.GetErrorStr(),
519 XO("Error Importing Keyboard Shortcuts"),
520 wxOK | wxCENTRE,
521 this);
522 }
523
525
526 // checking new setting for duplicates
527 // if there are duplicates, throwing error and returning to pre-import state
528 TranslatableString fMatching;
529 TranslatableString sMatching;
530
531 if (ContainsIllegalDups(fMatching, sMatching))
532 {
533 // restore the old pre-import hotkeys stored in oldKeys
534 for (size_t k{ 0 }; k < mNames.size(); k++)
535 mManager->SetKeyFromName(mNames[k], oldKeys[k]);
536 mKeys = oldKeys;
537
538 // output an error message
540 XO(
541"The file with the shortcuts contains illegal shortcut duplicates for \"%s\" and \"%s\".\nNothing is imported.")
542 .Format( fMatching, sMatching ),
543 XO("Error Importing Keyboard Shortcuts"),
544 wxICON_ERROR | wxCENTRE, this);
545
546 // stop the function
547 return;
548 }
549
550 // adding possible old settings to the new settings and recording the conflicting ones
551 TranslatableString disabledShortcuts{ MergeWithExistingKeys(oldKeys) };
552
553 RefreshBindings(true);
554
555 TranslatableString message{
556 XO("Loaded %d keyboard shortcuts\n").Format(mManager->GetNumberOfKeysRead()) };
557
558 if (disabledShortcuts.Translation() != (""))
559 message += XO("\nThe following commands are not mentioned in the imported file, "
560 "but have their shortcuts removed because of the conflict with other new shortcuts:\n") +
561 disabledShortcuts;
562
563 AudacityMessageBox(message, XO("Loading Keyboard Shortcuts"), wxOK | wxCENTRE);
564}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
int GetNumberOfKeysRead() const
Abstract base class used in importing a file.
TranslatableString MergeWithExistingKeys(const std::vector< NormalizedKeyString > &toAdd)
bool ContainsIllegalDups(TranslatableString &fMatching, TranslatableString &sMatching) const
void RefreshBindings(bool bSort)
Reads a file and passes the results through an XMLTagHandler.
Definition: XMLFileReader.h:19
const TranslatableString & GetErrorStr() const
bool Parse(XMLTagHandler *baseHandler, const FilePath &fname)

References FileNames::AllFiles, AudacityMessageBox(), ClearAllKeys(), ContainsIllegalDups(), XMLFileReader::GetErrorStr(), CommandManager::GetNumberOfKeysRead(), MergeWithExistingKeys(), mKeys, mManager, mNames, XMLFileReader::Parse(), RefreshBindings(), RefreshKeyInfo(), SelectFile(), CommandManager::SetKeyFromName(), wxT(), FileNames::XMLFiles, and XO().

Here is the call graph for this function:

◆ OnImportDefaults()

void KeyConfigPrefs::OnImportDefaults ( wxCommandEvent &  e)
private

Definition at line 614 of file KeyConfigPrefs.cpp.

615{
616 gPrefs->DeleteEntry(wxT("/GUI/Shortcuts/FullDefaults"));
617 gPrefs->Flush();
618
620 if( event.GetId() == 1 )
622
623 for (size_t i = 0; i < mNewKeys.size(); i++) {
625 }
626
627 RefreshBindings(true);
628}
void FilterKeys(std::vector< NormalizedKeyString > &arr)

References audacity::BasicSettings::DeleteEntry(), FilterKeys(), audacity::BasicSettings::Flush(), gPrefs, mDefaultKeys, mManager, mNewKeys, RefreshBindings(), CommandManager::SetKeyFromIndex(), and wxT().

Referenced by OnDefaults().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSelected()

void KeyConfigPrefs::OnSelected ( wxCommandEvent &  e)
private

Definition at line 846 of file KeyConfigPrefs.cpp.

847{
849 mKey->Clear();
850
851 if (mCommandSelected != wxNOT_FOUND) {
852 bool canset = mView->CanSetKey(mCommandSelected);
853 if (canset) {
854 mKey->AppendText(mView->GetKey(mCommandSelected).Display());
855 }
856
857 mKey->Enable(canset);
858 mSet->Enable(canset);
859 mClear->Enable(canset);
860 }
861}
wxButton * mClear
wxButton * mSet
bool CanSetKey(int index) const
Definition: KeyView.cpp:338
int GetSelected() const
Definition: KeyView.cpp:185

References KeyView::CanSetKey(), NormalizedKeyString::Display(), KeyView::GetKey(), KeyView::GetSelected(), mClear, mCommandSelected, mKey, mSet, and mView.

Here is the call graph for this function:

◆ OnSet()

void KeyConfigPrefs::OnSet ( wxCommandEvent &  e)
private

Definition at line 760 of file KeyConfigPrefs.cpp.

761{
762 if (mCommandSelected == wxNOT_FOUND) {
764 XO("You must select a binding before assigning a shortcut"),
765 XO("Error"),
766 wxICON_WARNING | wxCENTRE,
767 this);
768 return;
769 }
770
771 CommandID newCommand{ mView->GetName(mCommandSelected) };
772 NormalizedKeyString enteredKey{ mKey->GetValue() };
773 NormalizedKeyString newComDefaultKey{
774 mManager->GetDefaultKeyFromName(newCommand) };
775 CommandIDs oldCommands;
776
777 // collecting commands competing for the same shortcut
778 for (size_t i{ 0 }; i < mNames.size(); i++)
779 {
780 if (mNewKeys[i] == enteredKey)
781 {
782 // ignore the Set button if the same shortcut is used
783 if (mNames[i] == newCommand)
784 return;
785
786 if (newComDefaultKey == EMPTY_SHORTCUT ||
787 mDefaultKeys[i] != newComDefaultKey)
788 {
789 oldCommands.push_back(mNames[i]);
790 }
791 }
792 }
793
794 // Prevent same hotkey combination being used twice.
795 if (!oldCommands.empty()) {
796 auto newlabel = Verbatim( wxT("'%s - %s'") )
797 .Format(
798 mManager->GetCategoryFromName(newCommand),
799 mManager->GetPrefixedLabelFromName(newCommand) );
800 auto oldlabel = Verbatim(wxT("'%s - %s'"))
801 .Format(
802 mManager->GetCategoryFromName(oldCommands[0]),
803 mManager->GetPrefixedLabelFromName(oldCommands[0]));
804
805 for (size_t i{ 1 }; i < oldCommands.size(); i++)
806 oldlabel += XO("\n\n\t and\n\n\t") +
807 Verbatim(wxT("'%s - %s'")).Format(
808 mManager->GetCategoryFromName(oldCommands[i]),
809 mManager->GetPrefixedLabelFromName(oldCommands[i]));
810
811 if (wxCANCEL == AudacityMessageBox(
812 XO(
813"The keyboard shortcut '%s' is already assigned to:\n\n\t%s\n\n\nClick OK to assign the shortcut to\n\n\t%s\n\ninstead. Otherwise, click Cancel.")
814 .Format(
815 mKey->GetValue(),
816 oldlabel,
817 newlabel
818 ),
819 XO("Warning"),
820 wxOK | wxCANCEL | wxICON_STOP | wxCENTRE,
821 this))
822 {
823 return;
824 }
825
826 for (const auto & command : oldCommands)
827 {
828 mView->SetKeyByName(command, {});
829 mManager->SetKeyFromName(command, {});
830 mNewKeys[make_iterator_range(mNames).index(command)] = {};
831 }
832 }
833
834 SetKeyForSelected(enteredKey);
835}
std::vector< CommandID > CommandIDs
Definition: Identifier.h:233
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: IteratorX.h:210
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
TranslatableString GetCategoryFromName(const CommandID &name) const
NormalizedKeyString GetDefaultKeyFromName(const CommandID &name) const
bool SetKeyByName(const CommandID &name, const NormalizedKeyString &key)
Definition: KeyView.cpp:396
wxString GetName() const override
Definition: KeyView.cpp:194
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.

References AudacityMessageBox(), EMPTY_SHORTCUT, TranslatableString::Format(), CommandManager::GetCategoryFromName(), CommandManager::GetDefaultKeyFromName(), KeyView::GetName(), CommandManager::GetPrefixedLabelFromName(), make_iterator_range(), mCommandSelected, mDefaultKeys, mKey, mManager, mNames, mNewKeys, mView, KeyView::SetKeyByName(), SetKeyForSelected(), CommandManager::SetKeyFromName(), Verbatim(), wxT(), and XO().

Here is the call graph for this function:

◆ OnShow()

void KeyConfigPrefs::OnShow ( wxShowEvent &  e)
private

Definition at line 475 of file KeyConfigPrefs.cpp.

476{
477 event.Skip();
478
479 // This is required to prevent a crash if Preferences
480 // were opened without a project.
481 if (event.IsShown() && mView != nullptr)
482 {
483 mView->Refresh();
484 }
485}

References mView.

◆ OnViewBy()

void KeyConfigPrefs::OnViewBy ( wxCommandEvent &  e)
private

Definition at line 863 of file KeyConfigPrefs.cpp.

864{
865 switch (e.GetId())
866 {
867 case ViewByTreeID:
869 mFilterLabel->SetLabel(_("Searc&h:"));
870 break;
871
872 case ViewByNameID:
874 mFilterLabel->SetLabel(_("Searc&h:"));
875 break;
876
877 case ViewByKeyID:
879 mFilterLabel->SetLabel(_("&Hotkey:"));
880 break;
881 }
882
884 mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
885}
#define ViewByTreeID
#define ViewByNameID
#define ViewByKeyID
@ ViewByTree
Definition: KeyView.h:62
@ ViewByName
Definition: KeyView.h:63
wxStaticText * mFilterLabel
void SetView(ViewByType type)
Definition: KeyView.cpp:414

References _, mFilter, mFilterLabel, mView, mViewType, KeyView::SetView(), ViewByKey, ViewByKeyID, ViewByName, ViewByNameID, ViewByTree, and ViewByTreeID.

Here is the call graph for this function:

◆ Populate()

void KeyConfigPrefs::Populate ( )
private

Definition at line 125 of file KeyConfigPrefs.cpp.

126{
128
129 if (!mProject) {
130 S.StartVerticalLay(true);
131 {
132 S.StartStatic( {}, true);
133 {
134 S.AddTitle(XO("Keyboard preferences currently unavailable."));
135 S.AddTitle(XO("Open a new project to modify keyboard shortcuts."));
136 }
137 S.EndStatic();
138 }
139 S.EndVerticalLay();
140
141 return;
142 }
143
145
146 mCommandSelected = wxNOT_FOUND;
147
149
150 // For speed, don't sort here. We're just creating.
151 // Instead sort when we do SetView later in this function.
152 RefreshBindings(false);
153
154 if (mViewByTree->GetValue()) {
156 }
157 else if (mViewByName->GetValue()) {
159 }
160 else if (mViewByKey->GetValue()) {
162 mFilterLabel->SetLabel(_("&Hotkey:"));
163 mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
164 }
165
167}
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46
static CommandManager & Get(AudacityProject &project)
wxRadioButton * mViewByKey
wxRadioButton * mViewByTree
wxRadioButton * mViewByName

References _, eIsCreatingFromPrefs, CommandManager::Get(), mCommandSelected, mFilter, mFilterLabel, mManager, mProject, mView, mViewByKey, mViewByName, mViewByTree, mViewType, PopulateOrExchange(), RefreshBindings(), S, KeyView::SetView(), ViewByKey, ViewByName, ViewByTree, and XO().

Here is the call graph for this function:

◆ PopulateOrExchange()

void KeyConfigPrefs::PopulateOrExchange ( ShuttleGui S)
override

Normally in classes derived from PrefsPanel this function is used both to populate the panel and to exchange data with it. With KeyConfigPrefs all the exchanges are handled specially, so this is only used in populating the panel.

Definition at line 173 of file KeyConfigPrefs.cpp.

174{
175 ChoiceSetting Setting{ L"/Prefs/KeyConfig/ViewBy",
176 {
177 { wxT("tree"), XXO("&Tree") },
178 { wxT("name"), XXO("&Name") },
179 { wxT("key"), XXO("&Key") },
180 },
181 0 // tree
182 };
183
184 S.SetBorder(2);
185
186 S.StartStatic(XO("Key Bindings"), 1);
187 {
188 S.StartHorizontalLay(wxEXPAND, 0);
189 {
190 S.Position(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL).AddTitle(XO("View by:"));
191
192 // Bug 2692: Place button group in panel so tabbing will work and,
193 // on the Mac, VoiceOver will announce as radio buttons.
194 S.StartPanel();
195 {
196 S.StartHorizontalLay();
197 {
198 S.StartRadioButtonGroup(Setting);
199 {
201 .Name(XO("View by tree"))
202 .TieRadioButton();
204 .Name(XO("View by name"))
205 .TieRadioButton();
207 .Name(XO("View by key"))
208 .TieRadioButton();
209#if !defined(__WXMAC__) && wxUSE_ACCESSIBILITY
210 // so that name can be set on a standard control
214#endif
215 }
216 S.EndRadioButtonGroup();
217 }
218 S.EndHorizontalLay();
219 }
220 S.EndPanel();
221
222 S.AddSpace(wxDefaultCoord, wxDefaultCoord, 1);
223
224 S.StartHorizontalLay(wxALIGN_CENTER_VERTICAL, 0);
225 {
226 mFilterLabel = S.Position(wxALIGN_CENTER_VERTICAL).AddVariableText(XO("Searc&h:"));
227
228 if (!mFilter) {
229 mFilter = safenew wxTextCtrl(S.GetParent(),
230 FilterID,
231 wxT(""),
232 wxDefaultPosition,
233#if defined(__WXMAC__)
234 wxSize(300, -1),
235#else
236 wxSize(210, -1),
237#endif
238 wxTE_PROCESS_ENTER);
239 mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
240 }
241 S.Position(wxALIGN_NOT | wxALIGN_LEFT)
242 .ConnectRoot(wxEVT_KEY_DOWN,
244 .ConnectRoot(wxEVT_CHAR,
246 .AddWindow(mFilter);
247 }
248 S.EndHorizontalLay();
249 }
250 S.EndHorizontalLay();
251
252 S.AddSpace(wxDefaultCoord, 2);
253
254 S.StartHorizontalLay(wxEXPAND, 1);
255 {
256 if (!mView) {
257 mView = safenew KeyView(S.GetParent(), CommandsListID);
258 mView->SetName(_("Bindings"));
259 }
260 S.Prop(true)
261 .Position(wxEXPAND)
262 .AddWindow(mView);
263 }
264 S.EndHorizontalLay();
265
266 S.StartThreeColumn();
267 {
268 if (!mKey) {
269 mKey = safenew wxTextCtrl(S.GetParent(),
271 wxT(""),
272 wxDefaultPosition,
273#if defined(__WXMAC__)
274 wxSize(300, -1),
275#else
276 wxSize(210, -1),
277#endif
278 wxTE_PROCESS_ENTER);
279#if !defined(__WXMAC__) && wxUSE_ACCESSIBILITY
280 // so that name can be set on a standard control
281 mKey->SetAccessible(safenew WindowAccessible(mKey));
282#endif
283 mKey->SetName(_("Short cut"));
284 }
285 S
286 .ConnectRoot(wxEVT_KEY_DOWN,
288 .ConnectRoot(wxEVT_CHAR,
290 .ConnectRoot(wxEVT_KILL_FOCUS,
292 .ConnectRoot(wxEVT_CONTEXT_MENU,
294 .AddWindow(mKey);
295
296 /* i18n-hint: (verb)*/
297 mSet = S.Id(SetButtonID).AddButton(XXO("&Set"));
298 /* i18n-hint: (verb)*/
299 mClear = S.Id(ClearButtonID).AddButton(XXO("Cl&ear"));
300 }
301 S.EndThreeColumn();
302
303#if defined(__WXMAC__)
304 S.AddFixedText(XO("Note: Pressing Cmd+Q will quit. All other keys are valid."));
305#endif
306
307 S.StartThreeColumn();
308 {
309 S.Id(ImportButtonID).AddButton(XXO("&Import..."));
310 S.Id(ExportButtonID).AddButton(XXO("&Export..."));
311 S.Id(AssignDefaultsButtonID).AddButton(XXO("&Defaults"));
312 }
313 S.EndThreeColumn();
314 }
315 S.EndStatic();
316
317
318 // Need to layout so that the KeyView is properly sized before populating.
319 // Otherwise, the initial selection is not scrolled into view.
320 Layout();
321}
XXO("&Cut/Copy/Paste Toolbar")
#define CurrentComboID
#define ClearButtonID
#define ImportButtonID
#define CommandsListID
#define ExportButtonID
#define SetButtonID
#define AssignDefaultsButtonID
#define FilterID
#define safenew
Definition: MemoryX.h:9
void OnFilterKeyDown(wxKeyEvent &e)
void OnHotkeyChar(wxEvent &e)
void OnHotkeyKillFocus(wxEvent &e)
void OnHotkeyContext(wxEvent &e)
void OnFilterChar(wxEvent &e)
void OnHotkeyKeyDown(wxKeyEvent &e)
Provides multiple views of keyboard shortcuts.
Definition: KeyView.h:73
Definition: Prefs.h:178
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...

References _, AssignDefaultsButtonID, ClearButtonID, CommandsListID, CurrentComboID, ExportButtonID, FilterID, ImportButtonID, mClear, mFilter, mFilterLabel, mKey, mSet, mView, mViewByKey, mViewByName, mViewByTree, OnFilterChar(), OnFilterKeyDown(), OnHotkeyChar(), OnHotkeyContext(), OnHotkeyKeyDown(), OnHotkeyKillFocus(), S, safenew, SetButtonID, ViewByKeyID, ViewByNameID, ViewByTreeID, wxT(), XO(), and XXO().

Referenced by Commit(), and Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshBindings()

void KeyConfigPrefs::RefreshBindings ( bool  bSort)
private

Definition at line 323 of file KeyConfigPrefs.cpp.

324{
325 TranslatableStrings Labels;
326 TranslatableStrings Categories;
327 TranslatableStrings Prefixes;
328
329 mNames.clear();
330 mKeys.clear();
331 mDefaultKeys.clear();
332 mStandardDefaultKeys.clear();
334 mNames,
335 mKeys,
337 Labels,
338 Categories,
339 Prefixes,
340 true); // True to include effects (list items), false otherwise.
341
344
346 Categories,
347 Prefixes,
348 Labels,
349 mKeys,
350 bSort);
351 //Not needed as NEW nodes are already shown expanded.
352 //mView->ExpandAll();
353
354 mNewKeys = mKeys;
355}
std::vector< TranslatableString > TranslatableStrings
void GetAllCommandData(CommandIDs &names, std::vector< NormalizedKeyString > &keys, std::vector< NormalizedKeyString > &default_keys, TranslatableStrings &labels, TranslatableStrings &categories, TranslatableStrings &prefixes, bool includeMultis)
void RefreshBindings(const CommandIDs &names, const TranslatableStrings &categories, const TranslatableStrings &prefixes, const TranslatableStrings &labels, const std::vector< NormalizedKeyString > &keys, bool bSort)
Definition: KeyView.cpp:636

References FilterKeys(), CommandManager::GetAllCommandData(), mDefaultKeys, mKeys, mManager, mNames, mNewKeys, mStandardDefaultKeys, mView, and KeyView::RefreshBindings().

Referenced by OnImport(), OnImportDefaults(), and Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshKeyInfo()

void KeyConfigPrefs::RefreshKeyInfo ( )
private

Definition at line 359 of file KeyConfigPrefs.cpp.

360{
361 mKeys.clear();
362
363 for (const auto & name : mNames)
364 mKeys.push_back(mManager->GetKeyFromName(name));
365}

References CommandManager::GetKeyFromName(), mKeys, mManager, mNames, and name.

Referenced by OnImport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetKeyForSelected()

void KeyConfigPrefs::SetKeyForSelected ( const NormalizedKeyString key)
private

Definition at line 740 of file KeyConfigPrefs.cpp.

741{
743
745 {
747 XO("You may not assign a key to this entry"),
748 XO("Error"),
749 wxICON_ERROR | wxCENTRE,
750 this);
751 return;
752 }
753
756 mNewKeys[ make_iterator_range( mNames ).index( name ) ] = key;
757}
bool SetKey(int index, const NormalizedKeyString &key)
Definition: KeyView.cpp:355

References AudacityMessageBox(), KeyView::CanSetKey(), KeyView::GetName(), key, make_iterator_range(), mCommandSelected, mManager, mNames, mNewKeys, mView, name, KeyView::SetKey(), CommandManager::SetKeyFromName(), and XO().

Referenced by OnClear(), and OnSet().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mClear

wxButton* KeyConfigPrefs::mClear
private

Definition at line 84 of file KeyConfigPrefs.h.

Referenced by OnSelected(), and PopulateOrExchange().

◆ mCommandSelected

int KeyConfigPrefs::mCommandSelected
private

◆ mDefaultKeys

std::vector<NormalizedKeyString> KeyConfigPrefs::mDefaultKeys
private

◆ mFilter

wxTextCtrl* KeyConfigPrefs::mFilter
private

Definition at line 86 of file KeyConfigPrefs.h.

Referenced by OnFilterTimer(), OnViewBy(), Populate(), and PopulateOrExchange().

◆ mFilterLabel

wxStaticText* KeyConfigPrefs::mFilterLabel
private

Definition at line 87 of file KeyConfigPrefs.h.

Referenced by OnViewBy(), Populate(), and PopulateOrExchange().

◆ mFilterPending

bool KeyConfigPrefs::mFilterPending
private

Definition at line 89 of file KeyConfigPrefs.h.

Referenced by OnFilterKeyDown(), and OnFilterTimer().

◆ mFilterTimer

wxTimer KeyConfigPrefs::mFilterTimer
private

Definition at line 88 of file KeyConfigPrefs.h.

Referenced by OnFilterKeyDown().

◆ mKey

wxTextCtrl* KeyConfigPrefs::mKey
private

Definition at line 82 of file KeyConfigPrefs.h.

Referenced by OnClear(), OnHotkeyKillFocus(), OnSelected(), OnSet(), and PopulateOrExchange().

◆ mKeys

std::vector<NormalizedKeyString> KeyConfigPrefs::mKeys
private

◆ mManager

CommandManager* KeyConfigPrefs::mManager
private

◆ mNames

CommandIDs KeyConfigPrefs::mNames
private

◆ mNewKeys

std::vector<NormalizedKeyString> KeyConfigPrefs::mNewKeys
private

Definition at line 105 of file KeyConfigPrefs.h.

Referenced by Commit(), OnImportDefaults(), OnSet(), RefreshBindings(), and SetKeyForSelected().

◆ mProject

AudacityProject* KeyConfigPrefs::mProject {}
private

Definition at line 96 of file KeyConfigPrefs.h.

Referenced by Commit(), and Populate().

◆ mSet

wxButton* KeyConfigPrefs::mSet
private

Definition at line 83 of file KeyConfigPrefs.h.

Referenced by OnSelected(), and PopulateOrExchange().

◆ mStandardDefaultKeys

std::vector<NormalizedKeyString> KeyConfigPrefs::mStandardDefaultKeys
private

Definition at line 103 of file KeyConfigPrefs.h.

Referenced by Commit(), and RefreshBindings().

◆ mView

KeyView* KeyConfigPrefs::mView
private

◆ mViewByKey

wxRadioButton* KeyConfigPrefs::mViewByKey
private

Definition at line 94 of file KeyConfigPrefs.h.

Referenced by Populate(), and PopulateOrExchange().

◆ mViewByName

wxRadioButton* KeyConfigPrefs::mViewByName
private

Definition at line 93 of file KeyConfigPrefs.h.

Referenced by Populate(), and PopulateOrExchange().

◆ mViewByTree

wxRadioButton* KeyConfigPrefs::mViewByTree
private

Definition at line 92 of file KeyConfigPrefs.h.

Referenced by Populate(), and PopulateOrExchange().

◆ mViewType

ViewByType KeyConfigPrefs::mViewType
private

Definition at line 91 of file KeyConfigPrefs.h.

Referenced by OnFilterChar(), OnFilterKeyDown(), OnViewBy(), and Populate().


The documentation for this class was generated from the following files: