From e88ee7c808be95c9248fbb0e222c0fc3e7bf2a6e Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 7 Feb 2014 21:31:03 +0100 Subject: [PATCH] refs #93, re-read ATIS by pressing button from GUI --- samples/blackgui/mainwindow.h | 3 +++ samples/blackgui/mainwindow_atc.cpp | 11 ++++++++++- samples/blackgui/mainwindow_init.cpp | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/samples/blackgui/mainwindow.h b/samples/blackgui/mainwindow.h index df48af20e..0bee740d9 100644 --- a/samples/blackgui/mainwindow.h +++ b/samples/blackgui/mainwindow.h @@ -448,6 +448,9 @@ private slots: */ void getMetar(const QString &airportIcaoCode = ""); + //! \brief Request new ATIS + void requestAtis(); + /*! * \brief Close text message tab */ diff --git a/samples/blackgui/mainwindow_atc.cpp b/samples/blackgui/mainwindow_atc.cpp index 5bd372be0..1a124d4ff 100644 --- a/samples/blackgui/mainwindow_atc.cpp +++ b/samples/blackgui/mainwindow_atc.cpp @@ -63,7 +63,6 @@ void MainWindow::onlineAtcStationSelected(QModelIndex index) if (!infoMessage.isEmpty()) infoMessage.append("\n\n"); infoMessage.append(stationClicked.getMetar().getMessage()); } - this->ui->te_AtcStationsOnlineInfo->setText(infoMessage); } @@ -83,6 +82,16 @@ void MainWindow::getMetar(const QString &airportIcaoCode) this->ui->te_AtcStationsOnlineInfo->setText(metar.getMessage()); } +/* + * Get METAR + */ +void MainWindow::requestAtis() +{ + if (!this->isContextNetworkAvailableCheck()) return; + if (!this->m_contextNetwork->isConnected()) return; + this->m_contextNetwork->requestAtisUpdates(); +} + /* * ATC station tab changed are changed */ diff --git a/samples/blackgui/mainwindow_init.cpp b/samples/blackgui/mainwindow_init.cpp index 7975a35ee..6b941e5ec 100644 --- a/samples/blackgui/mainwindow_init.cpp +++ b/samples/blackgui/mainwindow_init.cpp @@ -317,6 +317,7 @@ void MainWindow::initGuiSignals() this->connect(this->ui->tw_AtcStations, &QTabWidget::currentChanged, this, &MainWindow::atcStationTabChanged); this->connect(this->ui->pb_ReloadAtcStationsBooked, &QPushButton::clicked, this, &MainWindow::reloadAtcStationsBooked); this->connect(this->ui->tv_AtcStationsOnline, &QTableView::clicked, this, &MainWindow::onlineAtcStationSelected); + this->connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &MainWindow::requestAtis); // Settings server this->connect(this->ui->pb_SettingsTnCurrentServer, &QPushButton::released, this, &MainWindow::alterTrafficServer);