mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Improved ATIS update in ATC station component
* signal for ATIS received * reload ATC statiosns when ATIS changes
This commit is contained in:
committed by
Roland Winklmeier
parent
0b7706471c
commit
ae8d9abf0d
@@ -38,8 +38,8 @@
|
||||
#include <QTimer>
|
||||
#include <QTreeView>
|
||||
#include <QCompleter>
|
||||
#include <QPointer>
|
||||
|
||||
using namespace BlackGui;
|
||||
using namespace BlackGui::Models;
|
||||
using namespace BlackGui::Views;
|
||||
using namespace BlackGui::Settings;
|
||||
@@ -292,7 +292,12 @@ namespace BlackGui
|
||||
if (this->isParentDockWidgetFloating()) { return; }
|
||||
|
||||
// here I know I am the selected widget, update, but keep GUI responsive (-> timer)
|
||||
QTimer::singleShot(1000, this, &CAtcStationComponent::update);
|
||||
const QPointer<CAtcStationComponent> myself(this);
|
||||
QTimer::singleShot(1000, this, [ = ]
|
||||
{
|
||||
if (myself.isNull()) { return; }
|
||||
this->update();
|
||||
});
|
||||
Q_UNUSED(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,12 @@ namespace BlackGui
|
||||
//! Number of online stations
|
||||
int countOnlineStations() const;
|
||||
|
||||
//! Update stations
|
||||
void update();
|
||||
|
||||
//! Get METAR for given ICAO airport code
|
||||
void getMetar(const QString &airportIcaoCode);
|
||||
|
||||
//! \copydoc CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea
|
||||
virtual bool setParentDockWidgetInfoArea(BlackGui::CDockWidgetInfoArea *parentDockableWidget) override;
|
||||
|
||||
@@ -68,17 +74,10 @@ namespace BlackGui
|
||||
//! Request a text message
|
||||
void requestTextMessageWidget(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
public slots:
|
||||
//! Update stations
|
||||
void update();
|
||||
|
||||
//! Get METAR for given ICAO airport code
|
||||
void getMetar(const QString &airportIcaoCode);
|
||||
|
||||
private:
|
||||
//! \copydoc Models::CAtcStationListModel::changedAtcStationConnectionStatus
|
||||
void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool added);
|
||||
|
||||
private:
|
||||
//! Get all METARs
|
||||
void getMetarAsEntered();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user