Sets the selected command to have this key This is not yet a committed change, which will happen on a save.
| 738 | // Sets the selected command to have this key |
| 739 | // This is not yet a committed change, which will happen on a save. |
| 740 | void 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 | |
| 760 | void KeyConfigPrefs::OnSet(wxCommandEvent & WXUNUSED(event)) |
nothing calls this directly
no test coverage detected