From d1632977158ff5674df1ad4a047937daa5f0cf65 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 6 May 2014 13:25:02 +0200 Subject: [PATCH] Improved verification for ICAO codes (own aircraft) before user login --- samples/blackgui/mainwindow.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/samples/blackgui/mainwindow.cpp b/samples/blackgui/mainwindow.cpp index 9515b82ad..a167c1ff7 100644 --- a/samples/blackgui/mainwindow.cpp +++ b/samples/blackgui/mainwindow.cpp @@ -184,11 +184,14 @@ void MainWindow::toggleNetworkConnection() this->ui->lbl_StatusNetworkConnectedIcon->setPixmap(this->m_resPixmapConnectionConnecting); if (!this->getIContextNetwork()->isConnected()) { - if (this->m_ownAircraft.getCallsign().isEmpty()) - { - this->displayStatusMessage(CStatusMessage::getValidationError("missing callsign")); - return; - } + // validation of data here is not required, network context does this + // in prephase of login + this->m_ownAircraft.setCallsign(this->ui->le_SettingsAircraftCallsign->text()); + CAircraftIcao icao = this->m_ownAircraft.getIcaoInfo(); + icao.setAirlineDesignator(this->ui->le_SettingsIcaoAirlineDesignator->text()); + icao.setAircraftDesignator(this->ui->le_SettingsIcaoAircraftDesignator->text()); + icao.setAircraftCombinedType(this->ui->le_SettingsIcaoCombinedType->text()); + this->m_ownAircraft.setIcaoInfo(icao); // send latest aircraft to network/voice this->getIContextNetwork()->setOwnAircraft(this->m_ownAircraft);