From 5a17506a9787561beab690523feb96bffa300063 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 2 Jan 2016 21:10:05 +0100 Subject: [PATCH] refs #526, finetuning in 2 components --- .../components/dbaircrafticaoselectorcomponent.cpp | 8 ++++++-- src/blackgui/components/dbdebugdatabasesetup.cpp | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/blackgui/components/dbaircrafticaoselectorcomponent.cpp b/src/blackgui/components/dbaircrafticaoselectorcomponent.cpp index 3628470c5..ba236e141 100644 --- a/src/blackgui/components/dbaircrafticaoselectorcomponent.cpp +++ b/src/blackgui/components/dbaircrafticaoselectorcomponent.cpp @@ -75,8 +75,12 @@ namespace BlackGui CAircraftIcaoCode CDbAircraftIcaoSelectorComponent::getAircraftIcao() const { - int key = CDatastoreUtility::extractIntegerKey(this->ui->le_Aircraft->text()); - if (key < 0) { return CAircraftIcaoCode(); } + QString text(this->ui->le_Aircraft->text().trimmed().toUpper()); + int key = CDatastoreUtility::extractIntegerKey(text); + if (key < 0) + { + return CAircraftIcaoCode(text); + } CAircraftIcaoCode icao(getAircraftIcaoCodeForDbKey(key)); return icao; } diff --git a/src/blackgui/components/dbdebugdatabasesetup.cpp b/src/blackgui/components/dbdebugdatabasesetup.cpp index b8efe682c..0551f92b0 100644 --- a/src/blackgui/components/dbdebugdatabasesetup.cpp +++ b/src/blackgui/components/dbdebugdatabasesetup.cpp @@ -23,8 +23,16 @@ namespace BlackGui ui(new Ui::CDbDebugDatabaseSetup) { ui->setupUi(this); - this->setEnabled(CProject::isRunningInDeveloperEnvironment()); - connect(ui->cb_EnableServerDebugging, &QCheckBox::toggled, this, &CDbDebugDatabaseSetup::ps_debugChanged); + bool enabled = CProject::isRunningInDeveloperEnvironment(); + this->setEnabled(enabled); + if (!enabled) + { + this->setToolTip("Disabled, cannot be set!"); + } + else + { + connect(ui->cb_EnableServerDebugging, &QCheckBox::toggled, this, &CDbDebugDatabaseSetup::ps_debugChanged); + } } CDbDebugDatabaseSetup::~CDbDebugDatabaseSetup()