diff --git a/src/blackgui/CMakeLists.txt b/src/blackgui/CMakeLists.txt index 14a075dde..870088d58 100644 --- a/src/blackgui/CMakeLists.txt +++ b/src/blackgui/CMakeLists.txt @@ -331,7 +331,6 @@ add_library(gui SHARED components/settingsxswiftbuscomponent.ui components/selcalcodeselector.cpp components/audionotificationcomponent.h - components/loginoverviewcomponent.h components/updateinfodialog.ui components/aircraftpartshistory.ui components/autopublishdialog.ui @@ -415,7 +414,6 @@ add_library(gui SHARED components/aircraftmodelvalidationcomponent.cpp components/settingsguicomponent.h components/dbaircrafticaocomponent.cpp - components/loginoverviewcomponent.ui components/setuploadingdialog.ui components/dbmappingcomponent.ui components/mappingcomponent.cpp @@ -639,7 +637,6 @@ add_library(gui SHARED components/copymodelsfromotherswiftversionscomponent.cpp components/settingssimulatormessagescomponent.cpp components/dbaircraftcategorycomponent.ui - components/loginoverviewcomponent.cpp components/cockpitcomtransmissioncomponent.ui components/interpolationlogdisplay.cpp components/dblogincomponent.cpp diff --git a/src/blackgui/components/loginoverviewcomponent.cpp b/src/blackgui/components/loginoverviewcomponent.cpp deleted file mode 100644 index 0b57e7bf1..000000000 --- a/src/blackgui/components/loginoverviewcomponent.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "ui_loginoverviewcomponent.h" -#include "loginoverviewcomponent.h" -#include "blackgui/components/serverlistselector.h" -#include "blackgui/editors/serverform.h" -#include "blackgui/editors/pilotform.h" -#include "blackgui/guiapplication.h" -#include "blackgui/loginmodebuttons.h" -#include "blackgui/ticklabel.h" -#include "blackgui/uppercasevalidator.h" -#include "blackcore/context/contextaudio.h" -#include "blackcore/context/contextownaircraft.h" -#include "blackcore/context/contextsimulator.h" -#include "blackcore/context/contextnetwork.h" -#include "blackcore/data/globalsetup.h" -#include "blackcore/webdataservices.h" -#include "blackcore/simulator.h" -#include "blackmisc/simulation/simulatorinternals.h" -#include "blackmisc/simulation/aircraftmodel.h" -#include "blackmisc/simulation/simulatedaircraft.h" -#include "blackmisc/aviation/aircrafticaocode.h" -#include "blackmisc/aviation/airlineicaocode.h" -#include "blackmisc/aviation/airporticaocode.h" -#include "blackmisc/network/entityflags.h" -#include "blackmisc/network/serverlist.h" -#include "blackmisc/icons.h" -#include "blackmisc/logmessage.h" -#include "blackmisc/statusmessage.h" -#include "blackmisc/crashhandler.h" -#include "blackconfig/buildconfig.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace BlackConfig; -using namespace BlackMisc; -using namespace BlackMisc::Aviation; -using namespace BlackMisc::Audio; -using namespace BlackMisc::Network; -using namespace BlackMisc::Simulation; -using namespace BlackCore; -using namespace BlackCore::Data; -using namespace BlackCore::Context; -using namespace BlackGui; - -namespace BlackGui::Components -{ - const QStringList &CLoginOverviewComponent::getLogCategories() - { - static const QStringList cats { CLogCategories::guiComponent() }; - return cats; - } - - CLoginOverviewComponent::CLoginOverviewComponent(QWidget *parent) : COverlayMessagesFrame(parent), - ui(new Ui::CLoginOverviewComponent) - { - ui->setupUi(this); - - connect(ui->pb_Cancel, &QPushButton::clicked, this, &CLoginOverviewComponent::cancel, Qt::QueuedConnection); - connect(ui->pb_Disconnect, &QPushButton::clicked, this, &CLoginOverviewComponent::toggleNetworkConnection, Qt::QueuedConnection); - - // overlay - this->setOverlaySizeFactors(0.8, 0.5); - this->setReducedInfo(true); - this->setForceSmall(true); - this->showKillButton(false); - - // forms - ui->form_Pilot->setReadOnly(true); - ui->form_Server->setReadOnly(true); - - // inital setup, if data already available - ui->form_Pilot->validate(); - } - - CLoginOverviewComponent::~CLoginOverviewComponent() - {} - - void CLoginOverviewComponent::cancel() - { - this->closeOverlay(); - emit this->closeOverview(); - } - - void CLoginOverviewComponent::toggleNetworkConnection() - { - if (!sGui || sGui->isShuttingDown()) { return; } - if (!sGui->getIContextNetwork() || !sGui->getIContextAudio()) { return; } - - const bool isConnected = sGui && sGui->getIContextNetwork()->isConnected(); - - CStatusMessage msg; - if (!isConnected) - { - // void - } - else - { - // disconnect from network - sGui->setExtraWindowTitle(""); - msg = sGui->getIContextNetwork()->disconnectFromNetwork(); - } - - // log message and trigger events - msg.addCategories(this); - CLogMessage::preformatted(msg); - if (msg.isSuccess()) - { - emit loginOrLogoffSuccessful(); - } - else - { - this->cancel(); - } - } - - void CLoginOverviewComponent::showCurrentValues() - { - if (!this->hasValidContexts()) { return; } - const CServer server = sGui->getIContextNetwork()->getConnectedServer(); - ui->form_Server->setServer(server); - ui->form_Server->resetToFirstTab(); - ui->form_Pilot->setUser(server.getUser()); - ui->le_LoginMode->setText(sGui->getIContextNetwork()->getLoginModeAsString()); - ui->le_PartnerCallsign->setText(sGui->getIContextNetwork()->getPartnerCallsign().asString()); - ui->comp_NetworkAircraft->showValues(); - } - - bool CLoginOverviewComponent::hasValidContexts() const - { - if (!sGui || !sGui->supportsContexts()) { return false; } - if (sGui->isShuttingDown()) { return false; } - if (!sGui->getIContextSimulator()) { return false; } - if (!sGui->getIContextNetwork()) { return false; } - if (!sGui->getIContextOwnAircraft()) { return false; } - return true; - } - -} // namespace diff --git a/src/blackgui/components/loginoverviewcomponent.h b/src/blackgui/components/loginoverviewcomponent.h deleted file mode 100644 index 8e503f6a3..000000000 --- a/src/blackgui/components/loginoverviewcomponent.h +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKGUI_COMPONENTS_LOGINOVERVIEWCOMPONENT_H -#define BLACKGUI_COMPONENTS_LOGINOVERVIEWCOMPONENT_H - -#include "blackcore/vatsim/vatsimsettings.h" -#include "blackcore/data/networksetup.h" -#include "blackgui/settings/guisettings.h" -#include "blackgui/overlaymessagesframe.h" -#include "blackgui/blackguiexport.h" -#include "blackmisc/simulation/data/lastmodel.h" -#include "blackmisc/simulation/simulatedaircraft.h" -#include "blackmisc/aviation/callsign.h" -#include "blackmisc/network/server.h" -#include "blackmisc/network/user.h" -#include "blackmisc/digestsignal.h" -#include "blackmisc/settingscache.h" -#include "blackmisc/datacache.h" - -#include -#include -#include -#include -#include -#include - -namespace Ui -{ - class CLoginOverviewComponent; -} -namespace BlackMisc::Simulation -{ - class CAircraftModel; - class CSimulatedAircraft; -} -namespace BlackGui::Components -{ - /*! - * Login component to flight network - */ - class BLACKGUI_EXPORT CLoginOverviewComponent : public COverlayMessagesFrame - { - Q_OBJECT - - public: - //! Log categories - static const QStringList &getLogCategories(); - - //! Constructor - explicit CLoginOverviewComponent(QWidget *parent = nullptr); - - //! Destructor - virtual ~CLoginOverviewComponent() override; - - //! Login requested - void toggleNetworkConnection(); - - //! Show current values - void showCurrentValues(); - - signals: - //! Login - void loginOrLogoffSuccessful(); - - //! Cancelled - void closeOverview(); - - private: - // -------------- others ----------------- - - //! Login cancelled - void cancel(); - - //! Has contexts? - bool hasValidContexts() const; - - static constexpr int OverlayMessageMs = 5000; - static constexpr int LogoffIntervalSeconds = 20; //!< time before logoff - - QScopedPointer ui; - BlackCore::Data::CNetworkSetup m_networkSetup; //!< servers last used - }; -} // namespace - -#endif // guard diff --git a/src/blackgui/components/loginoverviewcomponent.ui b/src/blackgui/components/loginoverviewcomponent.ui deleted file mode 100644 index b1b887ad1..000000000 --- a/src/blackgui/components/loginoverviewcomponent.ui +++ /dev/null @@ -1,315 +0,0 @@ - - - CLoginOverviewComponent - - - - 0 - 0 - 295 - 316 - - - - Login component - - - - 2 - - - 1 - - - 1 - - - 1 - - - 1 - - - - - Server - - - - 3 - - - 2 - - - 2 - - - 2 - - - 2 - - - - - QFrame::Panel - - - - - - - - - - Login mode / partner callsign - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - true - - - - - - - Partner - - - - - - - Mode - - - - - - - true - - - - - - - - - - Matching log. - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - Pilot's info - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - 0 - 60 - - - - Qt::NoFocus - - - - - - - - - - Qt::StrongFocus - - - Own aircraft - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 10 - - - 3 - - - 3 - - - 3 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - cancel - - - Esc - - - - - - - disconnect - - - - - - - - - - - BlackGui::Components::CModelMatcherLogEnable - QFrame -
blackgui/components/modelmatcherlogenable.h
- 1 -
- - BlackGui::Editors::CPilotForm - QFrame -
blackgui/editors/pilotform.h
- 1 -
- - BlackGui::Editors::CServerForm - QFrame -
blackgui/editors/serverform.h
- 1 -
- - BlackGui::Components::CNetworkAircraftValuesComponent - QFrame -
blackgui/components/networkaircraftvaluescomponent.h
- 1 -
-
- - le_LoginMode - le_PartnerCallsign - gb_OwnAircraft - pb_Disconnect - pb_Cancel - - - -