swift
networkdetailscomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_COMPONENTS_NETWORKDETAILSCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_NETWORKDETAILSCOMPONENT_H
8 
9 #include <QFrame>
10 #include <QScopedPointer>
11 
12 #include "core/data/networksetup.h"
15 #include "misc/network/loginmode.h"
16 
17 namespace Ui
18 {
19  class CNetworkDetailsComponent;
20 }
21 namespace swift::gui::components
22 {
24  class CNetworkDetailsComponent : public QFrame
25  {
26  Q_OBJECT
27 
28  public:
30  enum Tab
31  {
32  LoginVATSIM,
33  LoginOthers,
34  };
35 
37  explicit CNetworkDetailsComponent(QWidget *parent = nullptr);
38 
40  virtual ~CNetworkDetailsComponent() override;
41 
44 
47 
50  bool isVatsimServerSelected() const;
51  bool isOtherServerSelected() const;
53 
56 
59 
62 
64  bool hasPartnerCallsign() const;
65 
68 
69  signals:
72 
75 
78 
79  private:
81  void reloadOtherServersSetup();
82 
84  void onServerTabWidgetChanged(int index);
85 
87  void onSelectedServerChanged(const swift::misc::network::CServer &server);
88 
90  void setServerButtonsVisible(bool visible);
91 
93  void onWebServiceDataRead(swift::misc::network::CEntityFlags::Entity entity,
94  swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url);
95 
96  swift::core::data::CNetworkSetup m_networkSetup;
97  bool m_updatePilotOnServerChanges = true;
98  QScopedPointer<Ui::CNetworkDetailsComponent> ui;
99  };
100 } // namespace swift::gui::components
101 
102 #endif // SWIFT_GUI_COMPONENTS_NETWORKDETAILSCOMPONENT_H
Remembering the last servers and ecosystem.
Definition: networksetup.h:25
swift::misc::network::CServer getCurrentOtherServer() const
Selected server (others)
void requestNetworkSettings()
Request network settings.
bool hasPartnerCallsign() const
Pilot or Co-pilot callsign?
void setLoginMode(swift::misc::network::CLoginMode mode)
Login mode.
void currentServerChanged(const misc::network::CServer &server)
Current selected server changed.
void overridePilot(const swift::misc::network::CUser &user)
Override the pilot.
swift::misc::network::CServer getCurrentVatsimServer() const
Selected server (VATSIM)
swift::misc::aviation::CCallsign getPartnerCallsign() const
Pilot or Co-pilot callsign.
swift::misc::network::CServer getCurrentServer() const
Current server based on selected tab.
swift::misc::network::CLoginMode getLoginMode() const
Login mode.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
Value object encapsulating information about login mode.
Definition: loginmode.h:18
Value object encapsulating information of a server.
Definition: server.h:28
Value object encapsulating information of a user.
Definition: user.h:28
High level reusable GUI components.
Definition: aboutdialog.cpp:13