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 91 of file KeyConfigPrefs.cpp.

95: PrefsPanel(parent, winid, XO("Keyboard")),
96 mView(NULL),
97 mKey(NULL),
98 mFilter(NULL),
100 mFilterPending(false)
101 , mProject{ pProject }
102{
103 Populate();
104 if (!name.empty()) {
105 auto index = mView->GetIndexByName(name);
106 mView->SelectNode(index);
107 }
108
109 // See bug #2315 for discussion. This should be reviewed
110 // and (possibly) removed after wx3.1.3.
111 Bind(wxEVT_SHOW, &KeyConfigPrefs::OnShow, this);
112}
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 930 of file KeyConfigPrefs.cpp.

931{
932 // Restore original key values
933 for (size_t i = 0; i < mNames.size(); i++) {
935 }
936
937 return;
938}
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 373 of file KeyConfigPrefs.cpp.

374{
375 const NormalizedKeyString noKey{ NO_SHORTCUT };
376 for (const auto & command : mNames)
377 mManager->SetKeyFromName(command, noKey);
378}
#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 891 of file KeyConfigPrefs.cpp.

892{
893 // On the Mac, preferences may be changed without any active
894 // projects. This means that the CommandManager isn't available
895 // either. So we can't attempt to save preferences, otherwise
896 // NULL ptr dereferences will happen in ShuttleGui because the
897 // radio buttons are never created. (See Populate() above.)
898 if ( !mProject ) {
899 return true;
900 }
901
904
905 bool bFull = gPrefs->ReadBool(wxT("/GUI/Shortcuts/FullDefaults"), false);
906 for (size_t i = 0; i < mNames.size(); i++) {
907 const auto &dkey = bFull ? mDefaultKeys[i] : mStandardDefaultKeys[i];
908 // using GET to interpret CommandID as a config path component
909 auto name = wxT("/NewKeys/") + mNames[i].GET();
910 const auto &key = mNewKeys[i];
911
912 if (gPrefs->HasEntry(name)) {
913 if (key != NormalizedKeyString{ gPrefs->ReadObject(name, key) } ) {
914 gPrefs->Write(name, key);
915 }
916 if (key == dkey) {
918 }
919 }
920 else {
921 if (key != dkey) {
922 gPrefs->Write(name, key);
923 }
924 }
925 }
926
927 return gPrefs->Flush();
928}
wxT("CloseDown"))
static const AudacityProject::AttachedObjects::RegisteredFactory key
FileConfig * gPrefs
Definition: Prefs.cpp:70
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
virtual bool DeleteEntry(const wxString &key, bool bDeleteGroupIfEmpty=true) wxOVERRIDE
Definition: FileConfig.cpp:209
virtual bool HasEntry(const wxString &strName) const wxOVERRIDE
Definition: FileConfig.cpp:138
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
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:625

References FileConfig::DeleteEntry(), eIsSavingToPrefs, FileConfig::Flush(), gPrefs, FileConfig::HasEntry(), key, mDefaultKeys, mNames, mNewKeys, mProject, mStandardDefaultKeys, name, PopulateOrExchange(), S, and wxT().

Here is the call graph for this function:

◆ ContainsIllegalDups()

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

Definition at line 385 of file KeyConfigPrefs.cpp.

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

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 607 of file KeyConfigPrefs.cpp.

608{
609 const auto &MaxListOnly = CommandManager::ExcludedList();
610
611 // Remove items that are in MaxList.
612 for (size_t i = 0; i < arr.size(); i++) {
613 if( std::binary_search(MaxListOnly.begin(), MaxListOnly.end(), arr[i]) )
614 arr[i] = {};
615 }
616}
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 119 of file KeyConfigPrefs.cpp.

120{
121 return XO("Preferences for KeyConfig");
122}

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol KeyConfigPrefs::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 114 of file KeyConfigPrefs.cpp.

115{
117}
#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 124 of file KeyConfigPrefs.cpp.

125{
126 return "Keyboard_Preferences";
127}

