mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 19:25:49 +08:00
refs #291, timers for aircraft component independent of network connection
Remarks: sim can be connected, while network is not
This commit is contained in:
@@ -311,10 +311,6 @@ void MainWindow::connectionStatusChanged(uint /** from **/, uint to, const QStri
|
|||||||
{
|
{
|
||||||
this->updateGuiStatusInformation();
|
this->updateGuiStatusInformation();
|
||||||
INetwork::ConnectionStatus newStatus = static_cast<INetwork::ConnectionStatus>(to);
|
INetwork::ConnectionStatus newStatus = static_cast<INetwork::ConnectionStatus>(to);
|
||||||
if (newStatus == INetwork::Connected)
|
|
||||||
this->startUpdateTimers();
|
|
||||||
else if (newStatus == INetwork::Disconnecting || newStatus == INetwork::Disconnected || newStatus == INetwork::DisconnectedError)
|
|
||||||
this->stopUpdateTimers();
|
|
||||||
|
|
||||||
// sounds
|
// sounds
|
||||||
switch (newStatus)
|
switch (newStatus)
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig)
|
|||||||
// hotkeys
|
// hotkeys
|
||||||
this->registerHotkeys();
|
this->registerHotkeys();
|
||||||
|
|
||||||
|
// update timers
|
||||||
|
this->startUpdateTimers();
|
||||||
|
|
||||||
// do this as last statement, so it can be used as flag
|
// do this as last statement, so it can be used as flag
|
||||||
// whether init has been completed
|
// whether init has been completed
|
||||||
this->m_init = true;
|
this->m_init = true;
|
||||||
@@ -234,24 +237,6 @@ void MainWindow::initialDataReads()
|
|||||||
|
|
||||||
this->ui->comp_Settings->reloadSettings(); // init read
|
this->ui->comp_Settings->reloadSettings(); // init read
|
||||||
this->reloadOwnAircraft(); // init read, independent of traffic network
|
this->reloadOwnAircraft(); // init read, independent of traffic network
|
||||||
|
|
||||||
// also reads bookings if not connected
|
|
||||||
if (this->getIContextNetwork()->isConnected())
|
|
||||||
{
|
|
||||||
// connection is already established
|
|
||||||
this->ui->comp_AtcStations->update();
|
|
||||||
this->ui->comp_Aircrafts->update();
|
|
||||||
|
|
||||||
this->updateGuiStatusInformation();
|
|
||||||
this->ui->comp_Users->update();
|
|
||||||
this->ui->comp_Aircrafts->update();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Initial booking read
|
|
||||||
QTimer::singleShot(30 * 1000, this->ui->comp_AtcStations, SLOT(update()));
|
|
||||||
}
|
|
||||||
|
|
||||||
this->displayStatusMessage(CStatusMessage(CStatusMessage::TypeGui, CStatusMessage::SeverityInfo, "initial data read"));
|
this->displayStatusMessage(CStatusMessage(CStatusMessage::TypeGui, CStatusMessage::SeverityInfo, "initial data read"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,15 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
Q_ASSERT(this->ui->tvp_AircraftsInRange);
|
Q_ASSERT(this->ui->tvp_AircraftsInRange);
|
||||||
Q_ASSERT(this->getIContextNetwork());
|
Q_ASSERT(this->getIContextNetwork());
|
||||||
|
Q_ASSERT(this->getIContextSimulator());
|
||||||
|
|
||||||
if (this->getIContextNetwork()->isConnected())
|
if (this->getIContextNetwork()->isConnected())
|
||||||
{
|
{
|
||||||
this->ui->tvp_AircraftsInRange->update(this->getIContextNetwork()->getAircraftsInRange());
|
this->ui->tvp_AircraftsInRange->update(this->getIContextNetwork()->getAircraftsInRange());
|
||||||
}
|
}
|
||||||
|
if (this->getIContextSimulator()->isConnected())
|
||||||
|
{
|
||||||
|
this->ui->tvp_AirportsInRange->update(this->getIContextSimulator()->getAirportsInRange());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,14 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>TabWidget</string>
|
<string>Airports in range</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tb_AircraftsInRange">
|
<widget class="QWidget" name="tb_AircraftsInRange">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>In range</string>
|
<string>Aircrafts in range</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="vl_AircraftsInRange">
|
<layout class="QVBoxLayout" name="vl_AircraftsInRange">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@@ -45,6 +45,35 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tb_AirportsInRange">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Airports in range</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="vl_AirportsInRange">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::CAirportView" name="tvp_AirportsInRange">
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
@@ -52,6 +81,11 @@
|
|||||||
<extends>QTableView</extends>
|
<extends>QTableView</extends>
|
||||||
<header>blackgui/aircraftview.h</header>
|
<header>blackgui/aircraftview.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::CAirportView</class>
|
||||||
|
<extends>QTableView</extends>
|
||||||
|
<header>blackgui/airportview.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
Reference in New Issue
Block a user