mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 18:55:38 +08:00
Ref T264, application info list model
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include "blackmisc/weather/temperaturelayerlist.h"
|
#include "blackmisc/weather/temperaturelayerlist.h"
|
||||||
#include "blackmisc/weather/windlayerlist.h"
|
#include "blackmisc/weather/windlayerlist.h"
|
||||||
#include "blackmisc/input/actionhotkeylist.h"
|
#include "blackmisc/input/actionhotkeylist.h"
|
||||||
|
#include "blackmisc/applicationinfolist.h"
|
||||||
#include "blackmisc/countrylist.h"
|
#include "blackmisc/countrylist.h"
|
||||||
#include "blackmisc/namevariantpairlist.h"
|
#include "blackmisc/namevariantpairlist.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "blackgui/models/airlineicaolistmodel.h"
|
#include "blackgui/models/airlineicaolistmodel.h"
|
||||||
#include "blackgui/models/airportlistmodel.h"
|
#include "blackgui/models/airportlistmodel.h"
|
||||||
#include "blackgui/models/airportlistmodel.h"
|
#include "blackgui/models/airportlistmodel.h"
|
||||||
|
#include "blackgui/models/applicationinfolistmodel.h"
|
||||||
#include "blackgui/models/atcstationlistmodel.h"
|
#include "blackgui/models/atcstationlistmodel.h"
|
||||||
#include "blackgui/models/clientlistmodel.h"
|
#include "blackgui/models/clientlistmodel.h"
|
||||||
#include "blackgui/models/cloudlayerlistmodel.h"
|
#include "blackgui/models/cloudlayerlistmodel.h"
|
||||||
|
|||||||
46
src/blackgui/models/applicationinfolistmodel.cpp
Normal file
46
src/blackgui/models/applicationinfolistmodel.cpp
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/* Copyright (C) 2018
|
||||||
|
* 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 "blackgui/models/applicationinfolistmodel.h"
|
||||||
|
#include "blackgui/models/columnformatters.h"
|
||||||
|
#include "blackgui/models/columns.h"
|
||||||
|
|
||||||
|
#include <QModelIndex>
|
||||||
|
#include <QStandardItem>
|
||||||
|
#include <QStandardItemModel>
|
||||||
|
#include <QString>
|
||||||
|
#include <Qt>
|
||||||
|
#include <QtDebug>
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
|
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
namespace Models
|
||||||
|
{
|
||||||
|
CApplicationInfoListModel::CApplicationInfoListModel(QObject *parent) :
|
||||||
|
CListModelBase("ModelApplicationInfoListModel", parent)
|
||||||
|
{
|
||||||
|
m_columns.addColumn(CColumn::standardString("version", CApplicationInfo::IndexVersionString));
|
||||||
|
m_columns.addColumn(CColumn::standardString("OS", CApplicationInfo::IndexPlatformInfo));
|
||||||
|
m_columns.addColumn(CColumn::standardString("exe.path", CApplicationInfo::IndexExecutablePath));
|
||||||
|
m_columns.addColumn(CColumn::standardString("data.path", CApplicationInfo::IndexApplicationDataPath));
|
||||||
|
|
||||||
|
// default sort order
|
||||||
|
this->setSortColumnByPropertyIndex(CApplicationInfo::IndexVersionString);
|
||||||
|
m_sortOrder = Qt::DescendingOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CApplicationInfoListModel::otherSwiftVersionsFromDataDirectories()
|
||||||
|
{
|
||||||
|
this->update(CApplicationInfoList::fromOtherSwiftVersionsFromDataDirectories());
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
} // namespace
|
||||||
41
src/blackgui/models/applicationinfolistmodel.h
Normal file
41
src/blackgui/models/applicationinfolistmodel.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright (C) 2018
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#ifndef BLACKGUI_MODELS_APPLICATIONINFOLISTMODEL_H
|
||||||
|
#define BLACKGUI_MODELS_APPLICATIONINFOLISTMODEL_H
|
||||||
|
|
||||||
|
#include "blackgui/blackguiexport.h"
|
||||||
|
#include "blackgui/models/listmodelbase.h"
|
||||||
|
#include "blackmisc/applicationinfolist.h"
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class QStandardItemModel;
|
||||||
|
|
||||||
|
namespace BlackGui
|
||||||
|
{
|
||||||
|
namespace Models
|
||||||
|
{
|
||||||
|
//! Application info list model
|
||||||
|
class BLACKGUI_EXPORT CApplicationInfoListModel : public CListModelBase<BlackMisc::CApplicationInfo, BlackMisc::CApplicationInfoList, true>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! Constructor
|
||||||
|
explicit CApplicationInfoListModel(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
//! Destructor
|
||||||
|
virtual ~CApplicationInfoListModel() {}
|
||||||
|
|
||||||
|
//! \copydoc BlackMisc::CApplicationInfoList::fromOtherSwiftVersionsFromDataDirectories
|
||||||
|
void otherSwiftVersionsFromDataDirectories();
|
||||||
|
};
|
||||||
|
} // ns
|
||||||
|
} // ns
|
||||||
|
#endif // guard
|
||||||
@@ -767,11 +767,12 @@ namespace BlackGui
|
|||||||
|
|
||||||
// see here for the reason of thess forward instantiations
|
// see here for the reason of thess forward instantiations
|
||||||
// https://isocpp.org/wiki/faq/templates#separate-template-fn-defn-from-decl
|
// https://isocpp.org/wiki/faq/templates#separate-template-fn-defn-from-decl
|
||||||
template class CListModelBase<BlackMisc::Aviation::CLivery, BlackMisc::Aviation::CLiveryList, true>;
|
|
||||||
template class CListModelBase<BlackMisc::CIdentifier, BlackMisc::CIdentifierList, false>;
|
template class CListModelBase<BlackMisc::CIdentifier, BlackMisc::CIdentifierList, false>;
|
||||||
|
template class CListModelBase<BlackMisc::CApplicationInfo, BlackMisc::CApplicationInfoList, true>;
|
||||||
template class CListModelBase<BlackMisc::CStatusMessage, BlackMisc::CStatusMessageList, true>;
|
template class CListModelBase<BlackMisc::CStatusMessage, BlackMisc::CStatusMessageList, true>;
|
||||||
template class CListModelBase<BlackMisc::CNameVariantPair, BlackMisc::CNameVariantPairList, false>;
|
template class CListModelBase<BlackMisc::CNameVariantPair, BlackMisc::CNameVariantPairList, false>;
|
||||||
template class CListModelBase<BlackMisc::CCountry, BlackMisc::CCountryList, true>;
|
template class CListModelBase<BlackMisc::CCountry, BlackMisc::CCountryList, true>;
|
||||||
|
template class CListModelBase<BlackMisc::Aviation::CLivery, BlackMisc::Aviation::CLiveryList, true>;
|
||||||
template class CListModelBase<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList, true>;
|
template class CListModelBase<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList, true>;
|
||||||
template class CListModelBase<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList, true>;
|
template class CListModelBase<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList, true>;
|
||||||
template class CListModelBase<BlackMisc::Aviation::CAircraftIcaoCode, BlackMisc::Aviation::CAircraftIcaoCodeList, true>;
|
template class CListModelBase<BlackMisc::Aviation::CAircraftIcaoCode, BlackMisc::Aviation::CAircraftIcaoCodeList, true>;
|
||||||
|
|||||||
Reference in New Issue
Block a user