MCPcopy Create free account
hub / github.com/audacity/audacity / SetKeyForSelected

Method SetKeyForSelected

src/prefs/KeyConfigPrefs.cpp:740–757  ·  view source on GitHub ↗

Sets the selected command to have this key This is not yet a committed change, which will happen on a save.

Source from the content-addressed store, hash-verified

738// Sets the selected command to have this key
739// This is not yet a committed change, which will happen on a save.
740void KeyConfigPrefs::SetKeyForSelected(const NormalizedKeyString & key)
741{
742 auto name = mView->GetName(mCommandSelected);
743
744 if (!mView->CanSetKey(mCommandSelected))
745 {
746 AudacityMessageBox(
747 XO("You may not assign a key to this entry"),
748 XO("Error"),
749 wxICON_ERROR | wxCENTRE,
750 this);
751 return;
752 }
753
754 mView->SetKey(mCommandSelected, key);
755 mManager->SetKeyFromName(name, key);
756 mNewKeys[ make_iterator_range( mNames ).index( name ) ] = key;
757}
758
759
760void KeyConfigPrefs::OnSet(wxCommandEvent & WXUNUSED(event))

Callers

nothing calls this directly

Calls 7

AudacityMessageBoxFunction · 0.85
make_iterator_rangeFunction · 0.85
CanSetKeyMethod · 0.80
SetKeyMethod · 0.80
SetKeyFromNameMethod · 0.80
GetNameMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected