mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Fixed bugs for ATC bookings, those can be read even if network is not connected
This commit is contained in:
@@ -461,7 +461,7 @@ QStatusBar QLabel {
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
<number>7</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pg_StatusPage">
|
||||
<property name="sizePolicy">
|
||||
@@ -571,8 +571,8 @@ QStatusBar QLabel {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>90</width>
|
||||
<height>59</height>
|
||||
<width>326</width>
|
||||
<height>267</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -859,7 +859,7 @@ QStatusBar QLabel {
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tw_Settings">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tb_SettingsTrafficNetwork">
|
||||
<attribute name="title">
|
||||
@@ -1355,6 +1355,13 @@ QStatusBar QLabel {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="cb_SettingsAudioNotificationVoiceRoom">
|
||||
<property name="text">
|
||||
<string>notification for join/leave voice room</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -261,16 +261,22 @@ void MainWindow::initialDataReads()
|
||||
this->reloadSettings(); // init read
|
||||
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_Aircrafts->update();
|
||||
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"));
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ namespace BlackGui
|
||||
connected = this->connect(this->ui->pb_AtcStationsLoadMetar, SIGNAL(clicked()), this, SLOT(getMetar()));
|
||||
Q_ASSERT(connected);
|
||||
this->connect(this, &QTabWidget::currentChanged, this, &CAtcStationComponent::atcStationsTabChanged);
|
||||
this->connect(this->ui->pb_ReloadAtcStationsBooked, &QPushButton::clicked, this, &CAtcStationComponent::reloadAtcStationsBooked);
|
||||
this->connect(this->ui->tvp_AtcStationsOnline, &QTableView::clicked, this, &CAtcStationComponent::onlineAtcStationSelected);
|
||||
this->connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::requestAtis);
|
||||
this->connect(this->ui->pb_ReloadAtcStationsBooked, &QPushButton::clicked, this, &CAtcStationComponent::reloadAtcStationsBooked);
|
||||
}
|
||||
|
||||
CAtcStationComponent::~CAtcStationComponent()
|
||||
@@ -46,11 +46,11 @@ namespace BlackGui
|
||||
Q_ASSERT(this->ui->tvp_AtcStationsOnline);
|
||||
Q_ASSERT(this->getIContextNetwork());
|
||||
|
||||
// initial read for bookings
|
||||
if (this->ui->tvp_AtcStationsBooked->isEmpty()) this->reloadAtcStationsBooked();
|
||||
|
||||
if (this->getIContextNetwork()->isConnected())
|
||||
{
|
||||
// initial read for bookings
|
||||
if (this->ui->tvp_AtcStationsBooked->isEmpty()) this->reloadAtcStationsBooked();
|
||||
|
||||
// update
|
||||
if (this->m_timestampOnlineStationsChanged.isNull() || this->m_timestampLastReadOnlineStations.isNull() ||
|
||||
(this->m_timestampOnlineStationsChanged > this->m_timestampLastReadOnlineStations))
|
||||
@@ -71,11 +71,8 @@ namespace BlackGui
|
||||
Q_ASSERT(this->ui->tvp_AtcStationsBooked);
|
||||
Q_ASSERT(this->getIContextNetwork());
|
||||
|
||||
if (this->getIContextNetwork()->isConnected())
|
||||
{
|
||||
this->ui->tvp_AtcStationsBooked->update(this->getIContextNetwork()->getAtcStationsBooked());
|
||||
this->m_timestampLastReadBookedStations = QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
this->ui->tvp_AtcStationsBooked->update(this->getIContextNetwork()->getAtcStationsBooked());
|
||||
this->m_timestampLastReadBookedStations = QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
|
||||
void CAtcStationComponent::changedAtcStationsOnline()
|
||||
|
||||
Reference in New Issue
Block a user