mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 21:05:31 +08:00
Formatting, new icons
This commit is contained in:
@@ -16,7 +16,10 @@ namespace BlackGui
|
||||
{
|
||||
|
||||
CAircraftComponent::CAircraftComponent(QWidget *parent) :
|
||||
QTabWidget(parent), CRuntimeBasedComponent(nullptr, false), ui(new Ui::CAircraftComponent), m_timerComponent(nullptr)
|
||||
QTabWidget(parent),
|
||||
CDockWidgetInfoAreaComponent(this),
|
||||
CRuntimeBasedComponent(nullptr, false),
|
||||
ui(new Ui::CAircraftComponent), m_timerComponent(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_timerComponent = new CTimerBasedComponent(SLOT(update()), this);
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#include "atcstationcomponent.h"
|
||||
#include "../views/atcstationview.h"
|
||||
#include "ui_atcstationcomponent.h"
|
||||
#include "blackmisc/avinformationmessage.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
//! \file
|
||||
|
||||
using namespace BlackGui::Models;
|
||||
using namespace BlackGui::Views;
|
||||
using namespace BlackMisc::Aviation;
|
||||
@@ -94,6 +94,7 @@ namespace BlackGui
|
||||
bool hasData = this->countBookedStations() > 0 || this->countOnlineStations() > 0;
|
||||
if (hasData && !this->isVisibleWidget())
|
||||
{
|
||||
// KWB remove: qDebug() will be removed soo
|
||||
qDebug() << this->objectName() << "Skipping update, not visible";
|
||||
return;
|
||||
}
|
||||
@@ -239,5 +240,5 @@ namespace BlackGui
|
||||
if (!this->getIContextNetwork()->isConnected()) return;
|
||||
this->getIContextNetwork()->requestAtisUpdates();
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -101,13 +101,19 @@ namespace BlackGui
|
||||
//! Request dummy ATC online stations
|
||||
void ps_testCreateDummyOnlineAtcStations(int number);
|
||||
|
||||
//! Request udpate
|
||||
void ps_requestOnlineStationsUpdate();
|
||||
|
||||
//! Info area tab bar has changed
|
||||
void ps_infoAreaTabBarChanged(int index);
|
||||
|
||||
private:
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BlackGui
|
||||
CTextMessageComponent *getTextMessageComponent();
|
||||
|
||||
//! Selected area of non floating areas
|
||||
InfoArea getSelectedInfoArea() const { return static_cast<InfoArea>(getSelectedInfoAreaIndex()); }
|
||||
InfoArea getSelectedInfoArea() const { return static_cast<InfoArea>(getSelectedTabBarIndex()); }
|
||||
|
||||
public slots:
|
||||
//! Toggle floating of given area
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace BlackGui
|
||||
//! \sa CDockWidgetInfoBar
|
||||
class CDockWidget : public QDockWidget
|
||||
{
|
||||
// KB TODO: Make this an interface, IDockWidget
|
||||
// KB TODO: Make this an interface, IDockWidget?
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
int CInfoArea::getSelectedInfoAreaIndex() const
|
||||
int CInfoArea::getSelectedTabBarIndex() const
|
||||
{
|
||||
Q_ASSERT(this->m_tabBar);
|
||||
if (!this->m_tabBar || this->m_tabBar->count() < 1) return -1;
|
||||
@@ -347,7 +347,7 @@ namespace BlackGui
|
||||
return this->m_tabBar->count();
|
||||
}
|
||||
|
||||
CDockWidgetInfoArea *CInfoArea::getDockableWidgetByTabIndex(int tabBarIndex) const
|
||||
CDockWidgetInfoArea *CInfoArea::getDockableWidgetByTabBarIndex(int tabBarIndex) const
|
||||
{
|
||||
if (tabBarIndex >= this->m_dockableWidgets.count() || tabBarIndex < 0) return nullptr;
|
||||
for (CDockWidgetInfoArea *dw : this->m_dockableWidgets)
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace BlackGui
|
||||
|
||||
//! Selected area of non floating areas
|
||||
//! \remarks -1 for no area
|
||||
int getSelectedInfoAreaIndex() const;
|
||||
int getSelectedTabBarIndex() const;
|
||||
|
||||
//! Is given widget selected. Means it is not floating, and the one selected
|
||||
bool isSelectedInfoArea(const CDockWidgetInfoArea *infoArea) const;
|
||||
@@ -102,7 +102,7 @@ namespace BlackGui
|
||||
QList<CDockWidgetInfoArea *> dockableWidgets() const;
|
||||
|
||||
//! Corresponding dockable widget for given tab index
|
||||
CDockWidgetInfoArea *getDockableWidgetByTabIndex(int tabBarIndex) const;
|
||||
CDockWidgetInfoArea *getDockableWidgetByTabBarIndex(int tabBarIndex) const;
|
||||
|
||||
//! Features of the dockable widgets
|
||||
void setFeaturesForDockableWidgets(QDockWidget::DockWidgetFeatures features);
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort
|
||||
* Sort requested by abstract model
|
||||
*/
|
||||
template <typename ObjectType, typename ContainerType> void CListModelBase<ObjectType, ContainerType>::sort(int column, Qt::SortOrder order)
|
||||
{
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_AIRPORTVIEW_H
|
||||
#define BLACKGUI_AIRPORTVIEW_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "viewbase.h"
|
||||
#include "../models/airportlistmodel.h"
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_SERVERVIEW_H
|
||||
#define BLACKGUI_SERVERVIEW_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "viewbase.h"
|
||||
#include "../models/serverlistmodel.h"
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_VIEWBASE_H
|
||||
#define BLACKGUI_VIEWBASE_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "blackmisc/icons.h"
|
||||
#include <QTableView>
|
||||
#include <QMenu>
|
||||
@@ -22,7 +22,7 @@ namespace BlackGui
|
||||
namespace Views
|
||||
{
|
||||
|
||||
//! Non templated base class, allows Q_OBJECT and signals
|
||||
//! Non templated base class, allows Q_OBJECT and signals to be used
|
||||
class CViewBaseNonTemplate : public QTableView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user