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