From a962ba08bae3b6d72c4974552db7768d1904579b Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Wed, 9 Aug 2023 21:12:05 +0200 Subject: [PATCH 1/2] Fix incorrect scaling check This entire system needs a refactor anyway, good enough^TM --- src/text_file_functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 8aba93f..9741128 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -153,7 +153,7 @@ Qt::TransformationMode AOApplication::get_scaling(QString p_scaling) if (p_scaling.isEmpty()) p_scaling = Options::getInstance().defaultScalingMode(); - if (p_scaling == "smooth") + if (p_scaling == "Smooth") return Qt::SmoothTransformation; return Qt::FastTransformation; } From 98682ae13f0c1d5d65c9614caae4d73603bad0bd Mon Sep 17 00:00:00 2001 From: lambdcalculus <64238778+lambdcalculus@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:06:30 -0300 Subject: [PATCH 2/2] fix options combobox behavior (#918) the combobox text, instead of data, was being saved to config --- src/text_file_functions.cpp | 2 +- src/widgets/aooptionsdialog.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 9741128..8aba93f 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -153,7 +153,7 @@ Qt::TransformationMode AOApplication::get_scaling(QString p_scaling) if (p_scaling.isEmpty()) p_scaling = Options::getInstance().defaultScalingMode(); - if (p_scaling == "Smooth") + if (p_scaling == "smooth") return Qt::SmoothTransformation; return Qt::FastTransformation; } diff --git a/src/widgets/aooptionsdialog.cpp b/src/widgets/aooptionsdialog.cpp index 8b7befe..ab8269c 100644 --- a/src/widgets/aooptionsdialog.cpp +++ b/src/widgets/aooptionsdialog.cpp @@ -40,7 +40,7 @@ void AOOptionsDialog::populateAudioDevices() BASS_DEVICEINFO info; for (int a = 0; BASS_GetDeviceInfo(a, &info); a++) { - ui_audio_device_combobox->addItem(info.name); + ui_audio_device_combobox->addItem(info.name, info.name); } } @@ -116,7 +116,7 @@ void AOOptionsDialog::setWidgetData(QComboBox *widget, const QString &value) template <> QString AOOptionsDialog::widgetData(QComboBox *widget) const { - return widget->currentText(); + return widget->currentData().toString(); } template <> @@ -185,7 +185,7 @@ void AOOptionsDialog::updateValues() for (const QString &l_theme : qAsConst(l_themes)) { if (!themes.contains(l_theme)) { - ui_theme_combobox->addItem(l_theme); + ui_theme_combobox->addItem(l_theme, l_theme); themes.insert(l_theme); } } @@ -197,7 +197,7 @@ void AOOptionsDialog::updateValues() for (const QString &l_subtheme : qAsConst(l_subthemes)) { if (l_subtheme.toLower() != "server" && l_subtheme.toLower() != "default" && l_subtheme.toLower() != "effects" && l_subtheme.toLower() != "misc") { - ui_subtheme_combobox->addItem(l_subtheme); + ui_subtheme_combobox->addItem(l_subtheme, l_subtheme); } } @@ -259,8 +259,8 @@ void AOOptionsDialog::themeChanged(int i) { ui_subtheme_combobox->clear(); // Fill the combobox with the names of the themes. - ui_subtheme_combobox->addItem("server"); - ui_subtheme_combobox->addItem("default"); + ui_subtheme_combobox->addItem("server", "server"); + ui_subtheme_combobox->addItem("default", "server"); QStringList l_subthemes = QDir(ao_app->get_real_path(ao_app->get_theme_path( "", ui_theme_combobox->itemText(i)))) @@ -270,7 +270,7 @@ void AOOptionsDialog::themeChanged(int i) if (l_subthemes.toLower() != "server" && l_subthemes.toLower() != "default" && l_subthemes.toLower() != "effects" && l_subthemes.toLower() != "misc") { - ui_subtheme_combobox->addItem(l_subthemes); + ui_subtheme_combobox->addItem(l_subthemes, l_subthemes); } }