From eeced7f4878742b08a84fd00b166097182037409 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Fri, 20 Sep 2024 23:02:54 +0200 Subject: implemented logic to disable irrelevant ui components --- proto-wine/ftnoir_protocol_wine_dialog.cpp | 74 ++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 10 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index 23f82fda..70f62ea0 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -5,8 +5,10 @@ #include #include #include +#include #include "api/plugin-api.hpp" +#include "options/tie.hpp" /* * 0: path to the directory with wine versions @@ -28,7 +30,7 @@ FTControls::FTControls() { ui.setupUi(this); - //populate wine select + // populate wine select ui.wine_path_combo->addItem("System Wine", QVariant{"WINE"}); for (const char** path : wine_paths) { QDir dir(QDir::homePath() + path[0]); @@ -44,7 +46,7 @@ FTControls::FTControls() } ui.wine_path_combo->addItem("Custom path to Wine executable", QVariant{"CUSTOM"}); - //populate proton select + // populate proton select for (const char* path : proton_paths) { QDir dir(QDir::homePath() + path); dir.setFilter(QDir::Dirs); @@ -69,24 +71,39 @@ FTControls::FTControls() } } - - tie_setting(s.proton_path, ui.proton_version); - tie_setting(s.variant_wine, ui.variant_wine); - tie_setting(s.variant_proton, ui.variant_proton); + // settings - wine + // wine + tie_setting(s.variant_wine, ui.variant_wine); // radio button + tie_setting(s.wine_select_path, ui.wine_path_combo); // combo box (dropdown) + tie_setting(s.wine_custom_path, ui.wine_path); // line edit (enabled via dropdown) + tie_setting(s.wineprefix, ui.wineprefix); // line edit + + // settings - proton + tie_setting(s.variant_proton, ui.variant_proton); // radio button + tie_setting(s.proton_path, ui.proton_version); // combo box (dropdown) + tie_setting(s.variant_proton_steamplay, ui.subvariant_steamplay); // radio button + tie_setting(s.proton_appid, ui.proton_appid); // number select + tie_setting(s.variant_proton_external, ui.subvariant_external); // radio button + tie_setting(s.protonprefix, ui.protonprefix); // line edit + + // settings - advanced tie_setting(s.esync, ui.esync); tie_setting(s.fsync, ui.fsync); - tie_setting(s.proton_appid, ui.proton_appid); - tie_setting(s.wine_select_path, ui.wine_path_combo); - tie_setting(s.wine_custom_path, ui.wine_path); - tie_setting(s.wineprefix, ui.wineprefix); tie_setting(s.protocol, ui.protocol_selection); + // setup signals and slots for UI connect(ui.wine_path_combo, &QComboBox::currentTextChanged, this, &FTControls::onWinePathComboUpdated); connect(ui.browse_wine_path_button, &QPushButton::clicked, this, &FTControls::doBrowseWine); connect(ui.browse_wine_prefix_button, &QPushButton::clicked, this, &FTControls::doBrowsePrefix); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &FTControls::doOK); connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &FTControls::doCancel); + // setup signals and slots for UI radio buttons + connect(ui.variant_wine, &QRadioButton::clicked, this, &FTControls::onRadioButtonsChanged); + connect(ui.variant_proton, &QRadioButton::clicked, this, &FTControls::onRadioButtonsChanged); + connect(ui.subvariant_steamplay, &QRadioButton::clicked, this, &FTControls::onRadioButtonsChanged); + connect(ui.subvariant_external, &QRadioButton::clicked, this, &FTControls::onRadioButtonsChanged); + // update state of the combo box and associated ui elements onWinePathComboUpdated(ui.wine_path_combo->currentText()); } @@ -103,6 +120,43 @@ void FTControls::onWinePathComboUpdated(QString selection) { } } +void FTControls::onRadioButtonsChanged() { + if (ui.variant_wine->isChecked()) { + ui.wine_path_combo->setEnabled(true); + ui.wineprefix->setEnabled(true); + ui.browse_wine_prefix_button->setEnabled(true); + if (ui.wine_path_combo->currentText() == "Custom path to Wine executable") { + ui.wine_path->setEnabled(true); + ui.browse_wine_path_button->setEnabled(true); + } + + ui.proton_version->setEnabled(false); + ui.proton_subgroup->setEnabled(false); + } + else if (ui.variant_proton->isChecked()) { + ui.wine_path_combo->setEnabled(false); + ui.wine_path->setEnabled(false); + ui.wineprefix->setEnabled(false); + ui.browse_wine_prefix_button->setEnabled(false); + + ui.proton_version->setEnabled(true); + ui.proton_subgroup->setEnabled(true); + + if (ui.subvariant_steamplay->isChecked()) { + ui.proton_appid->setEnabled(true); + + ui.protonprefix->setEnabled(false); + ui.browse_proton_prefix_button->setEnabled(false); + } + else if (ui.subvariant_external->isChecked()) { + ui.proton_appid->setEnabled(false); + + ui.protonprefix->setEnabled(true); + ui.browse_proton_prefix_button->setEnabled(true); + } + } +} + void FTControls::doBrowseWine() { QFileDialog d(this); d.setFileMode(QFileDialog::FileMode::ExistingFile); -- cgit v1.2.3 From 986cc66dc47e2737b393d083607ca78057285655 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Fri, 20 Sep 2024 23:07:23 +0200 Subject: added comments and missing disable --- proto-wine/ftnoir_protocol_wine_dialog.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index 70f62ea0..0ca92358 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -72,7 +72,6 @@ FTControls::FTControls() } // settings - wine - // wine tie_setting(s.variant_wine, ui.variant_wine); // radio button tie_setting(s.wine_select_path, ui.wine_path_combo); // combo box (dropdown) tie_setting(s.wine_custom_path, ui.wine_path); // line edit (enabled via dropdown) @@ -122,6 +121,9 @@ void FTControls::onWinePathComboUpdated(QString selection) { void FTControls::onRadioButtonsChanged() { if (ui.variant_wine->isChecked()) { + // wine settings selected + + // enable wine settings ui.wine_path_combo->setEnabled(true); ui.wineprefix->setEnabled(true); ui.browse_wine_prefix_button->setEnabled(true); @@ -130,27 +132,38 @@ void FTControls::onRadioButtonsChanged() { ui.browse_wine_path_button->setEnabled(true); } + // disable proton settings ui.proton_version->setEnabled(false); ui.proton_subgroup->setEnabled(false); } else if (ui.variant_proton->isChecked()) { + // proton settings selected + + // disable wine settings ui.wine_path_combo->setEnabled(false); ui.wine_path->setEnabled(false); + ui.browse_wine_path_button->setEnabled(false); ui.wineprefix->setEnabled(false); ui.browse_wine_prefix_button->setEnabled(false); + // enable proton settings ui.proton_version->setEnabled(true); ui.proton_subgroup->setEnabled(true); + // run proton radio buttons logic if (ui.subvariant_steamplay->isChecked()) { + // enable steamplay settings ui.proton_appid->setEnabled(true); + // disable external settings ui.protonprefix->setEnabled(false); ui.browse_proton_prefix_button->setEnabled(false); } else if (ui.subvariant_external->isChecked()) { + // disable steamplay settings ui.proton_appid->setEnabled(false); + // enable external settinsg ui.protonprefix->setEnabled(true); ui.browse_proton_prefix_button->setEnabled(true); } -- cgit v1.2.3 From e640f65ae5b4686a65149eee4614d1eb6aa7e793 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Fri, 20 Sep 2024 23:27:13 +0200 Subject: improved name filters to be per directory --- proto-wine/ftnoir_protocol_wine_dialog.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index 0ca92358..967cfddb 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -20,10 +20,10 @@ static const char* wine_paths[][3] = { {"/.var/app/net.lutris.Lutris/data/lutris/runners/wine/", "/bin/wine", "Flatpak Lutris"} }; -static const char* proton_paths[] = { - "/.steam/steam/steamapps/common", - "/.steam/root/compatibilitytools.d", - "/.local/share/Steam/steamapps/common", +static const char* proton_paths[][2] = { + {"/.steam/steam/steamapps/common", "Proton*"}, + {"/.steam/root/compatibilitytools.d", "*"}, + {"/.local/share/Steam/steamapps/common", "Proton*"}, }; FTControls::FTControls() @@ -47,10 +47,10 @@ FTControls::FTControls() ui.wine_path_combo->addItem("Custom path to Wine executable", QVariant{"CUSTOM"}); // populate proton select - for (const char* path : proton_paths) { - QDir dir(QDir::homePath() + path); - dir.setFilter(QDir::Dirs); - dir.setNameFilters({ "Proton*" }); + for (const char** path : proton_paths) { + QDir dir(QDir::homePath() + path[0]); + dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); + dir.setNameFilters({ path[1] }); QFileInfoList proton_dir_list = dir.entryInfoList(); for (int i = 0; i < proton_dir_list.size(); ++i) { -- cgit v1.2.3 From 672cedcbe95bed07341f335b42e46b122032f8d6 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Fri, 20 Sep 2024 23:48:54 +0200 Subject: fixed an issue where proton versions would get added when already present --- proto-wine/ftnoir_protocol_wine_dialog.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index 967cfddb..13178a83 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -24,6 +24,7 @@ static const char* proton_paths[][2] = { {"/.steam/steam/steamapps/common", "Proton*"}, {"/.steam/root/compatibilitytools.d", "*"}, {"/.local/share/Steam/steamapps/common", "Proton*"}, + {"/.local/share/Steam/compatibilitytools.d", "*"}, }; FTControls::FTControls() @@ -55,7 +56,6 @@ FTControls::FTControls() QFileInfoList proton_dir_list = dir.entryInfoList(); for (int i = 0; i < proton_dir_list.size(); ++i) { const QFileInfo &proton_dir = proton_dir_list.at(i); - qDebug() << proton_dir.canonicalFilePath(); QDirIterator proton_executable_it(proton_dir.canonicalFilePath(), QStringList() << "wine", QDir::Files, QDirIterator::Subdirectories); @@ -64,9 +64,8 @@ FTControls::FTControls() QDir proton_dist_dir(proton_executable_path); proton_dist_dir.cd("../../"); - qDebug() << proton_dist_dir.canonicalPath(); - - ui.proton_version->addItem(proton_dir.fileName(), QVariant{proton_dist_dir.canonicalPath()}); + if (ui.proton_version->findData(QVariant{proton_dist_dir.canonicalPath()}) == -1) + ui.proton_version->addItem(proton_dir.fileName(), QVariant{proton_dist_dir.canonicalPath()}); } } } -- cgit v1.2.3 From 08fff53a956deb437cac4f642b45eea03e2fbbde Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 00:30:58 +0200 Subject: fixed ui issues and tied a browse window the the proton prefix button --- proto-wine/ftnoir_protocol_wine.h | 4 +++- proto-wine/ftnoir_protocol_wine_dialog.cpp | 20 ++++++++++++++++++-- proto-wine/ftnoir_winecontrols.ui | 6 ------ proto-wine/lang/de_DE.ts | 4 ++++ proto-wine/lang/nl_NL.ts | 4 ++++ proto-wine/lang/ru_RU.ts | 4 ++++ proto-wine/lang/stub.ts | 4 ++++ proto-wine/lang/zh_CN.ts | 4 ++++ 8 files changed, 41 insertions(+), 9 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index b6d61e58..2464d219 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -86,7 +86,9 @@ private slots: void onRadioButtonsChanged(); void doBrowseWine(); - void doBrowsePrefix(); + void doBrowseWinePrefix(); + + void doBrowseProtonPrefix(); void doOK(); void doCancel(); diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index 13178a83..3fbccd14 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -92,7 +92,8 @@ FTControls::FTControls() // setup signals and slots for UI connect(ui.wine_path_combo, &QComboBox::currentTextChanged, this, &FTControls::onWinePathComboUpdated); connect(ui.browse_wine_path_button, &QPushButton::clicked, this, &FTControls::doBrowseWine); - connect(ui.browse_wine_prefix_button, &QPushButton::clicked, this, &FTControls::doBrowsePrefix); + connect(ui.browse_wine_prefix_button, &QPushButton::clicked, this, &FTControls::doBrowseWinePrefix); + connect(ui.browse_proton_prefix_button, &QPushButton::clicked, this, &FTControls::doBrowseProtonPrefix); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &FTControls::doOK); connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &FTControls::doCancel); @@ -104,6 +105,8 @@ FTControls::FTControls() // update state of the combo box and associated ui elements onWinePathComboUpdated(ui.wine_path_combo->currentText()); + // hide the correct items + onRadioButtonsChanged(); } void FTControls::onWinePathComboUpdated(QString selection) { @@ -180,7 +183,7 @@ void FTControls::doBrowseWine() { s.wine_custom_path = d.selectedFiles()[0]; } } -void FTControls::doBrowsePrefix() { +void FTControls::doBrowseWinePrefix() { QFileDialog d(this); d.setFileMode(QFileDialog::FileMode::Directory); d.setOption(QFileDialog::Option::ShowDirsOnly, true); @@ -193,6 +196,19 @@ void FTControls::doBrowsePrefix() { } } +void FTControls::doBrowseProtonPrefix() { + QFileDialog d(this); + d.setFileMode(QFileDialog::FileMode::Directory); + d.setOption(QFileDialog::Option::ShowDirsOnly, true); + d.setWindowTitle(tr("Select Proton Prefix")); + if (s.protonprefix->startsWith("/") || s.protonprefix->startsWith("~")) { + d.selectFile(s.protonprefix); + } + if (d.exec()) { + s.protonprefix = d.selectedFiles()[0]; + } +} + void FTControls::doOK() { s.b->save(); diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index da0b7926..a97dac39 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -120,9 +120,6 @@ - - false - 0 @@ -178,9 +175,6 @@ - - false - diff --git a/proto-wine/lang/de_DE.ts b/proto-wine/lang/de_DE.ts index e248dfac..d39458d0 100644 --- a/proto-wine/lang/de_DE.ts +++ b/proto-wine/lang/de_DE.ts @@ -11,6 +11,10 @@ Select Wine Prefix wine-Prefix auswählen + + Select Proton Prefix + + UICFTControls diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index b59527ab..5cfc99f5 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -11,6 +11,10 @@ Select Wine Prefix + + Select Proton Prefix + + UICFTControls diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index aa401a05..40c154c6 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -11,6 +11,10 @@ Select Wine Prefix + + Select Proton Prefix + + UICFTControls diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index 55d7e0b0..5769bfd8 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -11,6 +11,10 @@ Select Wine Prefix + + Select Proton Prefix + + UICFTControls diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index 561aba31..db23f8e8 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -11,6 +11,10 @@ Select Wine Prefix + + Select Proton Prefix + + UICFTControls -- cgit v1.2.3 From d31d706ac4997f134a8ec584c249546f1a0fe7ce Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 16:12:10 +0200 Subject: improved wine settings dialog startup time --- proto-wine/ftnoir_protocol_wine_dialog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index 3fbccd14..2d1148a2 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -57,6 +57,11 @@ FTControls::FTControls() for (int i = 0; i < proton_dir_list.size(); ++i) { const QFileInfo &proton_dir = proton_dir_list.at(i); + // check if this Proton Version is already present in any way + // NOTE: placed here instead of in front of the addItem call to improve performance + if (ui.proton_version->findData(QVariant{proton_dir.canonicalPath()}) != -1) + continue; + QDirIterator proton_executable_it(proton_dir.canonicalFilePath(), QStringList() << "wine", QDir::Files, QDirIterator::Subdirectories); if (proton_executable_it.hasNext()) { @@ -64,8 +69,7 @@ FTControls::FTControls() QDir proton_dist_dir(proton_executable_path); proton_dist_dir.cd("../../"); - if (ui.proton_version->findData(QVariant{proton_dist_dir.canonicalPath()}) == -1) - ui.proton_version->addItem(proton_dir.fileName(), QVariant{proton_dist_dir.canonicalPath()}); + ui.proton_version->addItem(proton_dir.fileName(), QVariant{proton_dist_dir.canonicalPath()}); } } } -- cgit v1.2.3 From 1c0b371ab3d853d6bbd601afdafe242d2f5694d0 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 19:11:58 +0200 Subject: fixed duplicating proton versions again --- proto-wine/ftnoir_protocol_wine_dialog.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index 2d1148a2..d1887746 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -58,8 +58,7 @@ FTControls::FTControls() const QFileInfo &proton_dir = proton_dir_list.at(i); // check if this Proton Version is already present in any way - // NOTE: placed here instead of in front of the addItem call to improve performance - if (ui.proton_version->findData(QVariant{proton_dir.canonicalPath()}) != -1) + if (ui.proton_version->findText(proton_dir.fileName()) != -1) continue; QDirIterator proton_executable_it(proton_dir.canonicalFilePath(), QStringList() << "wine", QDir::Files, QDirIterator::Subdirectories); -- cgit v1.2.3 From 068acfc2658733a1156bbc115c713f1b371a834e Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 19:16:02 +0200 Subject: added a (hacky) fix to compensate for QTs broken autoexclusive --- proto-wine/ftnoir_protocol_wine_dialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index d1887746..b46ebbcb 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -173,6 +173,12 @@ void FTControls::onRadioButtonsChanged() { ui.browse_proton_prefix_button->setEnabled(true); } } + else { + // for some reason QTs auto exclusive feature is not always correctly working + // this is a somewhat hacky solution + ui.variant_wine->setChecked(ui.wine_path_combo->isEnabled()); + ui.variant_proton->setChecked(ui.proton_version->isEnabled()); + } } void FTControls::doBrowseWine() { -- cgit v1.2.3 From f833f84bb1735f169b5d42616e48cde0e605ac85 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Wed, 2 Oct 2024 22:44:05 +0200 Subject: implemented requested change: use combo data instead of text --- proto-wine/ftnoir_protocol_wine.h | 2 +- proto-wine/ftnoir_protocol_wine_dialog.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index 2464d219..718699ac 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -82,7 +82,7 @@ private: settings s; private slots: - void onWinePathComboUpdated(QString selection); + void onWinePathComboUpdated(); void onRadioButtonsChanged(); void doBrowseWine(); diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index b46ebbcb..2b7d08e0 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -107,14 +108,14 @@ FTControls::FTControls() connect(ui.subvariant_external, &QRadioButton::clicked, this, &FTControls::onRadioButtonsChanged); // update state of the combo box and associated ui elements - onWinePathComboUpdated(ui.wine_path_combo->currentText()); + onWinePathComboUpdated(); // hide the correct items onRadioButtonsChanged(); } -void FTControls::onWinePathComboUpdated(QString selection) { +void FTControls::onWinePathComboUpdated() { // enable the custom text field if required - if (selection == "Custom path to Wine executable") { + if (ui.wine_path_combo->currentData() == "CUSTOM") { ui.wine_path->setEnabled(true); ui.browse_wine_path_button->setEnabled(true); } @@ -132,7 +133,7 @@ void FTControls::onRadioButtonsChanged() { ui.wine_path_combo->setEnabled(true); ui.wineprefix->setEnabled(true); ui.browse_wine_prefix_button->setEnabled(true); - if (ui.wine_path_combo->currentText() == "Custom path to Wine executable") { + if (ui.wine_path_combo->currentData() == "CUSTOM") { ui.wine_path->setEnabled(true); ui.browse_wine_path_button->setEnabled(true); } -- cgit v1.2.3