◆ MergeWithExistingKeys()

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

Definition at line 425 of file KeyConfigPrefs.cpp.

427{
428 TranslatableString disabledShortcuts;
429
430 auto searchAddInKeys = [&](size_t index)
431 {
432 for (size_t k{ 0 }; k < toAdd.size(); k++)
433 if (k == index)
434 continue;
435 else if (toAdd[index] == mKeys[k] &&
437 mDefaultKeys[k] != mDefaultKeys[index]))
438 return (int)k;
439
440 return -1;
441 };
442
443 const NormalizedKeyString noKey{ EMPTY_SHORTCUT };
444
445 for (size_t i{ 0 }; i < toAdd.size(); i++)
446 {
447 if (mKeys[i] != NO_SHORTCUT)
448 continue;
449 else if (toAdd[i] == EMPTY_SHORTCUT)
450 mManager->SetKeyFromIndex(i, noKey);
451 else
452 {
453 int sRes{ searchAddInKeys(i) };
454
455 if (sRes == -1)
456 mManager->SetKeyFromIndex(i, toAdd[i]);
457 else
458 {
460
461 disabledShortcuts +=
462 XO(
463"\n * \"%s\" (because the shortcut \'%s\' is used by \"%s\")\n")
464 .Format(
466 name,
468
469 mManager->SetKeyFromIndex(i, noKey);
470 }
471 }
472 }
473
474 return disabledShortcuts;
475}
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 737 of file KeyConfigPrefs.cpp.

738{
739 return mView->GetNameByKey(key);
740}
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 841 of file KeyConfigPrefs.cpp.

842{
843 mKey->Clear();
844
845 if (mCommandSelected != wxNOT_FOUND) {
847 }
848}
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 598 of file KeyConfigPrefs.cpp.

599{
600 wxMenu Menu;
601 Menu.Append( 1, _("Standard") );
602 Menu.Append( 2, _("Full") );
603 Menu.Bind( wxEVT_COMMAND_MENU_SELECTED, &KeyConfigPrefs::OnImportDefaults, this );
605}
#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)
std::unique_ptr< MenuItem > Menu(const Identifier &internalName, const TranslatableString &title, Args &&... args)
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.

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

Here is the call graph for this function:

◆ OnExport()

void KeyConfigPrefs::OnExport ( wxCommandEvent &  e)
private

Definition at line 570 of file KeyConfigPrefs.cpp.

571{
572 wxString file = wxT("Audacity-keys.xml");
573
574 file = SelectFile(FileNames::Operation::Export,
575 XO("Export Keyboard Shortcuts As:"),
576 wxEmptyString,
577 file,
578 wxT("xml"),
580 wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
581 this);
582
583 if (!file) {
584 return;
585 }
586
587 GuardedCall( [&] {
588 XMLFileWriter prefFile{ file, XO("Error Exporting Keyboard Shortcuts") };
589 mManager->WriteXML(prefFile);
590 prefFile.Commit();
591 } );
592}
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 727 of file KeyConfigPrefs.cpp.

728{
729 if (mViewType != ViewByKey)
730 {
731 e.Skip();
732 }
733}
@ 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 685 of file KeyConfigPrefs.cpp.

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

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

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 656 of file KeyConfigPrefs.cpp.

657{
658 // event.Skip() not performed, so event will not be processed further.
659}

Referenced by PopulateOrExchange().

Here is the caller graph for this function:

◆ OnHotkeyContext()

void KeyConfigPrefs::OnHotkeyContext ( wxEvent &  e)
private

Definition at line 670 of file KeyConfigPrefs.cpp.

671{
672 // event.Skip() not performed, so event will not be processed further.
673}

Referenced by PopulateOrExchange().

Here is the caller graph for this function:

◆ OnHotkeyKeyDown()

void KeyConfigPrefs::OnHotkeyKeyDown ( wxKeyEvent &  e)
private

Definition at line 634 of file KeyConfigPrefs.cpp.

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

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 661 of file KeyConfigPrefs.cpp.

