| 376 | } |
| 377 | |
| 378 | void MacroConditionSourceEdit::GetSettingsClicked() |
| 379 | { |
| 380 | if (_loading || !_entryData || !_entryData->_source.GetSource()) { |
| 381 | return; |
| 382 | } |
| 383 | |
| 384 | QString value; |
| 385 | if (_entryData->GetCondition() == |
| 386 | MacroConditionSource::Condition::ALL_SETTINGS_MATCH) { |
| 387 | const auto settings = |
| 388 | GetSourceSettings(_entryData->_source.GetSource(), |
| 389 | _entryData->_includeDefaults); |
| 390 | if (settings) { |
| 391 | value = FormatJsonString(*settings); |
| 392 | } |
| 393 | } else if (_entryData->GetCondition() == |
| 394 | MacroConditionSource::Condition:: |
| 395 | INDIVIDUAL_SETTING_LIST_ENTRY_MATCH) { |
| 396 | value = QString::fromStdString( |
| 397 | GetSourceSettingListEntryName( |
| 398 | _entryData->_source.GetSource(), |
| 399 | _entryData->_setting) |
| 400 | .value_or("")); |
| 401 | } else { |
| 402 | value = QString::fromStdString( |
| 403 | GetSourceSettingValue(_entryData->_source.GetSource(), |
| 404 | _entryData->_setting) |
| 405 | .value_or("")); |
| 406 | } |
| 407 | |
| 408 | if (_entryData->_regex.Enabled()) { |
| 409 | value = EscapeForRegex(value); |
| 410 | } |
| 411 | _settings->setPlainText(value); |
| 412 | } |
| 413 | |
| 414 | void MacroConditionSourceEdit::SettingsChanged() |
| 415 | { |
nothing calls this directly
no test coverage detected