Formatting, renaming

This commit is contained in:
Klaus Basan
2014-09-13 23:47:02 +02:00
parent 936cc7c147
commit 1ce7b11988
7 changed files with 37 additions and 37 deletions

View File

@@ -95,6 +95,33 @@ namespace BlackGui
}
}
void CAtcStationComponent::changedAtcStationOnlineConnectionStatus(const CAtcStation &station, bool added)
{
this->ui->tvp_AtcStationsOnline->changedAtcStationConnectionStatus(station, added);
}
void CAtcStationComponent::getMetar(const QString &airportIcaoCode)
{
if (!this->getIContextNetwork()->isConnected())
{
this->ui->te_AtcStationsOnlineInfo->clear();
return;
}
QString icao = airportIcaoCode.isEmpty() ? this->ui->le_AtcStationsOnlineMetar->text().trimmed().toUpper() : airportIcaoCode.trimmed().toUpper();
this->ui->le_AtcStationsOnlineMetar->setText(icao);
if (icao.length() != 4) return;
CInformationMessage metar = this->getIContextNetwork()->getMetar(icao);
if (metar.getType() != CInformationMessage::METAR) return;
if (metar.isEmpty())
{
this->ui->te_AtcStationsOnlineInfo->clear();
}
else
{
this->ui->te_AtcStationsOnlineInfo->setText(metar.getMessage());
}
}
void CAtcStationComponent::ps_reloadAtcStationsBooked()
{
Q_ASSERT(this->ui->tvp_AtcStationsBooked);
@@ -151,33 +178,6 @@ namespace BlackGui
}
}
void CAtcStationComponent::changedAtcStationOnlineConnectionStatus(const CAtcStation &station, bool added)
{
this->ui->tvp_AtcStationsOnline->changedAtcStationConnectionStatus(station, added);
}
void CAtcStationComponent::getMetar(const QString &airportIcaoCode)
{
if (!this->getIContextNetwork()->isConnected())
{
this->ui->te_AtcStationsOnlineInfo->clear();
return;
}
QString icao = airportIcaoCode.isEmpty() ? this->ui->le_AtcStationsOnlineMetar->text().trimmed().toUpper() : airportIcaoCode.trimmed().toUpper();
this->ui->le_AtcStationsOnlineMetar->setText(icao);
if (icao.length() != 4) return;
CInformationMessage metar = this->getIContextNetwork()->getMetar(icao);
if (metar.getType() != CInformationMessage::METAR) return;
if (metar.isEmpty())
{
this->ui->te_AtcStationsOnlineInfo->clear();
}
else
{
this->ui->te_AtcStationsOnlineInfo->setText(metar.getMessage());
}
}
void CAtcStationComponent::ps_onlineAtcStationSelected(QModelIndex index)
{
this->ui->te_AtcStationsOnlineInfo->setText(""); // reset

View File

@@ -43,7 +43,7 @@ namespace BlackGui
CTimerBasedComponent *getTimerComponent() { return this->m_timerComponent; }
public slots:
//! Update users
//! Update stations
void update();
//! \copydoc CTimerBasedComponent::setUpdateIntervalSeconds
@@ -95,9 +95,9 @@ namespace BlackGui
Ui::CAtcStationComponent *ui;
CTimerBasedComponent *m_timerComponent;
QDateTime m_timestampLastReadOnlineStations = CTimerBasedComponent::epoch(); //!< stations read
QDateTime m_timestampOnlineStationsChanged = CTimerBasedComponent::epoch(); //!< stations marked as changed
QDateTime m_timestampOnlineStationsChanged = CTimerBasedComponent::epoch(); //!< stations marked as changed
QDateTime m_timestampLastReadBookedStations = CTimerBasedComponent::epoch(); //!< stations read
QDateTime m_timestampBookedStationsChanged = CTimerBasedComponent::epoch(); //!< stations marked as changed
QDateTime m_timestampBookedStationsChanged = CTimerBasedComponent::epoch(); //!< stations marked as changed
};
}
}

View File

@@ -19,12 +19,12 @@ namespace BlackGui
{
CDockWidget::CDockWidget(QWidget *parent) : QDockWidget(parent)
{
this->ps_onStyleSheetsChanged();
this->onStyleSheetsChanged();
this->initTitleBarWidgets();
// connect
connect(this, &QDockWidget::topLevelChanged, this, &CDockWidget::ps_onTopLevelChanged);
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CDockWidget::ps_onStyleSheetsChanged);
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CDockWidget::onStyleSheetsChanged);
// context menu
this->setContextMenuPolicy(Qt::CustomContextMenu);

View File

@@ -117,7 +117,7 @@ namespace BlackGui
protected slots:
//! Style sheet has changed
virtual void ps_onStyleSheetsChanged();
virtual void onStyleSheetsChanged();
private slots:
//! Top level has been chaged

View File

@@ -24,7 +24,7 @@ namespace BlackGui
this->setMarginsWhenDocked(0, 0, 0, -1);
this->setWindowTitle("Info bar");
this->setWindowIcon(CIcons::swift24());
this->ps_onStyleSheetsChanged();
this->onStyleSheetsChanged();
}
void CDockWidgetInfoBar::addToContextMenu(QMenu *contextMenu) const
@@ -33,7 +33,7 @@ namespace BlackGui
CDockWidget::addToContextMenu(contextMenu);
}
void CDockWidgetInfoBar::ps_onStyleSheetsChanged()
void CDockWidgetInfoBar::onStyleSheetsChanged()
{
QString st = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameInfoBar());
this->setStyleSheet(st);

View File

@@ -34,7 +34,7 @@ namespace BlackGui
protected slots:
//! \copydoc CDockWidget::ps_onStyleSheetsChanged
virtual void ps_onStyleSheetsChanged() override;
virtual void onStyleSheetsChanged() override;
};

View File

@@ -28,7 +28,7 @@ namespace BlackGui
void CInfoArea::initInfoArea()
{
// after(!) GUI established
// after(!) GUI is established
if (this->m_dockableWidgets.isEmpty())
{
this->m_dockableWidgets = this->findChildren<CDockWidgetInfoArea *>();