| 225 | } |
| 226 | |
| 227 | void ModemProperties::OnChange(wxPropertyGridEvent &event) { |
| 228 | if (!demodContext || !demodContext->isActive()) { |
| 229 | return; |
| 230 | } |
| 231 | |
| 232 | std::map<std::string, wxPGProperty *>::const_iterator prop_i; |
| 233 | |
| 234 | if (event.m_property == defaultProps["._audio_output"]) { |
| 235 | int sel = event.m_property->GetChoiceSelection(); |
| 236 | |
| 237 | outputArg.value = outputArg.options[sel]; |
| 238 | |
| 239 | if (demodContext) { |
| 240 | try { |
| 241 | demodContext->setOutputDevice(std::stoi(outputArg.value)); |
| 242 | } catch (const exception &) { |
| 243 | // .. this should never happen ;) |
| 244 | } |
| 245 | |
| 246 | wxGetApp().getAppFrame()->setScopeDeviceName(outputArg.optionNames[sel]); |
| 247 | } |
| 248 | |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | for (prop_i = props.begin(); prop_i != props.end(); prop_i++) { |
| 253 | if (prop_i->second == event.m_property) { |
| 254 | std::string key = prop_i->first; |
| 255 | std::string value = readProperty(prop_i->first); |
| 256 | demodContext->writeModemSetting(key, value); |
| 257 | return; |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | void ModemProperties::OnCollapse(wxPropertyGridEvent & /* event */) { |
| 263 | collapsed = true; |
nothing calls this directly
no test coverage detected