mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Added icons for simulators
This commit is contained in:
@@ -98,6 +98,14 @@ namespace BlackMisc
|
||||
CIcon(CIcons::OSLinux, "Linux"),
|
||||
CIcon(CIcons::OSMacOs, "Mac OS"),
|
||||
CIcon(CIcons::OSWindows, "Windows"),
|
||||
CIcon(CIcons::SimulatorFS9, "FS9"),
|
||||
CIcon(CIcons::SimulatorFS916, "FS9"),
|
||||
CIcon(CIcons::SimulatorFSX, "FSX"),
|
||||
CIcon(CIcons::SimulatorFSX16, "FSX"),
|
||||
CIcon(CIcons::SimulatorP3D, "P3D"),
|
||||
CIcon(CIcons::SimulatorP3D16, "P3D"),
|
||||
CIcon(CIcons::SimulatorXPlane, "XPlane"),
|
||||
CIcon(CIcons::SimulatorXPlane16, "XPlane"),
|
||||
CIcon(CIcons::StandardIconAppAircraft16, "aircraft"),
|
||||
CIcon(CIcons::StandardIconAppAtc16, "ATC"),
|
||||
CIcon(CIcons::StandardIconAppFlightPlan16, "flight plan"),
|
||||
|
||||
@@ -513,6 +513,54 @@ namespace BlackMisc
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorFSX()
|
||||
{
|
||||
static const QPixmap pm(":/simulators/icons/simulators/FSX.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorFSX16()
|
||||
{
|
||||
static const QPixmap pm(simulatorFSX().scaled(32, 16, Qt::KeepAspectRatio));
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorP3D()
|
||||
{
|
||||
static const QPixmap pm(":/simulators/icons/simulators/Prepar3D.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorP3D16()
|
||||
{
|
||||
static const QPixmap pm(simulatorP3D().scaled(32, 16, Qt::KeepAspectRatio));
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorFS9()
|
||||
{
|
||||
static const QPixmap pm(":/simulators/icons/simulators/FS9.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorFS916()
|
||||
{
|
||||
static const QPixmap pm(simulatorFS9().scaled(32, 16, Qt::KeepAspectRatio));
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorXPlane()
|
||||
{
|
||||
static const QPixmap pm(":/simulators/icons/simulators/FS9.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::simulatorXPlane16()
|
||||
{
|
||||
static const QPixmap pm(simulatorXPlane().scaled(32, 16, Qt::KeepAspectRatio));
|
||||
return pm;
|
||||
}
|
||||
|
||||
const QPixmap &CIcons::swift16()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift3D/sw3DBlue-16.png");
|
||||
@@ -1103,6 +1151,14 @@ namespace BlackMisc
|
||||
case OSLinux: return osLinux();
|
||||
case OSMacOs: return osMac();
|
||||
case OSWindows: return osWindows();
|
||||
case SimulatorFS9: return simulatorFS9();
|
||||
case SimulatorFS916: return simulatorFS916();
|
||||
case SimulatorFSX: return simulatorFSX();
|
||||
case SimulatorFSX16: return simulatorFSX16();
|
||||
case SimulatorP3D: return simulatorP3D();
|
||||
case SimulatorP3D16: return simulatorP3D16();
|
||||
case SimulatorXPlane: return simulatorXPlane();
|
||||
case SimulatorXPlane16: return simulatorXPlane16();
|
||||
case StandardIconAppAircraft16: return appAircraft16();
|
||||
case StandardIconAppAtc16: return appAtc16();
|
||||
case StandardIconAppFlightPlan16: return appFlightPlan16();
|
||||
|
||||
@@ -93,6 +93,14 @@ namespace BlackMisc
|
||||
OSLinux,
|
||||
OSMacOs,
|
||||
OSWindows,
|
||||
SimulatorFS9,
|
||||
SimulatorFS916,
|
||||
SimulatorFSX,
|
||||
SimulatorFSX16,
|
||||
SimulatorP3D,
|
||||
SimulatorP3D16,
|
||||
SimulatorXPlane,
|
||||
SimulatorXPlane16,
|
||||
StandardIconAppAircraft16,
|
||||
StandardIconAppAtc16,
|
||||
StandardIconAppFlightPlan16,
|
||||
@@ -473,6 +481,30 @@ namespace BlackMisc
|
||||
//! Preloader
|
||||
static const QPixmap &preloader16();
|
||||
|
||||
// --------------------------------------------------
|
||||
// -- Simulators
|
||||
// --------------------------------------------------
|
||||
|
||||
//! Simulator FSX @{
|
||||
static const QPixmap &simulatorFSX();
|
||||
static const QPixmap &simulatorFSX16();
|
||||
//! @}
|
||||
|
||||
//! Simulator P3D @{
|
||||
static const QPixmap &simulatorP3D();
|
||||
static const QPixmap &simulatorP3D16();
|
||||
//! @}
|
||||
|
||||
//! Simulator FS9 @{
|
||||
static const QPixmap &simulatorFS9();
|
||||
static const QPixmap &simulatorFS916();
|
||||
//! @}
|
||||
|
||||
//! Simulator XPlane @{
|
||||
static const QPixmap &simulatorXPlane();
|
||||
static const QPixmap &simulatorXPlane16();
|
||||
//! @}
|
||||
|
||||
// --------------------------------------------------
|
||||
// -- swift
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
*/
|
||||
|
||||
#include "blackconfig/buildconfig.h"
|
||||
#include "blackmisc/db/datastoreutility.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/fscommon/fscommonutil.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include "blackmisc/simulation/xplane/xplaneutil.h"
|
||||
#include "blackmisc/db/datastoreutility.h"
|
||||
#include "blackmisc/iconlist.h"
|
||||
#include "blackmisc/comparefunctions.h"
|
||||
|
||||
#include <QJsonValue>
|
||||
@@ -155,6 +156,22 @@ namespace BlackMisc
|
||||
return str.trimmed();
|
||||
}
|
||||
|
||||
CIcon CSimulatorInfo::toIcon() const
|
||||
{
|
||||
if (this->isSingleSimulator())
|
||||
{
|
||||
switch (this->getSimulator())
|
||||
{
|
||||
case FSX: return CIconList::allIcons().findByIndex(CIcons::SimulatorFSX16);
|
||||
case FS9: return CIconList::allIcons().findByIndex(CIcons::SimulatorFS916);
|
||||
case P3D: return CIconList::allIcons().findByIndex(CIcons::SimulatorP3D16);
|
||||
case XPLANE: return CIconList::allIcons().findByIndex(CIcons::SimulatorXPlane16);
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return CValueObject::toIcon();
|
||||
}
|
||||
|
||||
void CSimulatorInfo::add(const CSimulatorInfo &other)
|
||||
{
|
||||
if (other.isUnspecified()) { return; }
|
||||
|
||||
@@ -149,6 +149,9 @@ namespace BlackMisc
|
||||
//! \copydoc Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||
CIcon toIcon() const;
|
||||
|
||||
//! Add simulator
|
||||
void add(const CSimulatorInfo &other);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user