diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index fdaaa5962..f2c730c33 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -629,9 +629,6 @@ add_library(gui SHARED
lineedithistory.h
loadindicator.cpp
loadindicator.h
- loginmodebuttons.cpp
- loginmodebuttons.h
- loginmodebuttons.ui
mainwindowaccess.cpp
mainwindowaccess.h
managedstatusbar.cpp
diff --git a/src/gui/components/logincomponent.cpp b/src/gui/components/logincomponent.cpp
index eb106c2fa..b306b7182 100644
--- a/src/gui/components/logincomponent.cpp
+++ b/src/gui/components/logincomponent.cpp
@@ -31,7 +31,6 @@
#include "gui/editors/pilotform.h"
#include "gui/editors/serverform.h"
#include "gui/guiapplication.h"
-#include "gui/loginmodebuttons.h"
#include "gui/ticklabel.h"
#include "gui/uppercasevalidator.h"
#include "misc/aviation/aircrafticaocode.h"
diff --git a/src/gui/components/logincomponent.ui b/src/gui/components/logincomponent.ui
index bfbf5a4aa..7c3fdf0d2 100644
--- a/src/gui/components/logincomponent.ui
+++ b/src/gui/components/logincomponent.ui
@@ -392,12 +392,6 @@
gui/components/ownaircraftcomponent.h
1
-
- swift::gui::CLoginModeButtons
- QFrame
-
- 1
-
swift::gui::CTickLabel
QLabel
diff --git a/src/gui/components/networkdetailscomponent.cpp b/src/gui/components/networkdetailscomponent.cpp
index 8a00d25dc..62d035a7d 100644
--- a/src/gui/components/networkdetailscomponent.cpp
+++ b/src/gui/components/networkdetailscomponent.cpp
@@ -66,9 +66,16 @@ namespace swift::gui::components
CNetworkDetailsComponent::~CNetworkDetailsComponent() {}
- CLoginMode CNetworkDetailsComponent::getLoginMode() const { return ui->frp_LoginMode->getLoginMode(); }
+ CLoginMode CNetworkDetailsComponent::getLoginMode() const
+ {
+ return ui->cb_observer->isChecked() ? CLoginMode::Observer : CLoginMode::Pilot;
+ }
- void CNetworkDetailsComponent::setLoginMode(CLoginMode mode) { ui->frp_LoginMode->setLoginMode(mode); }
+ void CNetworkDetailsComponent::setLoginMode(CLoginMode mode)
+ {
+ if (mode == CLoginMode::Observer) { ui->cb_observer->setChecked(true); }
+ else { ui->cb_observer->setChecked(false); }
+ }
bool CNetworkDetailsComponent::isVatsimServerSelected() const
{
diff --git a/src/gui/components/networkdetailscomponent.ui b/src/gui/components/networkdetailscomponent.ui
index 3606d8d63..103f20217 100644
--- a/src/gui/components/networkdetailscomponent.ui
+++ b/src/gui/components/networkdetailscomponent.ui
@@ -223,12 +223,9 @@
-
-
-
-
- 0
- 20
-
+
+
+ Observer (co-pilot)
@@ -259,12 +256,6 @@
QComboBox
gui/components/serverlistselector.h
-
- swift::gui::CLoginModeButtons
- QFrame
-
- 1
-
tw_Network
diff --git a/src/gui/loginmodebuttons.cpp b/src/gui/loginmodebuttons.cpp
deleted file mode 100644
index 717b20184..000000000
--- a/src/gui/loginmodebuttons.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// SPDX-FileCopyrightText: Copyright (C) 2014 swift Project Community / Contributors
-// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
-
-#include "gui/loginmodebuttons.h"
-
-#include
-
-#include "ui_loginmodebuttons.h"
-
-#include "config/buildconfig.h"
-#include "core/context/contextsimulator.h"
-#include "gui/guiapplication.h"
-#include "misc/verify.h"
-
-using namespace swift::config;
-using namespace swift::core;
-using namespace swift::core::context;
-using namespace swift::misc::network;
-
-namespace swift::gui
-{
- CLoginModeButtons::CLoginModeButtons(QWidget *parent) : QFrame(parent), ui(new Ui::CLoginModeButtons)
- {
- ui->setupUi(this);
- ui->lbl_NoSimulator->setVisible(false);
- this->configureLoginModes();
- connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorStatusChanged, this,
- &CLoginModeButtons::configureLoginModes, Qt::QueuedConnection);
- }
-
- CLoginModeButtons::~CLoginModeButtons() {}
-
- CLoginMode swift::gui::CLoginModeButtons::getLoginMode() const
- {
- CLoginMode mode = CLoginMode::Pilot;
- if (ui->rb_LoginObserver->isChecked()) { mode.setLoginMode(CLoginMode::Observer); }
- return mode;
- }
-
- void CLoginModeButtons::setLoginMode(CLoginMode mode)
- {
- switch (mode.getLoginMode())
- {
- case CLoginMode::Observer: ui->rb_LoginObserver->setChecked(true); break;
- default:
- case CLoginMode::Pilot: ui->rb_LoginNormal->setChecked(true); break;
- }
- }
-
- void CLoginModeButtons::setReadOnly(bool readonly)
- {
- ui->rb_LoginNormal->setEnabled(!readonly);
- ui->rb_LoginObserver->setEnabled(!readonly);
- ui->rb_LoginStealth->setEnabled(!readonly);
- }
-
- void CLoginModeButtons::configureLoginModes()
- {
- if (!sGui || sGui->isShuttingDown()) { return; }
-
- // we have no idea how we can get here without the context existing Ref T389
- if (CBuildConfig::isLocalDeveloperDebugBuild() && !sGui->getIContextSimulator())
- {
- // how is this possible? In debug builds I do crosscheck
- Q_ASSERT_X(false, Q_FUNC_INFO, "No context or sGUI");
- }
-
- if (!sGui->getIContextSimulator() ||
- (!sGui->isDeveloperFlagSet() && !sGui->getIContextSimulator()->isSimulatorSimulating()))
- {
- // Disable pilot login modes, only observer
- ui->rb_LoginNormal->setEnabled(false);
- ui->rb_LoginStealth->setEnabled(false);
- ui->rb_LoginNormal->setToolTip("No simulator available");
- ui->rb_LoginStealth->setToolTip("No simulator available");
- ui->rb_LoginObserver->setChecked(true);
- ui->lbl_NoSimulator->setVisible(true);
- }
- else
- {
- ui->rb_LoginNormal->setEnabled(true);
- ui->rb_LoginStealth->setEnabled(true);
- ui->rb_LoginNormal->setToolTip({});
- ui->rb_LoginStealth->setToolTip({});
- ui->rb_LoginNormal->setChecked(true);
- ui->lbl_NoSimulator->setVisible(false);
- }
-
- ui->rb_LoginStealth->setVisible(false); // 2019-01 hide as based on discussion with RR
- }
-} // namespace swift::gui
diff --git a/src/gui/loginmodebuttons.h b/src/gui/loginmodebuttons.h
deleted file mode 100644
index 03ffa5ac0..000000000
--- a/src/gui/loginmodebuttons.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// SPDX-FileCopyrightText: Copyright (C) 2014 swift Project Community / Contributors
-// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
-
-//! \file
-
-#ifndef SWIFT_GUI_LOGINMODEBUTTONS_H
-#define SWIFT_GUI_LOGINMODEBUTTONS_H
-
-#include
-#include
-#include
-
-#include "gui/swiftguiexport.h"
-#include "misc/network/loginmode.h"
-
-namespace Ui
-{
- class CLoginModeButtons;
-}
-namespace swift::gui
-{
- //! Display login modes (normal, stealth, ...)
- class SWIFT_GUI_EXPORT CLoginModeButtons : public QFrame
- {
- Q_OBJECT
-
- public:
- //! Constructor
- explicit CLoginModeButtons(QWidget *parent = nullptr);
-
- //! Destructor
- virtual ~CLoginModeButtons() override;
-
- //! Get login mode, \sa swift::core::INetwork::LoginMode
- swift::misc::network::CLoginMode getLoginMode() const;
-
- //! Set login mode
- void setLoginMode(swift::misc::network::CLoginMode mode);
-
- //! Set to read only
- void setReadOnly(bool readonly);
-
- private:
- void configureLoginModes();
-
- QScopedPointer ui;
- };
-} // namespace swift::gui
-
-#endif // SWIFT_GUI_LOGINMODEBUTTONS_H
diff --git a/src/gui/loginmodebuttons.ui b/src/gui/loginmodebuttons.ui
deleted file mode 100644
index 6af59140c..000000000
--- a/src/gui/loginmodebuttons.ui
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
- CLoginModeButtons
-
-
-
- 0
- 0
- 363
- 22
-
-
-
- Login mode
-
-
-
-
-
- false
-
-
-
- 10
-
-
- 1
-
-
- 1
-
-
- 1
-
-
- 1
-
- -
-
-
- Normal
-
-
- true
-
-
-
- -
-
-
- Stealth
-
-
-
- -
-
-
- Observer (co-pilot)
-
-
-
- -
-
-
- No simulator!
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
-