From 5d6713032ffbaaf7473948bc9774177710f425a4 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 16 Sep 2014 13:40:08 +0200 Subject: [PATCH] Formatting, new icons --- src/blackgui/components/aircraftcomponent.cpp | 5 ++++- src/blackgui/components/atcstationcomponent.cpp | 9 +++++---- src/blackgui/components/atcstationcomponent.h | 10 ++++++++-- src/blackgui/components/maininfoareacomponent.h | 2 +- src/blackgui/dockwidget.h | 2 +- src/blackgui/infoarea.cpp | 4 ++-- src/blackgui/infoarea.h | 4 ++-- src/blackgui/models/listmodelbase.cpp | 2 +- src/blackgui/views/airportview.h | 4 ++-- src/blackgui/views/serverview.h | 4 ++-- src/blackgui/views/viewbase.h | 6 +++--- src/blackmisc/blackmisc.qrc | 7 +++++++ src/blackmisc/iconlist.cpp | 2 ++ src/blackmisc/icons.h | 16 ++++++++++++++++ src/blackmisc/setkeyboardhotkeylist.cpp | 12 ++++++++---- src/blackmisc/setkeyboardhotkeylist.h | 12 ++++++++---- 16 files changed, 72 insertions(+), 29 deletions(-) diff --git a/src/blackgui/components/aircraftcomponent.cpp b/src/blackgui/components/aircraftcomponent.cpp index 0abb222b4..6738990ec 100644 --- a/src/blackgui/components/aircraftcomponent.cpp +++ b/src/blackgui/components/aircraftcomponent.cpp @@ -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); diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index ce4cd6c80..c1351b37f 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -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 diff --git a/src/blackgui/components/atcstationcomponent.h b/src/blackgui/components/atcstationcomponent.h index 800a2d6ad..657470bbf 100644 --- a/src/blackgui/components/atcstationcomponent.h +++ b/src/blackgui/components/atcstationcomponent.h @@ -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 }; } } diff --git a/src/blackgui/components/maininfoareacomponent.h b/src/blackgui/components/maininfoareacomponent.h index e52b414ab..901e0536c 100644 --- a/src/blackgui/components/maininfoareacomponent.h +++ b/src/blackgui/components/maininfoareacomponent.h @@ -85,7 +85,7 @@ namespace BlackGui CTextMessageComponent *getTextMessageComponent(); //! Selected area of non floating areas - InfoArea getSelectedInfoArea() const { return static_cast(getSelectedInfoAreaIndex()); } + InfoArea getSelectedInfoArea() const { return static_cast(getSelectedTabBarIndex()); } public slots: //! Toggle floating of given area diff --git a/src/blackgui/dockwidget.h b/src/blackgui/dockwidget.h index 25d5616fb..641ade8d9 100644 --- a/src/blackgui/dockwidget.h +++ b/src/blackgui/dockwidget.h @@ -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: diff --git a/src/blackgui/infoarea.cpp b/src/blackgui/infoarea.cpp index 3396865d1..ac7deed5a 100644 --- a/src/blackgui/infoarea.cpp +++ b/src/blackgui/infoarea.cpp @@ -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) diff --git a/src/blackgui/infoarea.h b/src/blackgui/infoarea.h index f74831990..172b5039e 100644 --- a/src/blackgui/infoarea.h +++ b/src/blackgui/infoarea.h @@ -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 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); diff --git a/src/blackgui/models/listmodelbase.cpp b/src/blackgui/models/listmodelbase.cpp index c5ab42f2c..b72f97a58 100644 --- a/src/blackgui/models/listmodelbase.cpp +++ b/src/blackgui/models/listmodelbase.cpp @@ -168,7 +168,7 @@ namespace BlackGui } /* - * Sort + * Sort requested by abstract model */ template void CListModelBase::sort(int column, Qt::SortOrder order) { diff --git a/src/blackgui/views/airportview.h b/src/blackgui/views/airportview.h index bcd6f650d..4897b0a64 100644 --- a/src/blackgui/views/airportview.h +++ b/src/blackgui/views/airportview.h @@ -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" diff --git a/src/blackgui/views/serverview.h b/src/blackgui/views/serverview.h index 24f66c0d0..9a65017e5 100644 --- a/src/blackgui/views/serverview.h +++ b/src/blackgui/views/serverview.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" diff --git a/src/blackgui/views/viewbase.h b/src/blackgui/views/viewbase.h index 129951dea..ee3ba1aea 100644 --- a/src/blackgui/views/viewbase.h +++ b/src/blackgui/views/viewbase.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 #include @@ -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 diff --git a/src/blackmisc/blackmisc.qrc b/src/blackmisc/blackmisc.qrc index 595364655..6085793b0 100644 --- a/src/blackmisc/blackmisc.qrc +++ b/src/blackmisc/blackmisc.qrc @@ -64,6 +64,13 @@ icons/pastel/16/font-delete.png icons/pastel/16/table-delete.png icons/pastel/16/table-row-delete.png + icons/pastel/16/lock.png + icons/pastel/16/lock-add.png + icons/pastel/16/lock-broken.png + icons/pastel/16/lock-delete.png + icons/pastel/16/lock-edit.png + icons/pastel/16/lock-go.png + icons/pastel/16/lock-open.png icons/vatsim/C1.png diff --git a/src/blackmisc/iconlist.cpp b/src/blackmisc/iconlist.cpp index f380c14f7..b7396e60b 100644 --- a/src/blackmisc/iconlist.cpp +++ b/src/blackmisc/iconlist.cpp @@ -94,6 +94,8 @@ namespace BlackMisc CIcon(CIcons::StandardIconHeadingOne16, "heading"), CIcon(CIcons::StandardIconInfo16, "info"), CIcon(CIcons::StandardIconJoystick16, "joystick"), + CIcon(CIcons::StandardIconLockClosed16, "lock"), + CIcon(CIcons::StandardIconLockOpen16, "lock open"), CIcon(CIcons::StandardIconMonitorError16, "monitor error"), CIcon(CIcons::StandardIconPaperPlane16, "plane"), CIcon(CIcons::StandardIconPlugin16, "plugin"), diff --git a/src/blackmisc/icons.h b/src/blackmisc/icons.h index cac694aa5..6b1ed7ff1 100644 --- a/src/blackmisc/icons.h +++ b/src/blackmisc/icons.h @@ -87,6 +87,8 @@ namespace BlackMisc StandardIconHeadingOne16, StandardIconInfo16, StandardIconJoystick16, + StandardIconLockClosed16, + StandardIconLockOpen16, StandardIconMonitorError16, StandardIconPaperPlane16, StandardIconPlugin16, @@ -267,6 +269,20 @@ namespace BlackMisc return pm; } + //! Lock + static const QPixmap &lockOpen16() + { + static const QPixmap pm(":/pastel/icons/pastel/16/lock-open.png"); + return pm; + } + + //! Lock + static const QPixmap &lockClosed16() + { + static const QPixmap pm(":/pastel/icons/pastel/16/lock.png"); + return pm; + } + //! Plugin static const QPixmap &plugin16() { diff --git a/src/blackmisc/setkeyboardhotkeylist.cpp b/src/blackmisc/setkeyboardhotkeylist.cpp index f413326bd..ade7139da 100644 --- a/src/blackmisc/setkeyboardhotkeylist.cpp +++ b/src/blackmisc/setkeyboardhotkeylist.cpp @@ -1,7 +1,11 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* Copyright (C) 2013 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ #include "setkeyboardhotkeylist.h" #include "predicates.h" diff --git a/src/blackmisc/setkeyboardhotkeylist.h b/src/blackmisc/setkeyboardhotkeylist.h index c018ca823..6921baf3a 100644 --- a/src/blackmisc/setkeyboardhotkeylist.h +++ b/src/blackmisc/setkeyboardhotkeylist.h @@ -1,7 +1,11 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* Copyright (C) 2013 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ //! \file