From 9ed96e067aa6463d82197c4654028876fa15b763 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Fri, 20 Sep 2024 22:35:46 +0200 Subject: restructured proto-wine ui (incl. German translation) --- proto-wine/ftnoir_winecontrols.ui | 281 +++++++++++++++++++++++--------------- proto-wine/lang/de_DE.ts | 24 ++-- proto-wine/lang/nl_NL.ts | 28 ++-- proto-wine/lang/ru_RU.ts | 28 ++-- proto-wine/lang/stub.ts | 28 ++-- proto-wine/lang/zh_CN.ts | 28 ++-- 6 files changed, 250 insertions(+), 167 deletions(-) diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index 365922ca..1e56999a 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,8 +9,8 @@ 0 0 - 951 - 424 + 955 + 468 @@ -32,86 +32,8 @@ Wine variant - - - - - - 0 - 0 - - - - Proton (Steam Play) - - - - - - - - 0 - 0 - - - - Wine (select path and prefix) - - - - - - - - 0 - 0 - - - - - 120 - 0 - - - - Qt::LeftToRight - - - - - - - - - - 0 - 0 - - - - - 450 - 0 - - - - <html><head/><body><p>prefix</p></body></html> - - - /path_to_the_prefix/ - - - - - - - Browse Prefix - - - - - - + + @@ -146,6 +68,12 @@ false + + + 0 + 0 + + Browse Wine Path @@ -153,8 +81,169 @@ + + + + + + + + + 0 + 0 + + + + + 450 + 0 + + + + <html><head/><body><p>prefix</p></body></html> + + + /path_to_the_prefix/ + + + + + + + Browse Prefix + + + + + + + + + + + + 0 + 0 + + + + + 120 + 0 + + + + Qt::LeftToRight + + + + + + + + 0 + 0 + + + + Proton (select version and mode) + + + + + + + + 0 + 0 + + + + Wine (select version and prefix) + + + - + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + 2147483647 + + + + + + + Steam Play (select Steam Application ID) + + + + + + + UMU enabled Launchers (select prefix) + + + + + + + + + + 0 + 0 + + + + + 450 + 0 + + + + + + + + + 0 + 0 + + + + + 105 + 0 + + + + Browse Prefix + + + + + + + @@ -271,32 +360,6 @@ 0 - - - - - 0 - 0 - - - - Steam application id - - - - - - - - 0 - 0 - - - - 2147483647 - - - diff --git a/proto-wine/lang/de_DE.ts b/proto-wine/lang/de_DE.ts index 9169570f..89a4f759 100644 --- a/proto-wine/lang/de_DE.ts +++ b/proto-wine/lang/de_DE.ts @@ -22,14 +22,6 @@ Wine variant Wine-Variante - - Proton (Steam Play) - Proton (Steam Play) - - - Wine (select path and prefix) - Wine (Pfad und Prefix auswählen) - <html><head/><body><p>prefix</p></body></html> <html><head/><body><p>Prefix</p></body></html> @@ -83,8 +75,20 @@ Beides - Steam application id - Steam-Application-ID + Proton (select version and mode) + Proton (wähle Version und Modus) + + + Steam Play (select Steam Application ID) + Steam Play (wähle Steam Applikation ID) + + + UMU enabled Launchers (select prefix) + UMU unterstützte Launcher (wähle Prefix) + + + Wine (select version and prefix) + Wine (wähle Version und Prefix) diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index 0298092b..76d76d6c 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -38,14 +38,6 @@ <html><head/><body><p>When supported.</p></body></html> - - Steam application id - - - - Proton (Steam Play) - - Protocol @@ -62,10 +54,6 @@ Both - - Wine (select path and prefix) - - <html><head/><body><p>prefix</p></body></html> @@ -86,6 +74,22 @@ Browse Wine Path + + Proton (select version and mode) + + + + Steam Play (select Steam Application ID) + + + + UMU enabled Launchers (select prefix) + + + + Wine (select version and prefix) + + wine diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index c7e9c52e..e66b767d 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -38,14 +38,6 @@ <html><head/><body><p>When supported.</p></body></html> - - Steam application id - - - - Proton (Steam Play) - - Protocol @@ -62,10 +54,6 @@ Both - - Wine (select path and prefix) - - <html><head/><body><p>prefix</p></body></html> @@ -86,6 +74,22 @@ Browse Wine Path + + Proton (select version and mode) + + + + Steam Play (select Steam Application ID) + + + + UMU enabled Launchers (select prefix) + + + + Wine (select version and prefix) + + wine diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index 3366b44b..4515eac5 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -38,14 +38,6 @@ <html><head/><body><p>When supported.</p></body></html> - - Steam application id - - - - Proton (Steam Play) - - Protocol @@ -62,10 +54,6 @@ Both - - Wine (select path and prefix) - - <html><head/><body><p>prefix</p></body></html> @@ -86,6 +74,22 @@ Browse Wine Path + + Proton (select version and mode) + + + + Steam Play (select Steam Application ID) + + + + UMU enabled Launchers (select prefix) + + + + Wine (select version and prefix) + + wine diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index 0d285c7c..f2a14ac6 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -38,14 +38,6 @@ <html><head/><body><p>When supported.</p></body></html> - - Steam application id - - - - Proton (Steam Play) - - Protocol @@ -62,10 +54,6 @@ Both - - Wine (select path and prefix) - - <html><head/><body><p>prefix</p></body></html> @@ -86,6 +74,22 @@ Browse Wine Path + + Proton (select version and mode) + + + + Steam Play (select Steam Application ID) + + + + UMU enabled Launchers (select prefix) + + + + Wine (select version and prefix) + + wine -- cgit v1.2.3 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.h | 8 +++- proto-wine/ftnoir_protocol_wine_dialog.cpp | 74 ++++++++++++++++++++++++++---- proto-wine/ftnoir_winecontrols.ui | 12 +++-- 3 files changed, 79 insertions(+), 15 deletions(-) diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index f79f65dc..b6d61e58 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -19,8 +19,10 @@ using namespace options; struct settings : opts { settings() : opts{"proto-wine"} {} - value variant_proton{b, "variant-proton", false }, - variant_wine{b, "variant-wine", true }, + value variant_wine{b, "variant-wine", true }, + variant_proton{b, "variant-proton", false }, + variant_proton_steamplay{b, "variant-proton-steamplay", true }, + variant_proton_external{b, "variant-proton-external", false }, fsync{b, "fsync", true}, esync{b, "esync", true}; @@ -29,6 +31,7 @@ struct settings : opts value wine_select_path{b, "wine-select-version", {"WINE"}}; value wine_custom_path{b, "wine-custom-version", ""}; value wineprefix{b, "wineprefix", "~/.wine/"}; + value protonprefix{b, "protonprefix", ""}; value protocol{b, "protocol", 2}; }; @@ -80,6 +83,7 @@ private: private slots: void onWinePathComboUpdated(QString selection); + void onRadioButtonsChanged(); void doBrowseWine(); void doBrowsePrefix(); 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); diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index 1e56999a..3e7d26ea 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -120,6 +120,9 @@ + + false + 0 @@ -174,7 +177,10 @@ - + + + false + @@ -197,7 +203,7 @@ - + UMU enabled Launchers (select prefix) @@ -222,7 +228,7 @@ - + 0 -- 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(-) 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 d26792e3c9f26365ceb7ef5163604d74c3028967 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Fri, 20 Sep 2024 23:15:22 +0200 Subject: added tooltips and german translation --- proto-wine/ftnoir_winecontrols.ui | 6 ++++++ proto-wine/lang/de_DE.ts | 8 ++++++++ proto-wine/lang/nl_NL.ts | 8 ++++++++ proto-wine/lang/ru_RU.ts | 8 ++++++++ proto-wine/lang/stub.ts | 8 ++++++++ proto-wine/lang/zh_CN.ts | 8 ++++++++ 6 files changed, 46 insertions(+) diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index 3e7d26ea..da0b7926 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -197,6 +197,9 @@ + + <html><head/><body><p>Steam Play is Steams System to run Windows titles on Linux via Proton.</p></body></html> + Steam Play (select Steam Application ID) @@ -204,6 +207,9 @@ + + <html><head/><body><p>UMU is a launcher that allows the use of Proton outside of Steam. Some game launchers like Lutris may use this to enable Proton support.</p></body></html> + UMU enabled Launchers (select prefix) diff --git a/proto-wine/lang/de_DE.ts b/proto-wine/lang/de_DE.ts index 89a4f759..e248dfac 100644 --- a/proto-wine/lang/de_DE.ts +++ b/proto-wine/lang/de_DE.ts @@ -90,6 +90,14 @@ Wine (select version and prefix) Wine (wähle Version und Prefix) + + <html><head/><body><p>Steam Play is Steams System to run Windows titles on Linux via Proton.</p></body></html> + <html><head/><body><p>Steam Play ist Steams System, um Windows Titel auf Linux, via Proton, auszuführen.</p></body></html> + + + <html><head/><body><p>UMU is a launcher that allows the use of Proton outside of Steam. Some game launchers like Lutris may use this to enable Proton support.</p></body></html> + <html><head/><body><p>UMU ist ein Launcher, der es erlaubt Proton außerhalb von Steam zu nutzen. Manche Spiel Launcher, wie Lutris, können dies für Proton Support nutzen.</p></body></html> + wine diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index 76d76d6c..b59527ab 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -90,6 +90,14 @@ Wine (select version and prefix) + + <html><head/><body><p>Steam Play is Steams System to run Windows titles on Linux via Proton.</p></body></html> + + + + <html><head/><body><p>UMU is a launcher that allows the use of Proton outside of Steam. Some game launchers like Lutris may use this to enable Proton support.</p></body></html> + + wine diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index e66b767d..aa401a05 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -90,6 +90,14 @@ Wine (select version and prefix) + + <html><head/><body><p>Steam Play is Steams System to run Windows titles on Linux via Proton.</p></body></html> + + + + <html><head/><body><p>UMU is a launcher that allows the use of Proton outside of Steam. Some game launchers like Lutris may use this to enable Proton support.</p></body></html> + + wine diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index 4515eac5..55d7e0b0 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -90,6 +90,14 @@ Wine (select version and prefix) + + <html><head/><body><p>Steam Play is Steams System to run Windows titles on Linux via Proton.</p></body></html> + + + + <html><head/><body><p>UMU is a launcher that allows the use of Proton outside of Steam. Some game launchers like Lutris may use this to enable Proton support.</p></body></html> + + wine diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index f2a14ac6..561aba31 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -90,6 +90,14 @@ Wine (select version and prefix) + + <html><head/><body><p>Steam Play is Steams System to run Windows titles on Linux via Proton.</p></body></html> + + + + <html><head/><body><p>UMU is a launcher that allows the use of Proton outside of Steam. Some game launchers like Lutris may use this to enable Proton support.</p></body></html> + + wine -- 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(-) 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(-) 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(-) 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 7d69af6b32a691e98827ea10315a456a07990fac Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 01:00:42 +0200 Subject: added handling for custom proton prefixes and cleaned up the wine protocol init procedure --- proto-wine/ftnoir_protocol_wine.cpp | 94 ++++++++++++++++++++++++++++--------- 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 ++ proto-wine/proton.cpp | 31 ++++++------ proto-wine/proton.h | 7 +++ 8 files changed, 116 insertions(+), 36 deletions(-) create mode 100644 proto-wine/proton.h diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index b70b3f16..47d37aeb 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -1,4 +1,5 @@ #include "ftnoir_protocol_wine.h" +#include #ifndef OTR_WINE_NO_WRAPPER # include "csv/csv.h" #endif @@ -10,6 +11,8 @@ #include #include +#include "proton.h" + wine::wine() = default; wine::~wine() @@ -63,50 +66,90 @@ module_status wine::initialize() #ifndef OTR_WINE_NO_WRAPPER static const QString library_path(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH); + ///////////////////////// + // determine wine path // + ///////////////////////// QString wine_path = "wine"; - if (s.wine_select_path().toString() != "WINE") { - // if we are not supposed to use system wine then: - if (s.wine_select_path().toString() != "CUSTOM") { - // if we don't have a custom path then change the wine_path to the path corresponding to the selected version - wine_path = s.wine_select_path().toString(); - } - else if (!s.wine_custom_path->isEmpty()) { - // if we do have a custom path and it is not empty then - wine_path = s.wine_custom_path; + + if (s.variant_wine) { + // NORMAL WINE + + // resolve combo box + if (s.wine_select_path().toString() != "WINE") { + // if we are not supposed to use system wine then: + if (s.wine_select_path().toString() != "CUSTOM") { + // if we don't have a custom path then change the wine_path to the path corresponding to the selected version + wine_path = s.wine_select_path().toString(); + } + else if (!s.wine_custom_path->isEmpty()) { + // if we do have a custom path and it is not empty then + wine_path = s.wine_custom_path; + } } + + // parse tilde if present + if (wine_path[0] == '~') + wine_path = qgetenv("HOME") + wine_path.mid(1); } - if (wine_path[0] == '~') - wine_path = qgetenv("HOME") + wine_path.mid(1); + else if (s.variant_proton) + { + // PROTON + wine_path = s.proton_path().toString() + "/bin/wine"; + } qDebug() << "proto/wine: wine_path:" << wine_path; - auto env = QProcessEnvironment::systemEnvironment(); + ///////////////////////////////////// + // determine environment variables // + ///////////////////////////////////// + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + + // if proton is used setup proton environment if (s.variant_proton) { if (s.proton_appid == 0) return error(tr("Must specify application id for Proton (Steam Play)")); - std::tuple make_steam_environ(const QString& proton_dist_path, int appid); - QString proton_path(const QString& proton_dist_path); + auto [proton_env, env_error_string, env_success] = make_steam_environ(s.proton_path().toString()); + env = proton_env; - QString proton_dist_path = s.proton_path().toString(); + if (!env_success) + return error(env_error_string); + } - wine_path = proton_path(proton_dist_path); - auto [proton_env, error_string, success] = make_steam_environ(proton_dist_path, s.proton_appid); - env = proton_env; + // determine wineprefix + if (s.variant_proton && s.variant_proton_steamplay) { + // wine prefix is dependend on steam + + auto [prefix, error_string, success] = make_wineprefix(s.proton_appid); + env.insert("WINEPREFIX", prefix); if (!success) return error(error_string); } - else - { - QString wineprefix = "~/.wine"; - if (!s.wineprefix->isEmpty()) + else { + // wine prefix was supplied via path + + QString wineprefix = ""; + + // check if prefix was supplied via wine + if (s.variant_wine && !s.wineprefix->isEmpty()) wineprefix = s.wineprefix; + + // check if prefix was supplied via proton + if (s.variant_proton_external && !s.protonprefix->isEmpty()) + wineprefix = s.protonprefix; + + // check if the user specified a prefix anywhere + if (wineprefix.isEmpty()) + return error(tr("Prefix has not been defined!").arg(wineprefix)); + + // handle tilde if (wineprefix[0] == '~') wineprefix = qgetenv("HOME") + wineprefix.mid(1); + // return error if relative path is given if (wineprefix[0] != '/') return error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix)); @@ -115,13 +158,20 @@ module_status wine::initialize() env.insert("WINEPREFIX", wineprefix); } + // ESYNC and FSYNC if (s.esync) env.insert("WINEESYNC", "1"); if (s.fsync) env.insert("WINEFSYNC", "1"); + // Headtracking Protocol env.insert("OTR_WINE_PROTO", QString::number(s.protocol+1)); + + //////////////////////////////// + // launch the wrapper program // + //////////////////////////////// + wrapper.setProcessEnvironment(env); wrapper.setWorkingDirectory(OPENTRACK_BASE_PATH); wrapper.start(wine_path, { library_path + "opentrack-wrapper-wine.exe.so" }); diff --git a/proto-wine/lang/de_DE.ts b/proto-wine/lang/de_DE.ts index d39458d0..072c8626 100644 --- a/proto-wine/lang/de_DE.ts +++ b/proto-wine/lang/de_DE.ts @@ -121,6 +121,10 @@ Can't open shared memory mapping Shared-Memory-Mapping kann nicht geöffnet werden + + Prefix has not been defined! + + wine_metadata diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index 5cfc99f5..bc3ef604 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -121,6 +121,10 @@ Failed to start Wine! Make sure the binary is set correctly. + + Prefix has not been defined! + + wine_metadata diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index 40c154c6..a7702454 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -121,6 +121,10 @@ Failed to start Wine! Make sure the binary is set correctly. + + Prefix has not been defined! + + wine_metadata diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index 5769bfd8..2c708749 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -121,6 +121,10 @@ Failed to start Wine! Make sure the binary is set correctly. + + Prefix has not been defined! + + wine_metadata diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index db23f8e8..6884f266 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -121,6 +121,10 @@ Failed to start Wine! Make sure the binary is set correctly. + + Prefix has not been defined! + + wine_metadata diff --git a/proto-wine/proton.cpp b/proto-wine/proton.cpp index aa2c3755..998da748 100644 --- a/proto-wine/proton.cpp +++ b/proto-wine/proton.cpp @@ -10,9 +10,9 @@ #include #include #include -#include #include +#include "proton.h" static const char* steam_paths[] = { "/.steam/steam/steamapps/compatdata", @@ -27,13 +27,13 @@ static const char* runtime_paths[] = { }; -std::tuple make_steam_environ(const QString& proton_dist_path, int appid) +std::tuple make_steam_environ(const QString& proton_dist_path) { using ret = std::tuple; auto env = QProcessEnvironment::systemEnvironment(); QString error = ""; QString home = qgetenv("HOME"); - QString runtime_path, app_wineprefix; + QString runtime_path; auto expand = [&](QString x) { x.replace("HOME", home); @@ -51,14 +51,6 @@ std::tuple make_steam_environ(const QString& if (runtime_path.isEmpty()) error = QString("Couldn't find a Steam runtime."); - for (const char* path : steam_paths) { - QDir dir(QDir::homePath() + path + expand("/%1/pfx").arg(appid)); - if (dir.exists()) - app_wineprefix = dir.absolutePath(); - } - if (app_wineprefix.isEmpty()) - error = QString("Couldn't find a Wineprefix for AppId %1").arg(appid); - QString path = expand( ":PROTON_DIST_PATH/bin" ); @@ -81,14 +73,25 @@ std::tuple make_steam_environ(const QString& ); library_path += ':'; library_path += qgetenv("LD_LIBRARY_PATH"); env.insert("LD_LIBRARY_PATH", library_path); - env.insert("WINEPREFIX", app_wineprefix); return ret(env, error, error.isEmpty()); } -QString proton_path(const QString& proton_dist_path) +std::tuple make_wineprefix(int appid) { - return proton_dist_path + "/bin/wine"; + using ret = std::tuple; + QString error = ""; + QString app_wineprefix; + for (const char* path : steam_paths) { + QDir dir(QDir::homePath() + path + QString("/%1/pfx").arg(appid)); + if (dir.exists()) + app_wineprefix = dir.absolutePath(); + } + if (app_wineprefix.isEmpty()) + error = QString("Couldn't find a Wineprefix for AppId %1").arg(appid); + + return ret(app_wineprefix, error, error.isEmpty()); } + #endif diff --git a/proto-wine/proton.h b/proto-wine/proton.h new file mode 100644 index 00000000..51539305 --- /dev/null +++ b/proto-wine/proton.h @@ -0,0 +1,7 @@ +#pragma once + +#include +#include + +std::tuple make_steam_environ(const QString& proton_dist_path); +std::tuple make_wineprefix(int appid); \ No newline at end of file -- cgit v1.2.3 From b0eaf978110d0c79813cb16bf17cfb7ba71d8ddb Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 01:21:19 +0200 Subject: added missing debug statement --- proto-wine/ftnoir_protocol_wine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index 47d37aeb..076cf797 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -123,6 +123,7 @@ module_status wine::initialize() // wine prefix is dependend on steam auto [prefix, error_string, success] = make_wineprefix(s.proton_appid); + qDebug() << "proto/wine: wineprefix:" << prefix; env.insert("WINEPREFIX", prefix); if (!success) @@ -171,7 +172,7 @@ module_status wine::initialize() //////////////////////////////// // launch the wrapper program // //////////////////////////////// - + wrapper.setProcessEnvironment(env); wrapper.setWorkingDirectory(OPENTRACK_BASE_PATH); wrapper.start(wine_path, { library_path + "opentrack-wrapper-wine.exe.so" }); -- cgit v1.2.3 From 359e19e1b1870965d30b70092c360639234e21f1 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 01:25:12 +0200 Subject: moved app id check into the correct if statement --- proto-wine/ftnoir_protocol_wine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index 076cf797..efe2cd40 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -108,9 +108,6 @@ module_status wine::initialize() // if proton is used setup proton environment if (s.variant_proton) { - if (s.proton_appid == 0) - return error(tr("Must specify application id for Proton (Steam Play)")); - auto [proton_env, env_error_string, env_success] = make_steam_environ(s.proton_path().toString()); env = proton_env; @@ -122,6 +119,9 @@ module_status wine::initialize() if (s.variant_proton && s.variant_proton_steamplay) { // wine prefix is dependend on steam + if (s.proton_appid == 0) + return error(tr("Must specify application id for Proton (Steam Play)")); + auto [prefix, error_string, success] = make_wineprefix(s.proton_appid); qDebug() << "proto/wine: wineprefix:" << prefix; env.insert("WINEPREFIX", prefix); -- cgit v1.2.3 From bc84e28daf41f108d5dfcec9f8de3b79fbb31d44 Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sat, 21 Sep 2024 01:31:09 +0200 Subject: removed unneded include --- proto-wine/ftnoir_protocol_wine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index efe2cd40..bae02b06 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -3,7 +3,6 @@ #ifndef OTR_WINE_NO_WRAPPER # include "csv/csv.h" #endif -#include "compat/library-path.hpp" #include #include @@ -121,7 +120,7 @@ module_status wine::initialize() if (s.proton_appid == 0) return error(tr("Must specify application id for Proton (Steam Play)")); - + auto [prefix, error_string, success] = make_wineprefix(s.proton_appid); qDebug() << "proto/wine: wineprefix:" << prefix; env.insert("WINEPREFIX", prefix); -- 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(-) 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(-) 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(+) 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(-) 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 From 4dd97af0f139f3ddc8f34a24ee961a1046015d3f Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Wed, 2 Oct 2024 22:48:44 +0200 Subject: fixed qt tab order --- proto-wine/ftnoir_winecontrols.ui | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index a97dac39..b601d6e5 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,8 +9,8 @@ 0 0 - 955 - 468 + 934 + 466 @@ -387,6 +387,24 @@ + + variant_wine + wine_path_combo + wine_path + browse_wine_path_button + wineprefix + browse_wine_prefix_button + variant_proton + proton_version + subvariant_steamplay + proton_appid + subvariant_external + protonprefix + browse_proton_prefix_button + esync + fsync + protocol_selection + -- cgit v1.2.3