662{
663 if (mKey->GetValue().empty() && mCommandSelected != wxNOT_FOUND) {
664 mKey->AppendText(mView->GetKey(mCommandSelected).Display());
665 }
666
667 e.Skip();
668}
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 491 of file KeyConfigPrefs.cpp.

492{
493 wxString file = wxT("Audacity-keys.xml");
494
495 file = SelectFile(FileNames::Operation::Open,
496 XO("Select an XML file containing Audacity keyboard shortcuts..."),
497 wxEmptyString,
498 file,
499 wxT(""),
501 wxRESIZE_BORDER,
502 this);
503
504 if (!file) {
505 return;
506 }
507
508 // this RefreshKeyInfo is here to account for
509 // potential OnSet() function executions before importing
511
512 // saving pre-import settings
513 const std::vector<NormalizedKeyString> oldKeys{ mKeys };
514
515 // clearing all pre-import settings
516 ClearAllKeys();
517
518 // getting new settings
519 XMLFileReader reader;
520 if (!reader.Parse(mManager, file)) {
522 reader.GetErrorStr(),
523 XO("Error Importing Keyboard Shortcuts"),
524 wxOK | wxCENTRE,
525 this);
526 }
527
529
530 // checking new setting for duplicates
531 // if there are duplicates, throwing error and returning to pre-import state
532 TranslatableString fMatching;
533 TranslatableString sMatching;
534
535 if (ContainsIllegalDups(fMatching, sMatching))
536 {
537 // restore the old pre-import hotkeys stored in oldKeys
538 for (size_t k{ 0 }; k < mNames.size(); k++)
539 mManager->SetKeyFromName(mNames[k], oldKeys[k]);
540 mKeys = oldKeys;
541
542 // output an error message
544 XO(
545"The file with the shortcuts contains illegal shortcut duplicates for \"%s\" and \"%s\".\nNothing is imported.")
546 .Format( fMatching, sMatching ),
547 XO("Error Importing Keyboard Shortcuts"),
548 wxICON_ERROR | wxCENTRE, this);
549
550 // stop the function
551 return;
552 }
553
554 // adding possible old settings to the new settings and recording the conflicting ones
555 TranslatableString disabledShortcuts{ MergeWithExistingKeys(oldKeys) };
556
557 RefreshBindings(true);
558
559 TranslatableString message{
560 XO("Loaded %d keyboard shortcuts\n").Format(mManager->GetNumberOfKeysRead()) };
561
562 if (disabledShortcuts.Translation() != (""))
563 message += XO("\nThe following commands are not mentioned in the imported file, "
564 "but have their shortcuts removed because of the conflict with other new shortcuts:\n") +
565 disabledShortcuts;
566
567 AudacityMessageBox(message, XO("Loading Keyboard Shortcuts"), wxOK | wxCENTRE);
568}
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 618 of file KeyConfigPrefs.cpp.

619{
620 gPrefs->DeleteEntry(wxT("/GUI/Shortcuts/FullDefaults"));
621 gPrefs->Flush();
622
624 if( event.GetId() == 1 )
626
627 for (size_t i = 0; i < mNewKeys.size(); i++) {
629 }
630
631 RefreshBindings(true);
632}
void FilterKeys(std::vector< NormalizedKeyString > &arr)

References FileConfig::DeleteEntry(), FilterKeys(), FileConfig::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 850 of file KeyConfigPrefs.cpp.

851{
853 mKey->Clear();
854
855 if (mCommandSelected != wxNOT_FOUND) {
856 bool canset = mView->CanSetKey(mCommandSelected);
857 if (canset) {
858 mKey->AppendText(mView->GetKey(mCommandSelected).Display());
859 }
860
861 mKey->Enable(canset);
862 mSet->Enable(canset);
863 mClear->Enable(canset);
864 }
865}
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 764 of file KeyConfigPrefs.cpp.

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

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

References mView.

◆ OnViewBy()

