mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
On login page, clear aircraft/airline fields if model is not from DB
* discussion https://swift-project.slack.com/archives/CCV74GESV/p1543344801126700 * emulated driver settings allow non DB model for testing * use "showOverlayHTMLMessage"
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <QCompleter>
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -36,7 +37,7 @@ namespace BlackGui
|
||||
this->initCompleter();
|
||||
}
|
||||
|
||||
BlackMisc::Simulation::CAircraftModel CDbModelKeyCompleter::getAircraftModel() const
|
||||
CAircraftModel CDbModelKeyCompleter::getAircraftModel() const
|
||||
{
|
||||
return sGui->getWebDataServices()->getModelForModelString(this->text().toUpper().trimmed());
|
||||
}
|
||||
|
||||
@@ -248,14 +248,14 @@ namespace BlackGui
|
||||
{
|
||||
if (!this->validateAircraftValues())
|
||||
{
|
||||
this->showOverlayMessage(CStatusMessage(this).validationWarning("Invalid aircraft data, login not possible"), OverlayMessageMs);
|
||||
this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning("Invalid aircraft data, login not possible"), OverlayMessageMs);
|
||||
return;
|
||||
}
|
||||
|
||||
const CStatusMessageList pilotMsgs = ui->form_Pilot->validate();
|
||||
if (pilotMsgs.isFailure())
|
||||
{
|
||||
this->showOverlayMessage(CStatusMessage(this).validationWarning("Invalid pilot data, login not possible"), OverlayMessageMs);
|
||||
this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning("Invalid pilot data, login not possible"), OverlayMessageMs);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,6 @@ namespace BlackGui
|
||||
const CServer lastServer = m_networkSetup.getLastServer();
|
||||
if (!lastServer.isNull())
|
||||
{
|
||||
|
||||
ui->tw_Network->setCurrentWidget(
|
||||
lastServer.getServerType() == CServer::FSDServerVatsim ?
|
||||
ui->tb_NetworkVatsim : ui->tb_OtherServers);
|
||||
@@ -524,18 +523,17 @@ namespace BlackGui
|
||||
ui->le_SimulatorModel->setToolTip(model.asHtmlSummary());
|
||||
|
||||
// reset the model
|
||||
if (model.isLoadedFromDb())
|
||||
if (model.isLoadedFromDb() || (model.getAircraftIcaoCode().isLoadedFromDb() && model.getLivery().isLoadedFromDb()))
|
||||
{
|
||||
// full model from DB, take all values
|
||||
this->setGuiIcaoValues(model, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model.hasAircraftDesignator())
|
||||
{
|
||||
// typed in model, override unempty values only
|
||||
this->setGuiIcaoValues(model, true);
|
||||
}
|
||||
// no model data from DB
|
||||
ui->le_AircraftCombinedType->clear();
|
||||
ui->selector_AircraftIcao->clear();
|
||||
ui->selector_AirlineIcao->clear();
|
||||
}
|
||||
|
||||
const bool changedOwnAircraftCallsignPilot = this->updateOwnAircraftCallsignAndPilotFromGuiValues();
|
||||
@@ -646,7 +644,7 @@ namespace BlackGui
|
||||
|
||||
const CStatusMessage m = CStatusMessage(this, CStatusMessage::SeverityInfo, "Auto logoff in progress");
|
||||
const int delaySecs = 45;
|
||||
this->showOverlayMessage(m, qRound(1000 * delaySecs * 0.8));
|
||||
this->showOverlayHTMLMessage(m, qRound(1000 * delaySecs * 0.8));
|
||||
this->setLogoffCountdown(delaySecs);
|
||||
|
||||
emit this->requestLoginPage();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "ui_settingsswiftplugin.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::Settings;
|
||||
|
||||
namespace BlackGui
|
||||
@@ -55,9 +56,15 @@ namespace BlackGui
|
||||
|
||||
CSwiftPluginSettings CSettingsSwiftPlugin::getSettings() const
|
||||
{
|
||||
CAircraftModel model = ui->lep_OwnModel->getAircraftModel();
|
||||
if (!model.hasModelString())
|
||||
{
|
||||
model.setModelString(ui->lep_OwnModel->text());
|
||||
}
|
||||
|
||||
CSwiftPluginSettings settings;
|
||||
settings.setEmulatedSimulator(ui->comp_EmulatedSimulatorSelector->getValue());
|
||||
settings.setOwnModel(ui->lep_OwnModel->getAircraftModel());
|
||||
settings.setOwnModel(model);
|
||||
settings.setDefaultModel(ui->lep_DefaultModel->getAircraftModel());
|
||||
settings.setLoggingFunctionCalls(ui->cb_LogFunctionCalls->isChecked());
|
||||
return settings;
|
||||
|
||||
Reference in New Issue
Block a user