mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 22:29:13 +08:00
refs #780, fixes login/flightplan preset
* empty airline is valid * sync with flightplan (new signal to indicate changed login values) * better preset of own model
This commit is contained in:
@@ -86,7 +86,7 @@ namespace BlackSample
|
|||||||
|
|
||||||
// User parsing
|
// User parsing
|
||||||
CUser user("12345", "Joe KING KGLC");
|
CUser user("12345", "Joe KING KGLC");
|
||||||
out << user.getRealName() << user.getHomebase() << endl;
|
out << user.getRealName() << user.getHomeBase() << endl;
|
||||||
|
|
||||||
// ATC List
|
// ATC List
|
||||||
CAtcStationList atcList;
|
CAtcStationList atcList;
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ namespace BlackGui
|
|||||||
ui(new Ui::CFlightPlanComponent)
|
ui(new Ui::CFlightPlanComponent)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
||||||
|
Q_ASSERT_X(sGui->hasWebDataServices(), Q_FUNC_INFO, "missing web services");
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@@ -119,7 +120,10 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (this->m_flightPlan.wasSentOrLoaded()) { return; } // when loaded or sent do not override
|
if (this->m_flightPlan.wasSentOrLoaded()) { return; } // when loaded or sent do not override
|
||||||
if (!sGui->getIContextOwnAircraft()) { return; }
|
if (!sGui->getIContextOwnAircraft()) { return; }
|
||||||
this->prefillWithAircraftData(sGui->getIContextOwnAircraft()->getOwnAircraft());
|
|
||||||
|
const CSimulatedAircraft ownAircraft(sGui->getIContextOwnAircraft()->getOwnAircraft());
|
||||||
|
this->prefillWithAircraftData(ownAircraft);
|
||||||
|
this->prefillWithUserData(ownAircraft.getPilot());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFlightPlanComponent::prefillWithAircraftData(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft)
|
void CFlightPlanComponent::prefillWithAircraftData(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft)
|
||||||
@@ -139,6 +143,18 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFlightPlanComponent::prefillWithUserData(const Network::CUser &user)
|
||||||
|
{
|
||||||
|
if (user.hasValidRealName())
|
||||||
|
{
|
||||||
|
ui->le_PilotsName->setText(user.getRealName());
|
||||||
|
}
|
||||||
|
if (user.hasHomeBase())
|
||||||
|
{
|
||||||
|
ui->le_PilotsHomeBase->setText(user.getHomeBase().getIcaoCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CFlightPlanComponent::fillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan)
|
void CFlightPlanComponent::fillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan)
|
||||||
{
|
{
|
||||||
ui->le_AlternateAirport->setText(flightPlan.getAlternateAirportIcao().asString());
|
ui->le_AlternateAirport->setText(flightPlan.getAlternateAirportIcao().asString());
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackmisc/aviation/flightplan.h"
|
#include "blackmisc/aviation/flightplan.h"
|
||||||
|
#include "blackmisc/network/user.h"
|
||||||
#include "blackmisc/identifier.h"
|
#include "blackmisc/identifier.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
|
|
||||||
@@ -52,6 +53,9 @@ namespace BlackGui
|
|||||||
//! Prefill with aircraft data
|
//! Prefill with aircraft data
|
||||||
void prefillWithAircraftData(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
|
void prefillWithAircraftData(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
|
||||||
|
|
||||||
|
//! Prefill with user data
|
||||||
|
void prefillWithUserData(const BlackMisc::Network::CUser &user);
|
||||||
|
|
||||||
//! Prefill with aircraft dara
|
//! Prefill with aircraft dara
|
||||||
void fillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan);
|
void fillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan);
|
||||||
|
|
||||||
|
|||||||
@@ -246,7 +246,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="lbl_PilotsNameAndHomebase">
|
<widget class="QLabel" name="lbl_PilotsNameAndHomeBase">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>14. Pilots name / homebase</string>
|
<string>14. Pilots name / homebase</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -447,7 +447,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="3">
|
<item row="9" column="3">
|
||||||
<widget class="QLineEdit" name="le_PilotsHomebase"/>
|
<widget class="QLineEdit" name="le_PilotsHomeBase"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="3">
|
<item row="6" column="3">
|
||||||
<widget class="QLabel" name="lbl_AlternateAirport">
|
<widget class="QLabel" name="lbl_AlternateAirport">
|
||||||
@@ -1027,7 +1027,7 @@
|
|||||||
<tabstop>pb_RemarksGenerator</tabstop>
|
<tabstop>pb_RemarksGenerator</tabstop>
|
||||||
<tabstop>pte_Remarks</tabstop>
|
<tabstop>pte_Remarks</tabstop>
|
||||||
<tabstop>le_PilotsName</tabstop>
|
<tabstop>le_PilotsName</tabstop>
|
||||||
<tabstop>le_PilotsHomebase</tabstop>
|
<tabstop>le_PilotsHomeBase</tabstop>
|
||||||
<tabstop>pb_Reset</tabstop>
|
<tabstop>pb_Reset</tabstop>
|
||||||
<tabstop>pb_Load</tabstop>
|
<tabstop>pb_Load</tabstop>
|
||||||
<tabstop>pb_Send</tabstop>
|
<tabstop>pb_Send</tabstop>
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ namespace BlackGui
|
|||||||
if (ownAircraft.getCallsign() != aircraftValues.ownCallsign)
|
if (ownAircraft.getCallsign() != aircraftValues.ownCallsign)
|
||||||
{
|
{
|
||||||
ownAircraft.setCallsign(aircraftValues.ownCallsign);
|
ownAircraft.setCallsign(aircraftValues.ownCallsign);
|
||||||
sGui->getIContextOwnAircraft()->updateOwnCallsign(ownAircraft.getCallsign());
|
this->updateOwnCallsignAndPilotFromGuiValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setIcaoCodes)
|
if (setIcaoCodes)
|
||||||
@@ -354,7 +354,7 @@ namespace BlackGui
|
|||||||
ui->le_Callsign->setText(lastUser.getCallsign().asString());
|
ui->le_Callsign->setText(lastUser.getCallsign().asString());
|
||||||
ui->le_VatsimId->setText(lastUser.getId());
|
ui->le_VatsimId->setText(lastUser.getId());
|
||||||
ui->le_VatsimPassword->setText(lastUser.getPassword());
|
ui->le_VatsimPassword->setText(lastUser.getPassword());
|
||||||
ui->le_VatsimHomeAirport->setText(lastUser.getHomebase().asString());
|
ui->le_VatsimHomeAirport->setText(lastUser.getHomeBase().asString());
|
||||||
ui->le_VatsimRealName->setText(lastUser.getRealName());
|
ui->le_VatsimRealName->setText(lastUser.getRealName());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -393,7 +393,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
CVatsimValues values = getVatsimValuesFromGui();
|
CVatsimValues values = getVatsimValuesFromGui();
|
||||||
CUser user(values.vatsimId, values.vatsimRealName, "", values.vatsimPassword, getCallsignFromGui());
|
CUser user(values.vatsimId, values.vatsimRealName, "", values.vatsimPassword, getCallsignFromGui());
|
||||||
user.setHomebase(values.vatsimHomeAirport);
|
user.setHomeBase(values.vatsimHomeAirport);
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,20 +450,29 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static const CAircraftModel defaultModel(
|
model = this->getPrefillModel();
|
||||||
"", CAircraftModel::TypeOwnSimulatorModel, "default model",
|
|
||||||
CAircraftIcaoCode("C172", "L1P", "Cessna", "172", "L", true, false, false, 0));
|
|
||||||
model = this->m_currentAircraftModel.get();
|
|
||||||
if (!model.hasAircraftDesignator()) { model = defaultModel; }
|
|
||||||
ui->gbp_LoginMode->setLoginMode(INetwork::LoginNormal); //! \todo Set observer mode without simulator, currently not working in OBS mode
|
ui->gbp_LoginMode->setLoginMode(INetwork::LoginNormal); //! \todo Set observer mode without simulator, currently not working in OBS mode
|
||||||
ui->le_SimulatorModel->setText("");
|
ui->le_SimulatorModel->setText("");
|
||||||
this->highlightModelField();
|
this->highlightModelField();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.hasAircraftDesignator())
|
// reset the model
|
||||||
|
if (model.isLoadedFromDb())
|
||||||
{
|
{
|
||||||
|
// full model from DB, take all values
|
||||||
this->setGuiIcaoValues(model, false);
|
this->setGuiIcaoValues(model, false);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (model.hasAircraftDesignator())
|
||||||
|
{
|
||||||
|
// typed in model, override unempty values only
|
||||||
|
this->setGuiIcaoValues(model, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this->updateOwnCallsignAndPilotFromGuiValue();
|
||||||
|
this->triggerDataChangedSignal(1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLoginComponent::setGuiIcaoValues(const CAircraftModel &model, bool onlyIfEmpty)
|
void CLoginComponent::setGuiIcaoValues(const CAircraftModel &model, bool onlyIfEmpty)
|
||||||
@@ -491,7 +500,8 @@ namespace BlackGui
|
|||||||
const bool validCombinedType = CAircraftIcaoCode::isValidCombinedType(values.ownAircraftCombinedType);
|
const bool validCombinedType = CAircraftIcaoCode::isValidCombinedType(values.ownAircraftCombinedType);
|
||||||
ui->lblp_AircraftCombinedType->setTicked(validCombinedType);
|
ui->lblp_AircraftCombinedType->setTicked(validCombinedType);
|
||||||
|
|
||||||
const bool validAirlineDesignator = values.ownAirlineIcao.hasValidDesignator();
|
// airline is optional, e.g. C172 has no airline
|
||||||
|
const bool validAirlineDesignator = values.ownAirlineIcao.hasValidDesignator() || values.ownAirlineIcao.getDesignator().isEmpty();
|
||||||
ui->lblp_AirlineIcao->setTicked(validAirlineDesignator);
|
ui->lblp_AirlineIcao->setTicked(validAirlineDesignator);
|
||||||
|
|
||||||
const bool validAircraftDesignator = values.ownAircraftIcao.hasValidDesignator();
|
const bool validAircraftDesignator = values.ownAircraftIcao.hasValidDesignator();
|
||||||
@@ -566,6 +576,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CLoginComponent::ps_simulatorModelChanged(const CAircraftModel &model)
|
void CLoginComponent::ps_simulatorModelChanged(const CAircraftModel &model)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(sGui && sGui->getIContextNetwork(), Q_FUNC_INFO, "Missing context");
|
||||||
const bool isConnected = sGui && sGui->getIContextNetwork()->isConnected();
|
const bool isConnected = sGui && sGui->getIContextNetwork()->isConnected();
|
||||||
if (isConnected) { return; }
|
if (isConnected) { return; }
|
||||||
const QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>");
|
const QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>");
|
||||||
@@ -581,6 +592,12 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
this->ps_mappingWizard();
|
this->ps_mappingWizard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check state of own aircraft
|
||||||
|
this->updateOwnCallsignAndPilotFromGuiValue();
|
||||||
|
|
||||||
|
// let others know data changed
|
||||||
|
this->triggerDataChangedSignal(1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLoginComponent::ps_mappingWizard()
|
void CLoginComponent::ps_mappingWizard()
|
||||||
@@ -647,5 +664,54 @@ namespace BlackGui
|
|||||||
static const QString sheet("background-color: %1;");
|
static const QString sheet("background-color: %1;");
|
||||||
ui->le_SimulatorModel->setStyleSheet(sheet.arg(color));
|
ui->le_SimulatorModel->setStyleSheet(sheet.arg(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLoginComponent::triggerDataChangedSignal(int deferTimeMs)
|
||||||
|
{
|
||||||
|
QTimer::singleShot(deferTimeMs, this, &CLoginComponent::loginDataChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
CAircraftModel CLoginComponent::getPrefillModel() const
|
||||||
|
{
|
||||||
|
// if all fails
|
||||||
|
static const CAircraftModel defaultModel(
|
||||||
|
"", CAircraftModel::TypeOwnSimulatorModel, "default model",
|
||||||
|
CAircraftIcaoCode("C172", "L1P", "Cessna", "172", "L", true, false, false, 0));
|
||||||
|
|
||||||
|
CAircraftModel model = this->m_currentAircraftModel.get();
|
||||||
|
if (model.hasAircraftDesignator()) { return model; }
|
||||||
|
|
||||||
|
// create one from DB data
|
||||||
|
if (sGui && sGui->hasWebDataServices())
|
||||||
|
{
|
||||||
|
const CAircraftIcaoCode icao = sGui->getWebDataServices()->getAircraftIcaoCodeForDesignator("C172");
|
||||||
|
const CLivery livery = sGui->getWebDataServices()->getLiveryForCombinedCode("_CC_WHITE_WHITE");
|
||||||
|
model = CAircraftModel("", CAircraftModel::TypeOwnSimulatorModel);
|
||||||
|
model.setLivery(livery);
|
||||||
|
model.setAircraftIcaoCode(icao);
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
return defaultModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CLoginComponent::updateOwnCallsignAndPilotFromGuiValue()
|
||||||
|
{
|
||||||
|
if (!sGui || !sGui->getIContextOwnAircraft()) { return; }
|
||||||
|
const CSimulatedAircraft ownAircaft(sGui->getIContextOwnAircraft()->getOwnAircraft());
|
||||||
|
const QString cs(ui->le_Callsign->text().trimmed().toUpper());
|
||||||
|
if (!cs.isEmpty() && ownAircaft.getCallsignAsString() != cs)
|
||||||
|
{
|
||||||
|
sGui->getIContextOwnAircraft()->updateOwnCallsign(CCallsign(cs));
|
||||||
|
}
|
||||||
|
CUser pilot = ownAircaft.getPilot();
|
||||||
|
pilot.setRealName(CUser::beautifyRealName(ui->le_VatsimRealName->text()));
|
||||||
|
pilot.setHomeBase(CAirportIcaoCode(ui->le_VatsimHomeAirport->text()));
|
||||||
|
pilot.setId(ui->le_VatsimId->text());
|
||||||
|
pilot.setCallsign(CCallsign(cs));
|
||||||
|
if (ownAircaft.getPilot() != pilot)
|
||||||
|
{
|
||||||
|
sGui->getIContextOwnAircraft()->updateOwnAircraftPilot(pilot);
|
||||||
|
}
|
||||||
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ namespace BlackGui
|
|||||||
//! Request network settings
|
//! Request network settings
|
||||||
void requestNetworkSettings();
|
void requestNetworkSettings();
|
||||||
|
|
||||||
|
//! Relevant login data changed
|
||||||
|
void loginDataChanged();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Main info area chnaged
|
//! Main info area chnaged
|
||||||
void mainInfoAreaChanged(const QWidget *currentWidget);
|
void mainInfoAreaChanged(const QWidget *currentWidget);
|
||||||
@@ -181,11 +184,20 @@ namespace BlackGui
|
|||||||
//! Highlight model field according to model data
|
//! Highlight model field according to model data
|
||||||
void highlightModelField(const BlackMisc::Simulation::CAircraftModel &model = {});
|
void highlightModelField(const BlackMisc::Simulation::CAircraftModel &model = {});
|
||||||
|
|
||||||
|
//! Trigger the signal that data have been changed
|
||||||
|
void triggerDataChangedSignal(int deferTimeMs);
|
||||||
|
|
||||||
|
//! Get a prefill model
|
||||||
|
BlackMisc::Simulation::CAircraftModel getPrefillModel() const;
|
||||||
|
|
||||||
|
//! Update own callsign (own aircraft from what is set in the GUI)
|
||||||
|
void updateOwnCallsignAndPilotFromGuiValue();
|
||||||
|
|
||||||
QScopedPointer<Ui::CLoginComponent> ui;
|
QScopedPointer<Ui::CLoginComponent> ui;
|
||||||
QScopedPointer<CDbQuickMappingWizard> m_mappingWizard;
|
QScopedPointer<CDbQuickMappingWizard> m_mappingWizard;
|
||||||
bool m_autoPopupWizard = false; //!< automatically popup wizard if mapping is needed
|
bool m_autoPopupWizard = false; //!< automatically popup wizard if mapping is needed
|
||||||
bool m_visible = false; //!< is this component selected?
|
bool m_visible = false; //!< is this component selected?
|
||||||
const int LogoffIntervalSeconds = 10; //!< time before logoff
|
const int LogoffIntervalSeconds = 20; //!< time before logoff
|
||||||
QTimer *m_logoffCountdownTimer { nullptr }; //!< timer used logoff countdown
|
QTimer *m_logoffCountdownTimer { nullptr }; //!< timer used logoff countdown
|
||||||
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TTrafficServers> m_otherTrafficNetworkServers { this, &CLoginComponent::ps_reloadSettings };
|
BlackMisc::CSettingReadOnly<BlackCore::Vatsim::TTrafficServers> m_otherTrafficNetworkServers { this, &CLoginComponent::ps_reloadSettings };
|
||||||
BlackMisc::CSetting<BlackGui::Settings::TOwnAircraftModel> m_currentAircraftModel { this }; //!< current settings of aircraft
|
BlackMisc::CSetting<BlackGui::Settings::TOwnAircraftModel> m_currentAircraftModel { this }; //!< current settings of aircraft
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace BlackGui
|
|||||||
if (aircraft.hasValidRealName())
|
if (aircraft.hasValidRealName())
|
||||||
{
|
{
|
||||||
i += " - ";
|
i += " - ";
|
||||||
i += aircraft.getPilotRealname();
|
i += aircraft.getPilotRealName();
|
||||||
}
|
}
|
||||||
items.append(i);
|
items.append(i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (this->m_controller == otherStation.getController()) { return; }
|
if (this->m_controller == otherStation.getController()) { return; }
|
||||||
CUser otherController = otherStation.getController();
|
CUser otherController = otherStation.getController();
|
||||||
this->m_controller.syncronizeData(otherController);
|
this->m_controller.synchronizeData(otherController);
|
||||||
otherStation.setController(otherController);
|
otherStation.setController(otherController);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace BlackMisc
|
|||||||
int pos = match.capturedStart(0);
|
int pos = match.capturedStart(0);
|
||||||
QString icao = match.captured(0).trimmed().right(4);
|
QString icao = match.captured(0).trimmed().right(4);
|
||||||
rn = rn.left(pos).trimmed();
|
rn = rn.left(pos).trimmed();
|
||||||
this->setHomebase(CAirportIcaoCode(icao));
|
this->setHomeBase(CAirportIcaoCode(icao));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ namespace BlackMisc
|
|||||||
if (!this->hasValidCallsign()) { this->setCallsign(otherUser.getCallsign()); }
|
if (!this->hasValidCallsign()) { this->setCallsign(otherUser.getCallsign()); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUser::syncronizeData(CUser &otherUser)
|
void CUser::synchronizeData(CUser &otherUser)
|
||||||
{
|
{
|
||||||
if (this == &otherUser) { return; }
|
if (this == &otherUser) { return; }
|
||||||
this->updateMissingParts(otherUser);
|
this->updateMissingParts(otherUser);
|
||||||
@@ -239,7 +239,7 @@ namespace BlackMisc
|
|||||||
case IndexRealName:
|
case IndexRealName:
|
||||||
return this->m_realname.compare(compareValue.getRealName(), Qt::CaseInsensitive);
|
return this->m_realname.compare(compareValue.getRealName(), Qt::CaseInsensitive);
|
||||||
case IndexHomebase:
|
case IndexHomebase:
|
||||||
return this->m_homebase.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getHomebase());
|
return this->m_homebase.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getHomeBase());
|
||||||
case IndexCallsign:
|
case IndexCallsign:
|
||||||
return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
|
return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -109,10 +109,13 @@ namespace BlackMisc
|
|||||||
void setId(const QString &id) { m_id = id.trimmed(); }
|
void setId(const QString &id) { m_id = id.trimmed(); }
|
||||||
|
|
||||||
//! Homebase
|
//! Homebase
|
||||||
const BlackMisc::Aviation::CAirportIcaoCode &getHomebase() const { return this->m_homebase; }
|
const BlackMisc::Aviation::CAirportIcaoCode &getHomeBase() const { return this->m_homebase; }
|
||||||
|
|
||||||
//! Set homebase
|
//! Set homebase
|
||||||
void setHomebase(const BlackMisc::Aviation::CAirportIcaoCode &homebase) { this->m_homebase = homebase; }
|
void setHomeBase(const BlackMisc::Aviation::CAirportIcaoCode &homebase) { this->m_homebase = homebase; }
|
||||||
|
|
||||||
|
//! Has home base?
|
||||||
|
bool hasHomeBase() const { return !this->m_homebase.isEmpty(); }
|
||||||
|
|
||||||
//! Get associated callsign.
|
//! Get associated callsign.
|
||||||
const BlackMisc::Aviation::CCallsign &getCallsign() const { return m_callsign; }
|
const BlackMisc::Aviation::CCallsign &getCallsign() const { return m_callsign; }
|
||||||
@@ -133,7 +136,7 @@ namespace BlackMisc
|
|||||||
int comparePropertyByIndex(const CPropertyIndex &index, const CUser &compareValue) const;
|
int comparePropertyByIndex(const CPropertyIndex &index, const CUser &compareValue) const;
|
||||||
|
|
||||||
//! This and another user exchange missing data, This user has priority and overrides first.
|
//! This and another user exchange missing data, This user has priority and overrides first.
|
||||||
void syncronizeData(CUser &otherUser);
|
void synchronizeData(CUser &otherUser);
|
||||||
|
|
||||||
//! Update missing parts in this object
|
//! Update missing parts in this object
|
||||||
void updateMissingParts(const CUser &otherUser);
|
void updateMissingParts(const CUser &otherUser);
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ namespace BlackMisc
|
|||||||
const BlackMisc::Network::CUser &getPilot() const { return m_pilot; }
|
const BlackMisc::Network::CUser &getPilot() const { return m_pilot; }
|
||||||
|
|
||||||
//! Get user's real name
|
//! Get user's real name
|
||||||
QString getPilotRealname() const { return m_pilot.getRealName(); }
|
QString getPilotRealName() const { return m_pilot.getRealName(); }
|
||||||
|
|
||||||
//! Get user's real id
|
//! Get user's real id
|
||||||
QString getPilotId() { return m_pilot.getId(); }
|
QString getPilotId() { return m_pilot.getId(); }
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ void SwiftGuiStd::initGuiSignals()
|
|||||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
|
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
|
||||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
|
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &SwiftGuiStd::ps_setMainPageToInfoArea);
|
||||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
||||||
|
connect(ui->comp_Login, &CLoginComponent::loginDataChanged, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
||||||
connect(this, &SwiftGuiStd::currentMainInfoAreaChanged, ui->comp_Login, &CLoginComponent::mainInfoAreaChanged);
|
connect(this, &SwiftGuiStd::currentMainInfoAreaChanged, ui->comp_Login, &CLoginComponent::mainInfoAreaChanged);
|
||||||
connect(ui->comp_Login, &CLoginComponent::requestNetworkSettings, ui->comp_MainInfoArea->getFlightPlanComponent(), [ = ]()
|
connect(ui->comp_Login, &CLoginComponent::requestNetworkSettings, ui->comp_MainInfoArea->getFlightPlanComponent(), [ = ]()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user