void KeyConfigPrefs::OnViewBy ( wxCommandEvent &  e)
private

Definition at line 867 of file KeyConfigPrefs.cpp.

868{
869 switch (e.GetId())
870 {
871 case ViewByTreeID:
873 mFilterLabel->SetLabel(_("Searc&h:"));
874 break;
875
876 case ViewByNameID:
878 mFilterLabel->SetLabel(_("Searc&h:"));
879 break;
880
881 case ViewByKeyID:
883 mFilterLabel->SetLabel(_("&Hotkey:"));
884 break;
885 }
886
888 mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
889}
#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 129 of file KeyConfigPrefs.cpp.

130{
132
133 if (!mProject) {
134 S.StartVerticalLay(true);
135 {
136 S.StartStatic( {}, true);
137 {
138 S.AddTitle(XO("Keyboard preferences currently unavailable."));
139 S.AddTitle(XO("Open a new project to modify keyboard shortcuts."));
140 }
141 S.EndStatic();
142 }
143 S.EndVerticalLay();
144
145 return;
146 }
147
149
150 mCommandSelected = wxNOT_FOUND;
151
153
154 // For speed, don't sort here. We're just creating.
155 // Instead sort when we do SetView later in this function.
156 RefreshBindings(false);
157
158 if (mViewByTree->GetValue()) {
160 }
161 else if (mViewByName->GetValue()) {
163 }
164 else if (mViewByKey->GetValue()) {
166 mFilterLabel->SetLabel(_("&Hotkey:"));
167 mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
168 }
169
171}
@ 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 177 of file KeyConfigPrefs.cpp.

