Skip to content

Commit

Permalink
fix combobox options not persisting
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdcalculus committed Apr 28, 2024
1 parent ad93dd8 commit be07e49
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/widgets/aooptionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void AOOptionsDialog::setWidgetData(QCheckBox *widget, const bool &value)

template <> bool AOOptionsDialog::widgetData(QCheckBox *widget) const
{

return widget->isChecked();
}

Expand Down Expand Up @@ -105,7 +106,7 @@ template <>
void AOOptionsDialog::setWidgetData(QComboBox *widget, const QString &value)
{
for (auto i = 0; i < widget->count(); i++) {
if (widget->itemText(i) == value) {
if (widget->itemData(i) == value) {
widget->setCurrentIndex(i);
return;
}
Expand Down Expand Up @@ -614,11 +615,11 @@ void AOOptionsDialog::setupUI()

ui_log_timestamp_format_combobox->setCurrentText(l_current_format);

ui_log_timestamp_format_combobox->addItem(l_current_format);
ui_log_timestamp_format_combobox->addItem("h:mm:ss AP");
ui_log_timestamp_format_combobox->addItem("hh:mm:ss");
ui_log_timestamp_format_combobox->addItem("h:mm AP");
ui_log_timestamp_format_combobox->addItem("hh:mm");
ui_log_timestamp_format_combobox->addItem(l_current_format, l_current_format);
ui_log_timestamp_format_combobox->addItem("h:mm:ss AP", "h:mm:ss AP");
ui_log_timestamp_format_combobox->addItem("hh:mm:ss", "hh:mm:ss");
ui_log_timestamp_format_combobox->addItem("h:mm AP", "h:mm AP");
ui_log_timestamp_format_combobox->addItem("hh:mm", "hh:mm");

if (!Options::getInstance().logTimestampEnabled()) {
ui_log_timestamp_format_combobox->setDisabled(true);
Expand Down

0 comments on commit be07e49

Please sign in to comment.