diff options
author | Priton-CE <thies.eric@gmail.com> | 2024-09-21 00:30:58 +0200 |
---|---|---|
committer | Priton-CE <thies.eric@gmail.com> | 2024-09-21 00:30:58 +0200 |
commit | 08fff53a956deb437cac4f642b45eea03e2fbbde (patch) | |
tree | 9a7b099fb197cbc631694cb11ba7f689294336c0 | |
parent | 672cedcbe95bed07341f335b42e46b122032f8d6 (diff) |
fixed ui issues and tied a browse window the the proton prefix button
-rw-r--r-- | proto-wine/ftnoir_protocol_wine.h | 4 | ||||
-rw-r--r-- | proto-wine/ftnoir_protocol_wine_dialog.cpp | 20 | ||||
-rw-r--r-- | proto-wine/ftnoir_winecontrols.ui | 6 | ||||
-rw-r--r-- | proto-wine/lang/de_DE.ts | 4 | ||||
-rw-r--r-- | proto-wine/lang/nl_NL.ts | 4 | ||||
-rw-r--r-- | proto-wine/lang/ru_RU.ts | 4 | ||||
-rw-r--r-- | proto-wine/lang/stub.ts | 4 | ||||
-rw-r--r-- | 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 @@ </item> <item row="3" column="1"> <widget class="QComboBox" name="proton_version"> - <property name="enabled"> - <bool>false</bool> - </property> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> <horstretch>0</horstretch> @@ -178,9 +175,6 @@ </item> <item row="4" column="0" colspan="2"> <widget class="QGroupBox" name="proton_subgroup"> - <property name="enabled"> - <bool>false</bool> - </property> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="1"> <widget class="QSpinBox" name="proton_appid"> 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 @@ <source>Select Wine Prefix</source> <translation>wine-Prefix auswählen</translation> </message> + <message> + <source>Select Proton Prefix</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>UICFTControls</name> 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 @@ <source>Select Wine Prefix</source> <translation type="unfinished"></translation> </message> + <message> + <source>Select Proton Prefix</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>UICFTControls</name> 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 @@ <source>Select Wine Prefix</source> <translation type="unfinished"></translation> </message> + <message> + <source>Select Proton Prefix</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>UICFTControls</name> 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 @@ <source>Select Wine Prefix</source> <translation type="unfinished"></translation> </message> + <message> + <source>Select Proton Prefix</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>UICFTControls</name> 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 @@ <source>Select Wine Prefix</source> <translation type="unfinished"></translation> </message> + <message> + <source>Select Proton Prefix</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>UICFTControls</name> |