| 123 | } |
| 124 | |
| 125 | void KeyConfigPrefs::Populate() |
| 126 | { |
| 127 | ShuttleGui S(this, eIsCreatingFromPrefs); |
| 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 | |
| 144 | PopulateOrExchange(S); |
| 145 | |
| 146 | mCommandSelected = wxNOT_FOUND; |
| 147 | |
| 148 | mManager = &CommandManager::Get( *mProject ); |
| 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()) { |
| 155 | mViewType = ViewByTree; |
| 156 | } |
| 157 | else if (mViewByName->GetValue()) { |
| 158 | mViewType = ViewByName; |
| 159 | } |
| 160 | else if (mViewByKey->GetValue()) { |
| 161 | mViewType = ViewByKey; |
| 162 | mFilterLabel->SetLabel(_("&Hotkey:")); |
| 163 | mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel())); |
| 164 | } |
| 165 | |
| 166 | mView->SetView(mViewType); |
| 167 | } |
| 168 | |
| 169 | /// Normally in classes derived from PrefsPanel this function |
| 170 | /// is used both to populate the panel and to exchange data with it. |
nothing calls this directly
no test coverage detected