mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Added icons for simulators
This commit is contained in:
@@ -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