diff --git a/samples/blackgui/mainwindow.cpp b/samples/blackgui/mainwindow.cpp index fb035dfb7..6779db084 100644 --- a/samples/blackgui/mainwindow.cpp +++ b/samples/blackgui/mainwindow.cpp @@ -195,7 +195,18 @@ void MainWindow::toggleNetworkConnection() } // Login is based on setting current server - msgs = this->m_contextNetwork->connectToNetwork(); + INetwork::LoginMode mode = INetwork::LoginNormal; + if (this->ui->rb_SettingsLoginStealthMode->isChecked()) + { + mode = INetwork::LoginStealth; + this->displayStatusMessage(CStatusMessage::getInfoMessage("login in stealth mode")); + } + else if (this->ui->rb_SettingsLoginObserver->isChecked()) + { + mode = INetwork::LoginAsObserver; + this->displayStatusMessage(CStatusMessage::getInfoMessage("login in observer mode")); + } + msgs = this->m_contextNetwork->connectToNetwork(static_cast(mode)); } else { diff --git a/samples/blackgui/mainwindow.ui b/samples/blackgui/mainwindow.ui index 4f3549229..48c8ca344 100644 --- a/samples/blackgui/mainwindow.ui +++ b/samples/blackgui/mainwindow.ui @@ -163,6 +163,14 @@ QPlainTextEdit { border-radius: 5px; } +QGroupBox { + border: 1px solid green; +} + +QRadioButton { + font: 10px; +} + QComboBox { border: 1px solid green; border-radius: 5px; @@ -268,7 +276,7 @@ QScrollBar::add-line:vertical { subcontrol-origin: margin; } - QScrollBar::sub-line:vertical { +QScrollBar::sub-line:vertical { border: 2px solid gray; background: blue; height: 5px; @@ -344,7 +352,16 @@ QSizeGrip { 0 - + + 2 + + + 2 + + + 2 + + 2 @@ -362,7 +379,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -401,7 +427,16 @@ QSizeGrip { 2 - + + 2 + + + 2 + + + 2 + + 2 @@ -508,7 +543,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -547,7 +591,16 @@ QSizeGrip { 2 - + + 2 + + + 2 + + + 2 + + 2 @@ -809,7 +862,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -826,7 +888,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -849,7 +920,16 @@ QSizeGrip { 5 - + + 2 + + + 2 + + + 2 + + 2 @@ -1311,7 +1391,16 @@ QSizeGrip { 2 - + + 2 + + + 2 + + + 2 + + 2 @@ -1345,7 +1434,16 @@ QSizeGrip { 2 - + + 2 + + + 2 + + + 2 + + 2 @@ -1408,7 +1506,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -1565,7 +1672,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -1575,7 +1691,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -1591,7 +1716,16 @@ QSizeGrip { 2 - + + 1 + + + 1 + + + 1 + + 1 @@ -1615,7 +1749,16 @@ QSizeGrip { QFormLayout::AllNonFixedFieldsGrow - + + 6 + + + 6 + + + 6 + + 6 @@ -1764,6 +1907,9 @@ QSizeGrip { + + QFormLayout::AllNonFixedFieldsGrow + @@ -1811,22 +1957,41 @@ QSizeGrip { - Modes + Login modes - - - Stealth mode - - - - - - - Observer + + + + + + + + Normal + + + true + + + + + + + Stealth mode + + + + + + + Observer + + + + @@ -1907,7 +2072,16 @@ QSizeGrip { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -2584,8 +2758,6 @@ QSizeGrip { le_SettingsIcaoTypeDesignator le_SettingsIcaoAirline le_SettingsIcaoType - lbl_SettingsStealthMode - lbl_SettingsObserver cb_VoiceInputDevice cb_VoiceOutputDevice pb_VoiceStartMicTest diff --git a/samples/blackgui/stylesheetmain.qss b/samples/blackgui/stylesheetmain.qss index 3eca26826..04a97620a 100644 --- a/samples/blackgui/stylesheetmain.qss +++ b/samples/blackgui/stylesheetmain.qss @@ -48,6 +48,12 @@ QStatusBar { padding: 3px; } +/* No style for Dial +#sw_MainMiddel QDial { + background-color: rgba(0, 0, 255, 128); +} +*/ + #wi_MainKeypadArea QPushButton { font-family: arial-rounded; background-color: black; @@ -70,12 +76,6 @@ QStatusBar { border-radius: 5px; } -QComboBox { - border: 1px solid gray; - border-radius: 5px; - background: #1e1d1b; -} - QTabWidget::pane { /* The tab widget frame */ border: none; } @@ -106,6 +106,7 @@ QLabel { QLineEdit { background: black; border: 1px solid green; + border-radius: 5px; } QLineEdit[readOnly="true"] { @@ -113,16 +114,42 @@ QLineEdit[readOnly="true"] { } QCheckBox { - color: white; + color: white; /** font **/ border: 0px solid green; background: transparent; } QTextEdit { + border: 1px solid green; background: transparent; + border-radius: 5px; } QPlainTextEdit { + border: 1px solid green; + background: transparent; + border-radius: 5px; +} + +QGroupBox { + border: 1px solid green; +} + +QRadioButton { + font: 10px; +} + +QComboBox { + border: 1px solid green; + border-radius: 5px; + padding: 1px; + background: transparent; +} + +QDoubleSpinBox { + border: 1px solid green; + border-radius: 5px; + padding: 1px; background: transparent; } @@ -193,7 +220,7 @@ QScrollBar::handle:vertical { min-height: 15px; } - QScrollBar::add-line:horizontal { +QScrollBar::add-line:horizontal { border: 2px solid gray; background: blue; width: 5px; @@ -217,7 +244,7 @@ QScrollBar::add-line:vertical { subcontrol-origin: margin; } - QScrollBar::sub-line:vertical { +QScrollBar::sub-line:vertical { border: 2px solid gray; background: blue; height: 5px; @@ -233,6 +260,8 @@ QHeaderView::section { } QTableView { + border: 1px solid green; + border-radius: 5px; background-color: black; alternate-background-color: darkslategray; selection-background-color: blue; diff --git a/src/blackcore/context_network.cpp b/src/blackcore/context_network.cpp index 180391017..14a20b3e9 100644 --- a/src/blackcore/context_network.cpp +++ b/src/blackcore/context_network.cpp @@ -91,7 +91,7 @@ namespace BlackCore /* * Connect to network */ - CStatusMessageList CContextNetwork::connectToNetwork() + CStatusMessageList CContextNetwork::connectToNetwork(uint loginMode) { // this->log(Q_FUNC_INFO); CStatusMessageList msgs; @@ -107,8 +107,10 @@ namespace BlackCore } else { + INetwork::LoginMode mode = static_cast(loginMode); this->m_ownAircraft.setPilot(currentServer.getUser()); // still needed? this->m_network->presetServer(currentServer); + this->m_network->presetLoginMode(mode); this->m_network->presetCallsign(this->m_ownAircraft.getCallsign()); this->m_network->presetIcaoCodes(this->m_ownAircraft.getIcaoInfo()); this->m_network->setOwnAircraft(this->m_ownAircraft); diff --git a/src/blackcore/context_network.h b/src/blackcore/context_network.h index d7b9ad0b9..4920a4d9e 100644 --- a/src/blackcore/context_network.h +++ b/src/blackcore/context_network.h @@ -70,12 +70,12 @@ namespace BlackCore public slots: /*! - * \brief Read ATC bookings + * \copydoc IContextNetwork::readAtcBookingsFromSource() */ virtual void readAtcBookingsFromSource() const; /*! - * \brief The "central" ATC list with online ATC controllers + * \copydoc IContextNetwork::getAtcStationsOnline() * \todo If I make this &getAtcStations XML is not generated correctly, needs to be crosschecked with the latest version of Qt */ virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const @@ -85,7 +85,7 @@ namespace BlackCore } /*! - * \brief ATC list, with booked controllers + * \copydoc IContextNetwork::getAtcStationsBooked() * \todo If I make this &getAtcStations XML is not generated correctly */ virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const @@ -95,8 +95,7 @@ namespace BlackCore } /*! - * \brief Aircraft list - * \return + * \copydoc IContextNetwork::getAircraftsInRange() */ virtual const BlackMisc::Aviation::CAircraftList getAircraftsInRange() const { @@ -105,19 +104,17 @@ namespace BlackCore } /*! - * \brief Connect to Network - * \return a message list showing the connection situation + * \copydoc IContextNetwork::connectToNetwork() */ - virtual BlackMisc::CStatusMessageList connectToNetwork(); + virtual BlackMisc::CStatusMessageList connectToNetwork(uint mode); /*! - * \brief Disconnect from network - * \return a message list showing the disconnection situation + * \copydoc IContextNetwork::disconnectFromNetwork() */ virtual BlackMisc::CStatusMessageList disconnectFromNetwork(); /*! - * \brief Network connected? + * \copydoc IContextNetwork::isConnected() */ virtual bool isConnected() const; diff --git a/src/blackcore/context_network_interface.cpp b/src/blackcore/context_network_interface.cpp index c6c4a58be..86921d26c 100644 --- a/src/blackcore/context_network_interface.cpp +++ b/src/blackcore/context_network_interface.cpp @@ -101,9 +101,9 @@ namespace BlackCore return this->m_dBusInterface->callDBusRet(QLatin1Literal("getOwnAircraft")); } - BlackMisc::CStatusMessageList IContextNetwork::connectToNetwork() + BlackMisc::CStatusMessageList IContextNetwork::connectToNetwork(uint loginMode) { - return this->m_dBusInterface->callDBusRet(QLatin1Literal("connectToNetwork")); + return this->m_dBusInterface->callDBusRet(QLatin1Literal("connectToNetwork"), loginMode); } BlackMisc::CStatusMessageList IContextNetwork::disconnectFromNetwork() diff --git a/src/blackcore/context_network_interface.h b/src/blackcore/context_network_interface.h index 8138126da..a60d2c603 100644 --- a/src/blackcore/context_network_interface.h +++ b/src/blackcore/context_network_interface.h @@ -143,6 +143,7 @@ namespace BlackCore * \param from old status * \param to new status * \remarks If I use the enum, adaptor / interface are not created correctly + * \see INetwork::ConnectionStatus */ void connectionStatusChanged(uint from, uint to); @@ -193,8 +194,9 @@ namespace BlackCore /*! * \brief Connect to Network * \return messages gererated during connecting + * \see INetwork::LoginMode */ - virtual BlackMisc::CStatusMessageList connectToNetwork(); + virtual BlackMisc::CStatusMessageList connectToNetwork(uint loginMode); /*! * \brief Disconnect from network