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