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_dialog.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'proto-wine/ftnoir_protocol_wine_dialog.cpp') 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