diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 5fb6b8bf5..68b605e5d 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -34,11 +34,9 @@ add_library(gui SHARED models/distributorfilter.cpp models/columns.h models/aircraftsituationchangelistmodel.h - models/windlayerlistmodel.h models/actionhotkeylistmodel.cpp models/listmodelbaseaviation.cpp models/interpolationsetupmodel.cpp - models/windlayerlistmodel.cpp models/matchingstatisticsmodel.h models/modelfilter.cpp models/aircrafticaolistmodel.cpp @@ -82,7 +80,6 @@ add_library(gui SHARED models/clientlistmodel.cpp models/aircrafticaofilter.h models/atcstationlistmodel.cpp - models/cloudlayerlistmodel.cpp models/simulatedaircraftlistmodel.h models/statusmessagelistmodel.h models/aircraftcategorytreemodel.cpp @@ -105,7 +102,6 @@ add_library(gui SHARED models/applicationinfolistmodel.h models/identifierlistmodel.h models/modelfilter.h - models/cloudlayerlistmodel.h models/userlistmodel.cpp models/airportlistmodel.cpp models/actionhotkeylistmodel.h @@ -116,16 +112,13 @@ add_library(gui SHARED models/atcstationlistmodel.h enableforviewbasedindicator.h pluginconfigwindow.h - views/cloudlayerview.cpp views/interpolationsetupview.cpp views/userview.h views/aircraftcategorytreeview.h - views/windlayerview.h views/viewtimestampobjects.cpp views/aircrafticaoview.h views/viewbase.h views/viewbasemisc.cpp - views/windlayerview.cpp views/distributorview.h views/checkboxdelegate.cpp views/viewbaseproxystyle.cpp @@ -171,7 +164,6 @@ add_library(gui SHARED views/aircraftmodelstatisticsdialog.ui views/aircraftmodelstatisticsdialog.h views/audiodeviceinfoview.cpp - views/viewbaseweather.cpp views/clientview.cpp views/viewbaseitemdelegate.cpp views/aircraftsituationchangeview.cpp @@ -199,7 +191,6 @@ add_library(gui SHARED views/radarview.cpp views/liveryview.cpp views/viewbasesimulation.cpp - views/cloudlayerview.h views/countryview.cpp views/liveryview.h views/flightplandialog.cpp diff --git a/src/gui/models/cloudlayerlistmodel.cpp b/src/gui/models/cloudlayerlistmodel.cpp deleted file mode 100644 index 9d39176b9..000000000 --- a/src/gui/models/cloudlayerlistmodel.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "gui/models/cloudlayerlistmodel.h" - -#include -#include - -#include "gui/models/columnformatters.h" - -using namespace swift::misc; -using namespace swift::misc::physical_quantities; -using namespace swift::misc::weather; - -namespace swift::gui::models -{ - - //! Relative Humidity - class CPrecipitationRateFormatter : public CDefaultFormatter - { - public: - //! Constructor - CPrecipitationRateFormatter(int alignment = alignDefault()) : CDefaultFormatter(alignment, false, roleDisplay()) - {} - - //! \copydoc CDefaultFormatter::displayRole - virtual CVariant displayRole(const CVariant &dataCVariant) const override - { - if (dataCVariant.canConvert()) - { - double rate = dataCVariant.value(); - QString formattedString = QString::number(rate) + " mm/h"; - return formattedString; - } - Q_ASSERT_X(false, "CPrecipitationRateFormatter", "no double value"); - return CVariant(); - } - }; - - //! Precipitation - class CPrecipitationFormatter : public CDefaultFormatter - { - public: - //! Constructor - CPrecipitationFormatter(int alignment = alignDefault()) : CDefaultFormatter(alignment, false, roleDisplay()) {} - - //! \copydoc CDefaultFormatter::displayRole - virtual CVariant displayRole(const CVariant &dataCVariant) const override - { - if (dataCVariant.canConvert()) - { - CCloudLayer::Precipitation precipitation = dataCVariant.value(); - switch (precipitation) - { - case CCloudLayer::PrecipitationUnknown: return QString("Unknown"); - case CCloudLayer::NoPrecipitation: return QString("None"); - case CCloudLayer::Rain: return QString("Rain"); - case CCloudLayer::Snow: return QString("Snow"); - } - } - Q_ASSERT_X(false, "CPrecipitationFormatter", "no CCloudLayer::Precipitation value"); - return CVariant(); - } - }; - - //! Clouds - class CCloudsFormatter : public CDefaultFormatter - { - public: - //! Constructor - CCloudsFormatter(int alignment = alignDefault()) : CDefaultFormatter(alignment, false, roleDisplay()) {} - - //! \copydoc CDefaultFormatter::displayRole - virtual CVariant displayRole(const CVariant &dataCVariant) const override - { - if (dataCVariant.canConvert()) - { - CCloudLayer::Clouds clouds = dataCVariant.value(); - switch (clouds) - { - case CCloudLayer::NoClouds: return QString("None"); - case CCloudLayer::Cirrus: return QString("Cirrus"); - case CCloudLayer::Stratus: return QString("Stratus"); - case CCloudLayer::Cumulus: return QString("Cumulus"); - case CCloudLayer::Thunderstorm: return QString("Thunderstorm"); - case CCloudLayer::CloudsUnknown: return QString("N/A"); - } - } - Q_ASSERT_X(false, "CCloudsFormatter", "no CCloudLayer::Clouds value"); - return CVariant(); - } - }; - - //! Relative Humidity - class CCoverageFormatter : public CDefaultFormatter - { - public: - //! Constructor - CCoverageFormatter(int alignment = alignDefault()) : CDefaultFormatter(alignment, false, roleDisplay()) {} - - //! \copydoc CDefaultFormatter::displayRole - virtual CVariant displayRole(const CVariant &dataCVariant) const override - { - if (dataCVariant.canConvert()) - { - int coverage = dataCVariant.value(); - QString formattedString = QString::number(coverage) + " %"; - return formattedString; - } - Q_ASSERT_X(false, "CCoverageFormatter", "no int value"); - return CVariant(); - } - }; - - CCloudLayerListModel::CCloudLayerListModel(QObject *parent) : CListModelBase("CloudLayerListModel", parent) - { - this->m_columns.addColumn(CColumn("base", CCloudLayer::IndexBase, new CAltitudeFormatter())); - this->m_columns.addColumn(CColumn("top", CCloudLayer::IndexTop, new CAltitudeFormatter())); - this->m_columns.addColumn( - CColumn("precipitation rate", CCloudLayer::IndexPrecipitationRate, new CPrecipitationRateFormatter())); - this->m_columns.addColumn( - CColumn("precipitation", CCloudLayer::IndexPrecipitation, new CPrecipitationFormatter())); - this->m_columns.addColumn(CColumn("clouds", CCloudLayer::IndexClouds, new CCloudsFormatter())); - this->m_columns.addColumn(CColumn("coverage", CCloudLayer::IndexCoveragePercent, new CCoverageFormatter())); - - // default sort order - this->setSortColumnByPropertyIndex(CCloudLayer::IndexBase); - this->m_sortOrder = Qt::AscendingOrder; - - // force strings for translation in resource files - (void)QT_TRANSLATE_NOOP("ModelCloudLayerList", "base"); - (void)QT_TRANSLATE_NOOP("ModelCloudLayerList", "top"); - (void)QT_TRANSLATE_NOOP("ModelCloudLayerList", "precipitation rate"); - (void)QT_TRANSLATE_NOOP("ModelCloudLayerList", "precipitation"); - (void)QT_TRANSLATE_NOOP("ModelCloudLayerList", "clouds"); - (void)QT_TRANSLATE_NOOP("ModelCloudLayerList", "coverage"); - } -} // namespace swift::gui::models diff --git a/src/gui/models/cloudlayerlistmodel.h b/src/gui/models/cloudlayerlistmodel.h deleted file mode 100644 index c7d0bf1b7..000000000 --- a/src/gui/models/cloudlayerlistmodel.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef SWIFT_GUI_MODELS_CLOUDLAYERLISTMODEL_H -#define SWIFT_GUI_MODELS_CLOUDLAYERLISTMODEL_H - -#include "gui/models/listmodelbase.h" -#include "gui/swiftguiexport.h" -#include "misc/weather/cloudlayer.h" -#include "misc/weather/cloudlayerlist.h" - -class QObject; - -namespace swift::gui::models -{ - //! Cloud layer list model - class SWIFT_GUI_EXPORT CCloudLayerListModel : public CListModelBase - { - Q_OBJECT - - public: - //! Constructor - explicit CCloudLayerListModel(QObject *parent = nullptr); - - //! Destructor - virtual ~CCloudLayerListModel() {} - }; -} // namespace swift::gui::models -#endif // SWIFT_GUI_MODELS_CLOUDLAYERLISTMODEL_H diff --git a/src/gui/models/windlayerlistmodel.cpp b/src/gui/models/windlayerlistmodel.cpp deleted file mode 100644 index 397e2eefe..000000000 --- a/src/gui/models/windlayerlistmodel.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "windlayerlistmodel.h" - -#include -#include - -#include "gui/models/columnformatters.h" - -using namespace swift::misc; -using namespace swift::misc::physical_quantities; -using namespace swift::misc::weather; - -namespace swift::gui::models -{ - CWindLayerListModel::CWindLayerListModel(QObject *parent) : CListModelBase("WindLayerListModel", parent) - { - m_columns.addColumn(CColumn("level", CWindLayer::IndexLevel, new CAltitudeFormatter())); - m_columns.addColumn(CColumn("direction", CWindLayer::IndexDirection, new CAngleDegreeFormatter())); - m_columns.addColumn(CColumn("speed", CWindLayer::IndexSpeed, new CSpeedKtsFormatter())); - m_columns.addColumn(CColumn("gust speed", CWindLayer::IndexGustSpeed, new CSpeedKtsFormatter())); - - // default sort order - this->setSortColumnByPropertyIndex(CWindLayer::IndexLevel); - m_sortOrder = Qt::AscendingOrder; - - // force strings for translation in resource files - (void)QT_TRANSLATE_NOOP("ModelWindLayerList", "level"); - (void)QT_TRANSLATE_NOOP("ModelWindLayerList", "direction"); - (void)QT_TRANSLATE_NOOP("ModelWindLayerList", "speed"); - (void)QT_TRANSLATE_NOOP("ModelWindLayerList", "gust speed"); - } -} // namespace swift::gui::models diff --git a/src/gui/models/windlayerlistmodel.h b/src/gui/models/windlayerlistmodel.h deleted file mode 100644 index 5f35a5ee1..000000000 --- a/src/gui/models/windlayerlistmodel.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef SWIFT_GUI_MODELS_WINDLAYERLISTMODEL_H -#define SWIFT_GUI_MODELS_WINDLAYERLISTMODEL_H - -#include "gui/models/listmodelbase.h" -#include "gui/swiftguiexport.h" -#include "misc/weather/windlayer.h" -#include "misc/weather/windlayerlist.h" - -class QObject; - -namespace swift::gui::models -{ - //! Wind layer list model - class SWIFT_GUI_EXPORT CWindLayerListModel : public CListModelBase - { - Q_OBJECT - - public: - //! Constructor - explicit CWindLayerListModel(QObject *parent = nullptr); - - //! Destructor - virtual ~CWindLayerListModel() {} - }; -} // namespace swift::gui::models -#endif // SWIFT_GUI_MODELS_WINDLAYERLISTMODEL_H diff --git a/src/gui/views/cloudlayerview.cpp b/src/gui/views/cloudlayerview.cpp deleted file mode 100644 index a0d3bb727..000000000 --- a/src/gui/views/cloudlayerview.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "gui/views/cloudlayerview.h" - -#include "gui/models/cloudlayerlistmodel.h" - -using namespace swift::misc; -using namespace swift::gui::models; - -namespace swift::gui::views -{ - CCloudLayerView::CCloudLayerView(QWidget *parent) : CViewBase(parent) - { - this->standardInit(new CCloudLayerListModel(this)); - } -} // namespace swift::gui::views diff --git a/src/gui/views/cloudlayerview.h b/src/gui/views/cloudlayerview.h deleted file mode 100644 index 75b8e681f..000000000 --- a/src/gui/views/cloudlayerview.h +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef SWIFT_GUI_CLOUDLAYERVIEW_H -#define SWIFT_GUI_CLOUDLAYERVIEW_H - -#include "gui/models/cloudlayerlistmodel.h" -#include "gui/swiftguiexport.h" -#include "gui/views/viewbase.h" - -class QWidget; - -namespace swift::misc::weather -{ - class CCloudLayer; -} - -namespace swift::gui::views -{ - //! Airports view - class SWIFT_GUI_EXPORT CCloudLayerView : public CViewBase - { - Q_OBJECT - - public: - //! Constructor - explicit CCloudLayerView(QWidget *parent = nullptr); - }; -} // namespace swift::gui::views -#endif // SWIFT_GUI_CLOUDLAYERVIEW_H diff --git a/src/gui/views/viewbaseweather.cpp b/src/gui/views/viewbaseweather.cpp deleted file mode 100644 index 9b01cee03..000000000 --- a/src/gui/views/viewbaseweather.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "viewbase.cpp" - -namespace swift::gui::views -{ - template class CViewBase; - template class CViewBase; -} // namespace swift::gui::views diff --git a/src/gui/views/windlayerview.cpp b/src/gui/views/windlayerview.cpp deleted file mode 100644 index e7628b039..000000000 --- a/src/gui/views/windlayerview.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "gui/views/windlayerview.h" - -#include "gui/models/windlayerlistmodel.h" - -using namespace swift::misc; -using namespace swift::gui::models; - -namespace swift::gui::views -{ - CWindLayerView::CWindLayerView(QWidget *parent) : CViewBase(parent) - { - this->standardInit(new CWindLayerListModel(this)); - } -} // namespace swift::gui::views diff --git a/src/gui/views/windlayerview.h b/src/gui/views/windlayerview.h deleted file mode 100644 index 1c9fbadef..000000000 --- a/src/gui/views/windlayerview.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef SWIFT_GUI_WINDLAYERVIEW_H -#define SWIFT_GUI_WINDLAYERVIEW_H - -#include "gui/models/windlayerlistmodel.h" -#include "gui/swiftguiexport.h" -#include "gui/views/viewbase.h" - -class QWidget; - -namespace swift::misc::weather -{ - class CWindLayer; -} -namespace swift::gui::views -{ - //! Wind layer view - class SWIFT_GUI_EXPORT CWindLayerView : public CViewBase - { - Q_OBJECT - - public: - //! Constructor - explicit CWindLayerView(QWidget *parent = nullptr); - }; -} // namespace swift::gui::views -#endif // SWIFT_GUI_WINDLAYERVIEW_H