summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPriton-CE <thies.eric@gmail.com>2024-10-02 22:44:05 +0200
committerPriton-CE <thies.eric@gmail.com>2024-10-02 22:44:05 +0200
commitf833f84bb1735f169b5d42616e48cde0e605ac85 (patch)
treedf740af2694ca16cd5c1e25b0d6c0751f8825dc3
parent068acfc2658733a1156bbc115c713f1b371a834e (diff)
implemented requested change: use combo data instead of text
-rw-r--r--proto-wine/ftnoir_protocol_wine.h2
-rw-r--r--proto-wine/ftnoir_protocol_wine_dialog.cpp9
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 <QFileDialog>
#include <QDir>
#include <QDirIterator>
+#include <qcombobox.h>
#include <qdebug.h>
#include <qdir.h>
#include <qradiobutton.h>
@@ -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);
}