178{
179 ChoiceSetting Setting{ L"/Prefs/KeyConfig/ViewBy",
180 {
181 { wxT("tree"), XXO("&Tree") },
182 { wxT("name"), XXO("&Name") },
183 { wxT("key"), XXO("&Key") },
184 },
185 0 // tree
186 };
187
188 S.SetBorder(2);
189
190 S.StartStatic(XO("Key Bindings"), 1);
191 {
192 S.StartHorizontalLay(wxEXPAND, 0);
193 {
194 S.Position(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL).AddTitle(XO("View by:"));
195
196 // Bug 2692: Place button group in panel so tabbing will work and,
197 // on the Mac, VoiceOver will announce as radio buttons.
198 S.StartPanel();
199 {
200 S.StartHorizontalLay();
201 {
202 S.StartRadioButtonGroup(Setting);
203 {
205 .Name(XO("View by tree"))
206 .TieRadioButton();
208 .Name(XO("View by name"))
209 .TieRadioButton();
211 .Name(XO("View by key"))
212 .TieRadioButton();
213#if !defined(__WXMAC__) && wxUSE_ACCESSIBILITY
214 // so that name can be set on a standard control
218#endif
219 }
220 S.EndRadioButtonGroup();
221 }
222 S.EndHorizontalLay();
223 }
224 S.EndPanel();
225
226 S.AddSpace(wxDefaultCoord, wxDefaultCoord, 1);
227
228 S.StartHorizontalLay(wxALIGN_CENTER_VERTICAL, 0);
229 {
230 mFilterLabel = S.Position(wxALIGN_CENTER_VERTICAL).AddVariableText(XO("Searc&h:"));
231
232 if (!mFilter) {
233 mFilter = safenew wxTextCtrl(S.GetParent(),
234 FilterID,
235 wxT(""),
236 wxDefaultPosition,
237#if defined(__WXMAC__)
238 wxSize(300, -1),
239#else
240 wxSize(210, -1),
241#endif
242 wxTE_PROCESS_ENTER);
243 mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
244 }
245 S.Position(wxALIGN_NOT | wxALIGN_LEFT)
246 .ConnectRoot(wxEVT_KEY_DOWN,
248 .ConnectRoot(wxEVT_CHAR,
250 .AddWindow(mFilter);
251 }
252 S.EndHorizontalLay();
253 }
254 S.EndHorizontalLay();
255
256 S.AddSpace(wxDefaultCoord, 2);
257
258 S.StartHorizontalLay(wxEXPAND, 1);
259 {
260 if (!mView) {
261 mView = safenew KeyView(S.GetParent(), CommandsListID);
262 mView->SetName(_("Bindings"));
263 }
264 S.Prop(true)
265 .Position(wxEXPAND)
266 .AddWindow(mView);
267 }
268 S.EndHorizontalLay();
269
270 S.StartThreeColumn();
271 {
272 if (!mKey) {
273 mKey = safenew wxTextCtrl(S.GetParent(),
275 wxT(""),
276 wxDefaultPosition,
277#if defined(__WXMAC__)
278 wxSize(300, -1),
279#else
280 wxSize(210, -1),
281#endif
282 wxTE_PROCESS_ENTER);
283#if !defined(__WXMAC__) && wxUSE_ACCESSIBILITY
284 // so that name can be set on a standard control
285 mKey->SetAccessible(safenew WindowAccessible(mKey));
286#endif
287 mKey->SetName(_("Short cut"));
288 }
289 S
290 .ConnectRoot(wxEVT_KEY_DOWN,
292 .ConnectRoot(wxEVT_CHAR,
294 .ConnectRoot(wxEVT_KILL_FOCUS,
296 .ConnectRoot(wxEVT_CONTEXT_MENU,
298 .AddWindow(mKey);
299
300 /* i18n-hint: (verb)*/
301 mSet = S.Id(SetButtonID).AddButton(XXO("&Set"));
302 /* i18n-hint: (verb)*/
303 mClear = S.Id(ClearButtonID).AddButton(XXO("Cl&ear"));
304 }
305 S.EndThreeColumn();
306
307#if defined(__WXMAC__)
308 S.AddFixedText(XO("Note: Pressing Cmd+Q will quit. All other keys are valid."));
309#endif
310
311 S.StartThreeColumn();
312 {
313 S.Id(ImportButtonID).AddButton(XXO("&Import..."));
314 S.Id(ExportButtonID).AddButton(XXO("&Export..."));
315 S.Id(AssignDefaultsButtonID).AddButton(XXO("&Defaults"));
316 }
317 S.EndThreeColumn();
318 }
319 S.EndStatic();
320
321
322 // Need to layout so that the KeyView is properly sized before populating.
323 // Otherwise, the initial selection is not scrolled into view.
324 Layout();
325}
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:10
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:173
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 327 of file KeyConfigPrefs.cpp.

328{
329 TranslatableStrings Labels;
330 TranslatableStrings Categories;
331 TranslatableStrings Prefixes;
332
333 mNames.clear();
334 mKeys.clear();
335 mDefaultKeys.clear();
336 mStandardDefaultKeys.clear();
338 mNames,
339 mKeys,
341 Labels,
342 Categories,
343 Prefixes,
344 true); // True to include effects (list items), false otherwise.
345
348
350 Categories,
351 Prefixes,
352 Labels,
353 mKeys,
354 bSort);
355 //Not needed as NEW nodes are already shown expanded.
356 //mView->ExpandAll();
357
358 mNewKeys = mKeys;
359}
std::vector< TranslatableString > TranslatableStrings
void GetAllCommandData(CommandIDs &names, std::vector< NormalizedKeyString > &keys, std::vector< NormalizedKeyString > &default_keys, TranslatableStrings &labels, TranslatableStrings &categories, 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 363 of file KeyConfigPrefs.cpp.

364{
365 mKeys.clear();
366
367 for (const auto & name : mNames)
368 mKeys.push_back(mManager->GetKeyFromName(name));
369}

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 744 of file KeyConfigPrefs.cpp.

745{
747
749 {
751 XO("You may not assign a key to this entry"),
752 XO("Error"),
753 wxICON_ERROR | wxCENTRE,
754 this);
755 return;
756 }
757
760 mNewKeys[ make_iterator_range( mNames ).index( name ) ] = key;
761}
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: