diff --git a/samples/blackgui/mainwindow.cpp b/samples/blackgui/mainwindow.cpp index a167c1ff7..2f26706f3 100644 --- a/samples/blackgui/mainwindow.cpp +++ b/samples/blackgui/mainwindow.cpp @@ -30,7 +30,7 @@ MainWindow::MainWindow(GuiModes::WindowMode windowMode, QWidget *parent) : m_coreAvailable(false), m_contextNetworkAvailable(false), m_contextAudioAvailable(false), // timers - m_timerUpdateAtcStationsOnline(nullptr), m_timerUpdateAircraftsInRange(nullptr), m_timerUpdateUsers(nullptr), + m_timerUpdateAtcStationsOnline(nullptr), m_timerUpdateAircraftsInRange(nullptr), m_timerCollectedCockpitUpdates(nullptr), m_timerContextWatchdog(nullptr), m_timerStatusBar(nullptr), m_timerAudioTests(nullptr), m_timerSimulator(nullptr), // context menus @@ -334,12 +334,6 @@ void MainWindow::timerBasedUpdates() this->m_timerUpdateAircraftsInRange->start(t); this->reloadAircraftsInRange(); } - else if (sender == this->m_timerUpdateUsers) - { - int t = this->ui->hs_SettingsGuiUserRefreshTime->value() * 1000; - this->m_timerUpdateUsers->start(t); - this->reloadAllUsers(); - } else if (sender == this->m_timerContextWatchdog) { this->setContextAvailability(); @@ -485,15 +479,6 @@ void MainWindow::displayOverlayInfo(const CStatusMessage &message) // further code goes here, such as marking errors as red ... } -/* - * Read users - */ -void MainWindow::reloadAllUsers() -{ - if (!this->isContextNetworkAvailableCheck()) return; - this->ui->tvp_AllUsers->update(this->getIContextNetwork()->getUsers()); -} - void MainWindow::updateSimulatorData() { if (this->getIContextSimulator()->isConnected()) diff --git a/samples/blackgui/mainwindow.h b/samples/blackgui/mainwindow.h index a2c87d6b9..4dfeb4bd1 100644 --- a/samples/blackgui/mainwindow.h +++ b/samples/blackgui/mainwindow.h @@ -104,7 +104,6 @@ private: BlackMisc::Aviation::CAircraft m_ownAircraft; /*!< own aircraft's state */ QTimer *m_timerUpdateAtcStationsOnline; /*!< timer for update of stations */ QTimer *m_timerUpdateAircraftsInRange; /*!< timer for update of aircrafts */ - QTimer *m_timerUpdateUsers; /*!< timer for update of users */ QTimer *m_timerCollectedCockpitUpdates; /*!< collect cockpit updates over a short period before sending */ QTimer *m_timerContextWatchdog; /*!< core available? */ QTimer *m_timerStatusBar; /*!< cleaning up status bar */ @@ -265,9 +264,6 @@ private slots: //! Reload aircrafts in range void reloadAircraftsInRange(); - //! Reload all (online) users - void reloadAllUsers(); - //! Reload own aircraft bool reloadOwnAircraft(); diff --git a/samples/blackgui/mainwindow.ui b/samples/blackgui/mainwindow.ui index 1196ec26e..ca3f04459 100644 --- a/samples/blackgui/mainwindow.ui +++ b/samples/blackgui/mainwindow.ui @@ -1039,17 +1039,7 @@ QStatusBar QLabel { 0 - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - + @@ -1803,7 +1793,7 @@ QStatusBar QLabel { - 3 + 1 @@ -2028,38 +2018,49 @@ QStatusBar QLabel { - + ICAO type (e.g. A320) - + Qt::ImhUppercaseOnly + + C172 + - + ICAO airline (e.g.DLH) - + + + SGN + + - + Aircraft type (e.g. L2J) - + + + L1P + + @@ -3162,6 +3163,11 @@ QStatusBar QLabel { + + BlackGui::CUserView + QTableView +
blackgui/userview.h
+
BlackGui::CTransponderModeSelector QComboBox @@ -3177,11 +3183,6 @@ QStatusBar QLabel { QTableView
blackgui/atcstationview.h
- - BlackGui::CUserView - QTableView -
blackgui/userview.h
-
BlackGui::CAircraftView QTableView @@ -3209,6 +3210,12 @@ QStatusBar QLabel {
blackgui/settingsfsxcomponent.h
1
+ + BlackGui::CUserComponent + QTabWidget +
blackgui/usercomponent.h
+ 1 +
cb_StatusWithDBus @@ -3225,7 +3232,6 @@ QStatusBar QLabel { tvp_AtcStationsBooked pb_ReloadAtcStationsBooked tvp_AircraftsInRange - tvp_AllUsers pb_CockpitToggleCom1 ds_CockpitCom1Active ds_CockpitCom1Standby @@ -3263,9 +3269,9 @@ QStatusBar QLabel { pb_SettingsTnRemoveServer pb_SettingsTnCurrentServer le_SettingsAircraftCallsign - le_SettingsIcaoTypeDesignator - le_SettingsIcaoAirline - le_SettingsIcaoType + le_SettingsIcaoAircraftDesignator + le_SettingsIcaoAirlineDesignator + le_SettingsIcaoCombinedType cb_SettingsAudioInputDevice cb_SettingsAudioOutputDevice hs_SettingsGuiOpacity diff --git a/samples/blackgui/mainwindow_init.cpp b/samples/blackgui/mainwindow_init.cpp index 0daaa1387..99f6a33a2 100644 --- a/samples/blackgui/mainwindow_init.cpp +++ b/samples/blackgui/mainwindow_init.cpp @@ -71,7 +71,6 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig) // timers if (this->m_timerUpdateAircraftsInRange == nullptr) this->m_timerUpdateAircraftsInRange = new QTimer(this); if (this->m_timerUpdateAtcStationsOnline == nullptr) this->m_timerUpdateAtcStationsOnline = new QTimer(this); - if (this->m_timerUpdateUsers == nullptr) this->m_timerUpdateUsers = new QTimer(this); if (this->m_timerContextWatchdog == nullptr) this->m_timerContextWatchdog = new QTimer(this); if (this->m_timerCollectedCockpitUpdates == nullptr) this->m_timerCollectedCockpitUpdates = new QTimer(this); if (this->m_timerAudioTests == nullptr) this->m_timerAudioTests = new QTimer(this); @@ -119,12 +118,15 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig) this->connect(this->getIContextSimulator(), &IContextSimulator::connectionChanged, this, &MainWindow::simulatorConnectionChanged); this->connect(this->m_timerUpdateAircraftsInRange, &QTimer::timeout, this, &MainWindow::timerBasedUpdates); this->connect(this->m_timerUpdateAtcStationsOnline, &QTimer::timeout, this, &MainWindow::timerBasedUpdates); - this->connect(this->m_timerUpdateUsers, &QTimer::timeout, this, &MainWindow::timerBasedUpdates); this->connect(this->m_timerContextWatchdog, &QTimer::timeout, this, &MainWindow::timerBasedUpdates); this->connect(this->m_timerCollectedCockpitUpdates, &QTimer::timeout, this, &MainWindow::sendCockpitUpdates); this->connect(this->m_timerAudioTests, &QTimer::timeout, this, &MainWindow::audioTestUpdate); this->connect(this->m_timerSimulator, &QTimer::timeout, this, &MainWindow::timerBasedUpdates); connect = this->connect(this->getIContextAudio(), &IContextAudio::audioTestCompleted, this, &MainWindow::audioTestUpdate); + + // sliders + this->connect(this->ui->hs_SettingsGuiUserRefreshTime, &QSlider::valueChanged, this->ui->twp_Users, &BlackGui::CUserComponent::setUpdateIntervalSeconds); + Q_ASSERT(connect); Q_UNUSED(connect); // suppress GCC warning in release build @@ -300,9 +302,9 @@ void MainWindow::initialDataReads() { // connection is already established this->reloadAircraftsInRange(); - this->reloadAllUsers(); this->reloadAtcStationsOnline(); this->updateGuiStatusInformation(); + this->ui->twp_Users->update(); } this->displayStatusMessage(CStatusMessage(CStatusMessage::TypeGui, CStatusMessage::SeverityInfo, "initial data read")); @@ -315,7 +317,7 @@ void MainWindow::startUpdateTimers() { this->m_timerUpdateAircraftsInRange->start(this->ui->hs_SettingsGuiAircraftRefreshTime->value() * 1000); this->m_timerUpdateAtcStationsOnline->start(this->ui->hs_SettingsGuiAtcRefreshTime->value() * 1000); - this->m_timerUpdateUsers->start(this->ui->hs_SettingsGuiUserRefreshTime->value() * 1000); + this->ui->twp_Users->setUpdateIntervalSeconds(this->ui->hs_SettingsGuiUserRefreshTime->value()); } /* @@ -325,11 +327,10 @@ void MainWindow::stopUpdateTimers(bool disconnect) { this->m_timerUpdateAircraftsInRange->stop(); this->m_timerUpdateAtcStationsOnline->stop(); - this->m_timerUpdateUsers->stop(); + this->ui->twp_Users->setUpdateInterval(-1); if (!disconnect) return; this->disconnect(this->m_timerUpdateAircraftsInRange); this->disconnect(this->m_timerUpdateAtcStationsOnline); - this->disconnect(this->m_timerUpdateUsers); } void MainWindow::stopAllTimers(bool disconnect)