Refactor clock format to wxdata

This commit is contained in:
Dan Paulat 2024-03-29 00:26:52 -05:00
parent bb287dad9c
commit a7cb459e20
6 changed files with 42 additions and 33 deletions

View file

@ -608,17 +608,17 @@ void SettingsDialogImpl::SetupGeneralTab()
defaultAlertAction_.SetEditWidget(self_->ui->defaultAlertActionComboBox);
defaultAlertAction_.SetResetButton(self_->ui->resetDefaultAlertActionButton);
for (const auto& clockFormat : types::ClockFormatIterator())
for (const auto& clockFormat : scwx::util::ClockFormatIterator())
{
self_->ui->clockFormatComboBox->addItem(
QString::fromStdString(types::GetClockFormatName(clockFormat)));
QString::fromStdString(scwx::util::GetClockFormatName(clockFormat)));
}
clockFormat_.SetSettingsVariable(generalSettings.clock_format());
clockFormat_.SetMapFromValueFunction(
SCWX_ENUM_MAP_FROM_VALUE(types::ClockFormat,
types::ClockFormatIterator(),
types::GetClockFormatName));
SCWX_ENUM_MAP_FROM_VALUE(scwx::util::ClockFormat,
scwx::util::ClockFormatIterator(),
scwx::util::GetClockFormatName));
clockFormat_.SetMapToValueFunction(
[](std::string text) -> std::string
{