mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #304, centralized icons
* icons which can be rotated * provide metadata * integrated in CValueObjects * added SVG support
This commit is contained in:
@@ -39,7 +39,7 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig)
|
||||
if (this->m_init) return;
|
||||
|
||||
// icon, initial position where intro was before
|
||||
this->setWindowIcon(CIconsStandard::swift24());
|
||||
this->setWindowIcon(CIcons::swift24());
|
||||
this->setWindowTitle(CProject::systemNameAndVersion());
|
||||
QPoint pos = CGuiUtility::introWindowPosition();
|
||||
this->move(pos);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include (../../config.pri)
|
||||
include (../../build.pri)
|
||||
|
||||
QT += core dbus gui network xml multimedia
|
||||
QT += core dbus gui svg network xml multimedia
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = sample_blackgui
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include (../../config.pri)
|
||||
include (../../build.pri)
|
||||
|
||||
QT += core dbus gui network xml multimedia
|
||||
QT += core dbus gui svg network xml multimedia
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = sample_blackgui2
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace BlackGui
|
||||
{
|
||||
case NotSet:
|
||||
case UserDetailed:
|
||||
this->m_columns.addColumn(CColumn(CUser::IndexCallsignIcon, true));
|
||||
this->m_columns.addColumn(CColumn(CUser::IndexCallsignPixmap, true));
|
||||
this->m_columns.addColumn(CColumn("realname", CUser::IndexRealName));
|
||||
this->m_columns.addColumn(CColumn("callsign", CUser::IndexCallsign));
|
||||
this->m_columns.addColumn(CColumn("userid", CUser::IndexId));
|
||||
@@ -52,7 +52,7 @@ namespace BlackGui
|
||||
break;
|
||||
|
||||
case UserShort:
|
||||
this->m_columns.addColumn(CColumn(CUser::IndexCallsignIcon, true));
|
||||
this->m_columns.addColumn(CColumn(CUser::IndexCallsignPixmap, true));
|
||||
this->m_columns.addColumn(CColumn("realname", CUser::IndexRealName));
|
||||
this->m_columns.addColumn(CColumn("callsign", CUser::IndexCallsign));
|
||||
break;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "avaircraft.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/pqconstants.h"
|
||||
#include "blackmisc/icon.h"
|
||||
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
@@ -207,8 +208,8 @@ namespace BlackMisc
|
||||
{
|
||||
case IndexCallsign:
|
||||
return QVariant::fromValue(this->m_callsign);
|
||||
case IndexIcon:
|
||||
return QVariant(this->m_callsign.toIcon());
|
||||
case IndexPixmap:
|
||||
return QVariant(this->m_callsign.toPixmap());
|
||||
case IndexCallsignAsString:
|
||||
return QVariant::fromValue(this->m_callsign.toQString(true));
|
||||
case IndexCallsignAsStringAsSet:
|
||||
@@ -348,6 +349,5 @@ namespace BlackMisc
|
||||
return TupleConverter<CAircraft>::jsonMembers();
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "aviotransponder.h"
|
||||
#include "aviocomsystem.h"
|
||||
#include "valueobject.h"
|
||||
#include "namevariantpairlist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -222,7 +223,7 @@ namespace BlackMisc
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexCallsign = 0,
|
||||
IndexIcon,
|
||||
IndexPixmap,
|
||||
IndexCallsignAsString,
|
||||
IndexCallsignAsStringAsSet,
|
||||
IndexPilotId,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "avaltitude.h"
|
||||
#include "pqstring.h"
|
||||
#include "iconlist.h"
|
||||
|
||||
using BlackMisc::PhysicalQuantities::CLength;
|
||||
using BlackMisc::PhysicalQuantities::CLengthUnit;
|
||||
@@ -204,6 +205,14 @@ namespace BlackMisc
|
||||
*this = CAltitude(l, rd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Icon
|
||||
*/
|
||||
CIcon CAltitude::toIcon() const
|
||||
{
|
||||
return BlackMisc::CIconList::iconForIndex(CIcons::GeoPosition);
|
||||
}
|
||||
|
||||
/*
|
||||
* Members
|
||||
*/
|
||||
|
||||
@@ -114,6 +114,9 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::parseFromString(const QString &value, BlackMisc::PhysicalQuantities::CPqString::SeparatorMode mode)
|
||||
void parseFromString(const QString &value, BlackMisc::PhysicalQuantities::CPqString::SeparatorMode mode) override;
|
||||
|
||||
//! \copydoc CValueObject::toIcon
|
||||
BlackMisc::CIcon toIcon() const override;
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define BLACKMISC_CALLSIGN_H
|
||||
|
||||
#include "valueobject.h"
|
||||
#include "icon.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -40,10 +41,7 @@ namespace BlackMisc
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual const QPixmap &toIcon() const override
|
||||
{
|
||||
return CCallsign::convertToIcon(*this);
|
||||
}
|
||||
virtual BlackMisc::CIcon toIcon() const override { return CCallsign::convertToIcon(*this); }
|
||||
|
||||
//! Is empty?
|
||||
bool isEmpty() const { return this->m_callsignAsSet.isEmpty(); }
|
||||
@@ -117,7 +115,7 @@ namespace BlackMisc
|
||||
static QString unifyCallsign(const QString &callsign);
|
||||
|
||||
//! representing icon
|
||||
static const QPixmap &convertToIcon(const CCallsign &callsign);
|
||||
static const CIcon &convertToIcon(const CCallsign &callsign);
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CCallsign)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "avflightplan.h"
|
||||
#include "iconlist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -98,6 +99,11 @@ namespace BlackMisc
|
||||
BlackMisc::deserializeJson(json, CFlightPlan::jsonMembers(), TupleConverter<CFlightPlan>::toTuple(*this));
|
||||
}
|
||||
|
||||
BlackMisc::CIcon CFlightPlan::toIcon() const
|
||||
{
|
||||
return BlackMisc::CIconList::iconForIndex(CIcons::StandardIconAppFlightPlan16);
|
||||
}
|
||||
|
||||
void CFlightPlan::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CFlightPlan>();
|
||||
|
||||
141
src/blackmisc/icon.cpp
Normal file
141
src/blackmisc/icon.cpp
Normal file
@@ -0,0 +1,141 @@
|
||||
/* 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 "icon.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
int CIcon::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
const auto &other = static_cast<const CIcon &>(otherBase);
|
||||
return compare(TupleConverter<CIcon>::toTuple(*this), TupleConverter<CIcon>::toTuple(other));
|
||||
}
|
||||
|
||||
/*
|
||||
* Marshall to DBus
|
||||
*/
|
||||
void CIcon::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << TupleConverter<CIcon>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmarshall from DBus
|
||||
*/
|
||||
void CIcon::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> TupleConverter<CIcon>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash
|
||||
*/
|
||||
uint CIcon::getValueHash() const
|
||||
{
|
||||
return qHash(TupleConverter<CIcon>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* Pixmap
|
||||
*/
|
||||
QPixmap CIcon::toPixmap() const
|
||||
{
|
||||
return CIcons::pixmapByIndex(getIndex(), this->m_rotateDegrees);
|
||||
}
|
||||
|
||||
/*
|
||||
* Rotate
|
||||
*/
|
||||
void CIcon::setRotation(const PhysicalQuantities::CAngle &rotate)
|
||||
{
|
||||
this->m_rotateDegrees = rotate.valueRounded(PhysicalQuantities::CAngleUnit::deg(), 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CIcon::operator ==(const CIcon &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
return TupleConverter<CIcon>::toTuple(*this) == TupleConverter<CIcon>::toTuple(other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unequal?
|
||||
*/
|
||||
bool CIcon::operator !=(const CIcon &other) const
|
||||
{
|
||||
return !((*this) == other);
|
||||
}
|
||||
|
||||
/*
|
||||
* metaTypeId
|
||||
*/
|
||||
int CIcon::getMetaTypeId() const
|
||||
{
|
||||
return qMetaTypeId<CIcon>();
|
||||
}
|
||||
|
||||
/*
|
||||
* is a
|
||||
*/
|
||||
bool CIcon::isA(int metaTypeId) const
|
||||
{
|
||||
if (metaTypeId == qMetaTypeId<CIcon>()) { return true; }
|
||||
return this->CValueObject::isA(metaTypeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CIcon::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CIcon>();
|
||||
qDBusRegisterMetaType<CIcon>();
|
||||
}
|
||||
|
||||
/*
|
||||
* Members
|
||||
*/
|
||||
const QStringList &CIcon::jsonMembers()
|
||||
{
|
||||
return TupleConverter<CIcon>::jsonMembers();
|
||||
}
|
||||
|
||||
/*
|
||||
* String
|
||||
*/
|
||||
QString CIcon::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s = QString(this->m_descriptiveText).append(" ").append(this->m_index);
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
* To JSON
|
||||
*/
|
||||
QJsonObject CIcon::toJson() const
|
||||
{
|
||||
return BlackMisc::serializeJson(CIcon::jsonMembers(), TupleConverter<CIcon>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* From Json
|
||||
*/
|
||||
void CIcon::fromJson(const QJsonObject &json)
|
||||
{
|
||||
BlackMisc::deserializeJson(json, CIcon::jsonMembers(), TupleConverter<CIcon>::toTuple(*this));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
109
src/blackmisc/icon.h
Normal file
109
src/blackmisc/icon.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/* 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
|
||||
|
||||
#ifndef BLACKMISC_ICON_H
|
||||
#define BLACKMISC_ICON_H
|
||||
|
||||
#include "icons.h"
|
||||
#include "pqangle.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*!
|
||||
* Value object for icons.
|
||||
*/
|
||||
class CIcon : public BlackMisc::CValueObject
|
||||
{
|
||||
|
||||
public:
|
||||
//! Default constructor.
|
||||
CIcon() {}
|
||||
|
||||
//! Constructor.
|
||||
CIcon(CIcons::IconIndexes index, const QString &descriptiveText) :
|
||||
m_index(static_cast<int>(index)), m_descriptiveText(descriptiveText) {}
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! Get descriptive text
|
||||
const QString &getDescriptiveText() const { return this->m_descriptiveText; }
|
||||
|
||||
//! Index
|
||||
CIcons::IconIndexes getIndex() const { return static_cast<CIcons::IconIndexes>(this->m_index);}
|
||||
|
||||
//! Corresponding pixmap
|
||||
QPixmap toPixmap() const;
|
||||
|
||||
//! Icon set?
|
||||
bool isSet() const { return this->m_index != static_cast<int>(CIcons::NotSet);}
|
||||
|
||||
//! Rotate by n degrees
|
||||
void setRotation(int degrees) { this->m_rotateDegrees = degrees; }
|
||||
|
||||
//! Rotate by given degrees
|
||||
void setRotation(const BlackMisc::PhysicalQuantities::CAngle &rotate);
|
||||
|
||||
//! Equal operator ==
|
||||
bool operator ==(const CIcon &other) const;
|
||||
|
||||
//! Unequal operator !=
|
||||
bool operator !=(const CIcon &other) const;
|
||||
|
||||
//! \copydoc CValueObject::getValueHash
|
||||
virtual uint getValueHash() const override;
|
||||
|
||||
//! \copydoc CValueObject::toJson
|
||||
virtual QJsonObject toJson() const override;
|
||||
|
||||
//! \copydoc CValueObject::fromJson
|
||||
void fromJson(const QJsonObject &json) override;
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! \copydoc TupleConverter<>::jsonMembers()
|
||||
static const QStringList &jsonMembers();
|
||||
|
||||
//! Implicit conversion
|
||||
operator QPixmap () const { return this->toPixmap(); }
|
||||
|
||||
protected:
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
virtual QString convertToQString(bool i18n = false) const override;
|
||||
|
||||
//! \copydoc CValueObject::getMetaTypeId
|
||||
virtual int getMetaTypeId() const override;
|
||||
|
||||
//! \copydoc CValueObject::isA
|
||||
virtual bool isA(int metaTypeId) const override;
|
||||
|
||||
//! \copydoc CValueObject::compareImpl
|
||||
virtual int compareImpl(const CValueObject &other) const override;
|
||||
|
||||
//! \copydoc CValueObject::marshallToDbus
|
||||
virtual void marshallToDbus(QDBusArgument &argument) const override;
|
||||
|
||||
//! \copydoc CValueObject::unmarshallFromDbus
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &argument) override;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CIcon)
|
||||
int m_index = static_cast<int>(CIcons::NotSet);
|
||||
int m_rotateDegrees = 0;
|
||||
QString m_descriptiveText;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CIcon, (o.m_index, o.m_descriptiveText))
|
||||
Q_DECLARE_METATYPE(BlackMisc::CIcon)
|
||||
|
||||
#endif // guard
|
||||
32
src/blackmisc/iconlist.cpp
Normal file
32
src/blackmisc/iconlist.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
/* 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 "iconlist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
CIconList::CIconList(const CSequence<CIcon> &other) :
|
||||
CSequence<CIcon>(other)
|
||||
{ }
|
||||
|
||||
CIcon CIconList::findByIndex(CIcons::IconIndexes index) const
|
||||
{
|
||||
return this->findBy(&CIcon::getIndex, index).frontOrDefault();
|
||||
}
|
||||
|
||||
void CIconList::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<BlackMisc::CSequence<CIcon>>();
|
||||
qDBusRegisterMetaType<BlackMisc::CSequence<CIcon>>();
|
||||
qRegisterMetaType<BlackMisc::CCollection<CIcon>>();
|
||||
qDBusRegisterMetaType<BlackMisc::CCollection<CIcon>>();
|
||||
qRegisterMetaType<CIconList>();
|
||||
qDBusRegisterMetaType<CIconList>();
|
||||
}
|
||||
}
|
||||
156
src/blackmisc/iconlist.h
Normal file
156
src/blackmisc/iconlist.h
Normal file
@@ -0,0 +1,156 @@
|
||||
/* 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
|
||||
|
||||
#ifndef BLACKMISC_ICONLIST_H
|
||||
#define BLACKMISC_ICONLIST_H
|
||||
|
||||
#include "valueobject.h"
|
||||
#include "sequence.h"
|
||||
#include "collection.h"
|
||||
#include "icon.h"
|
||||
#include "icons.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
/*!
|
||||
* Icon
|
||||
*/
|
||||
class CIconList : public CSequence<CIcon>
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
CIconList() {}
|
||||
|
||||
//! Construct from a base class object.
|
||||
CIconList(const CSequence<CIcon> &other);
|
||||
|
||||
//! Find by index
|
||||
CIcon findByIndex(CIcons::IconIndexes index) const;
|
||||
|
||||
//! \copydoc CValueObject::asQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! Register metadata of unit and quantity
|
||||
static void registerMetadata();
|
||||
|
||||
//! All icons
|
||||
static const CIconList &allIcons()
|
||||
{
|
||||
static CIconList icons;
|
||||
if (icons.isEmpty())
|
||||
{
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppAircrafts16, "aircrafts"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppAircrafts16, "aircrafts"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppAtc16, "ATC"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppFlightPlan16, "flight plan"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppLog16, "log"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppMappings16, "mappings"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppSettings16, "settings"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppSimulator16, "simulator"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppTextMessages16, "text messages"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppUsers16, "users"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconAppWeather16, "weather"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconClose16, "close"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconDockBottom16, "dock bottom"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconDockTop16, "dock top"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconEmpty, "empty"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconEmpty16, "empty"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconError16, "error"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconFloatAll16, "float all"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconFloatOne16, "floast one"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconHeadingOne16, "heading"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconInfo16, "info"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconJoystick16, "joystick"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconMonitorError16, "monitor error"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconPaperPlane16, "plane"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconPlugin16, "plugin"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconRadar16, "radar"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconResize16, "resize"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconStatusBar16, "status bar"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconSwift24, "swift"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconSwift48, "swift"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconSwiftNova24, "swift"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconSwiftNova48, "swift"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconTableRelationship16, "relationship"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconTableSheet16, "table sheet"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconText16, "text"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconUnknown16, "unknwon"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconUser16, "user"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconUsers16, "users"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconVolumeHigh16, "volume hight"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconVolumeLow16, "volume low"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconVolumeMuted16, "muted"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconWarning16, "warning"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconWeatherCloudy16, "cloudy"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconWrench16, "wrench"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconArrowMediumEast16, "arrow east"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconArrowMediumWest16, "arrow west"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconArrowMediumNorth16, "arrow north"));
|
||||
icons.push_back(CIcon(CIcons::StandardIconArrowMediumSouth16, "arrow south"));
|
||||
icons.push_back(CIcon(CIcons::NetworkCapabilityTextOnly, "text only"));
|
||||
icons.push_back(CIcon(CIcons::NetworkCapabilityUnknown, "unknown"));
|
||||
icons.push_back(CIcon(CIcons::NetworkCapabilityVoice, "voice"));
|
||||
icons.push_back(CIcon(CIcons::NetworkCapabilityVoiceReceiveOnly, "voice receive"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleApproach, "approach"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleC1, "C1"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleC3, "C3"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleCenter, "center"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleDelivery, "delivery"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleGround, "ground"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleI1, "I1 (instructor)"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleI3, "I3 (instructor)"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleMnt, "Mentor"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleObs, "observer"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRolePilot, "pilot"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleS1, "S1"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleS2, "S2"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleS3, "S3"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleSup, "supervisor"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleTower, "tower"));
|
||||
icons.push_back(CIcon(CIcons::NetworkRoleUnknown, "unknown"));
|
||||
|
||||
icons.push_back(CIcon(CIcons::AviationAttitudeIndicator, "attitude indicator"));
|
||||
icons.push_back(CIcon(CIcons::GeoPosition, "geo position"));
|
||||
icons.push_back(CIcon(CIcons::NotSet, "?"));
|
||||
}
|
||||
return icons;
|
||||
}
|
||||
|
||||
//! Icon for given index
|
||||
static const CIcon &iconForIndex(CIcons::IconIndexes index)
|
||||
{
|
||||
// remark, find by is copy, need reference of icon
|
||||
int s = allIcons().size();
|
||||
for (int i = 0; i < s; i++)
|
||||
{
|
||||
if (allIcons()[i].getIndex() == index)
|
||||
{
|
||||
return allIcons()[i];
|
||||
}
|
||||
}
|
||||
Q_ASSERT_X(false, "iconForIndex", "Missing index");
|
||||
return iconForIndex(CIcons::StandardIconUnknown16);
|
||||
}
|
||||
|
||||
//! Icon for given index
|
||||
static const CIcon &iconForIndex(int index) {
|
||||
return iconForIndex(static_cast<CIcons::IconIndexes>(index));
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::CIconList)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CCollection<BlackMisc::CIcon>)
|
||||
Q_DECLARE_METATYPE(BlackMisc::CSequence<BlackMisc::CIcon>)
|
||||
|
||||
#endif // guard
|
||||
704
src/blackmisc/icons.h
Normal file
704
src/blackmisc/icons.h
Normal file
@@ -0,0 +1,704 @@
|
||||
/* 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
|
||||
|
||||
#ifndef BLACKMISC_ICONS_H
|
||||
#define BLACKMISC_ICONS_H
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Standard icons
|
||||
class CIcons
|
||||
{
|
||||
private:
|
||||
//! Constructor, use class static only
|
||||
CIcons();
|
||||
|
||||
public:
|
||||
|
||||
//! Index for each icon, allows to send them via DBus, efficiently store them, etc.
|
||||
enum IconIndexes
|
||||
{
|
||||
NotSet,
|
||||
StandardIconInfo16,
|
||||
StandardIconWarning16,
|
||||
StandardIconGlobe16,
|
||||
StandardIconError16,
|
||||
StandardIconClose16,
|
||||
StandardIconResize16,
|
||||
StandardIconText16,
|
||||
StandardIconHeadingOne16,
|
||||
StandardIconUser16,
|
||||
StandardIconUsers16,
|
||||
StandardIconJoystick16,
|
||||
StandardIconPlugin16,
|
||||
StandardIconDockTop16,
|
||||
StandardIconDockBottom16,
|
||||
StandardIconFloatAll16,
|
||||
StandardIconFloatOne16,
|
||||
StandardIconVolumeHigh16,
|
||||
StandardIconVolumeLow16,
|
||||
StandardIconVolumeMuted16,
|
||||
StandardIconWrench16,
|
||||
StandardIconRadar16,
|
||||
StandardIconTableRelationship16,
|
||||
StandardIconPaperPlane16,
|
||||
StandardIconTableSheet16,
|
||||
StandardIconWeatherCloudy16,
|
||||
StandardIconMonitorError16,
|
||||
StandardIconStatusBar16,
|
||||
StandardIconUnknown16,
|
||||
StandardIconArrowMediumNorth16,
|
||||
StandardIconArrowMediumSouth16,
|
||||
StandardIconArrowMediumEast16,
|
||||
StandardIconArrowMediumWest16,
|
||||
StandardIconEmpty,
|
||||
StandardIconEmpty16,
|
||||
StandardIconSwift24,
|
||||
StandardIconSwift48,
|
||||
StandardIconSwiftNova24,
|
||||
StandardIconSwiftNova48,
|
||||
StandardIconAppWeather16,
|
||||
StandardIconAppSettings16,
|
||||
StandardIconAppUsers16,
|
||||
StandardIconAppFlightPlan16,
|
||||
StandardIconAppSimulator16,
|
||||
StandardIconAppTextMessages16,
|
||||
StandardIconAppAtc16,
|
||||
StandardIconAppAircrafts16,
|
||||
StandardIconAppMappings16,
|
||||
StandardIconAppLog16,
|
||||
NetworkRoleC1,
|
||||
NetworkRoleC3,
|
||||
NetworkRoleI1,
|
||||
NetworkRoleI3,
|
||||
NetworkRoleS1,
|
||||
NetworkRoleS2,
|
||||
NetworkRoleS3,
|
||||
NetworkRoleMnt,
|
||||
NetworkRoleSup,
|
||||
NetworkRoleObs,
|
||||
NetworkRolePilot,
|
||||
NetworkRoleApproach,
|
||||
NetworkRoleGround,
|
||||
NetworkRoleDelivery,
|
||||
NetworkRoleTower,
|
||||
NetworkRoleCenter,
|
||||
NetworkRoleUnknown,
|
||||
NetworkCapabilityVoice,
|
||||
NetworkCapabilityVoiceReceiveOnly,
|
||||
NetworkCapabilityTextOnly,
|
||||
NetworkCapabilityUnknown,
|
||||
AviationAttitudeIndicator,
|
||||
GeoPosition
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Standard icons
|
||||
// -------------------------------------------------------------
|
||||
|
||||
//! Info
|
||||
static const QPixmap &info16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/infomation.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Warning
|
||||
static const QPixmap &warning16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/bullet-error.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Error
|
||||
static const QPixmap &error16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/close-red.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Close
|
||||
static const QPixmap &close16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/cross-button.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Resize
|
||||
static const QPixmap &resize16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/arrow-resize-135.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Text
|
||||
static const QPixmap &text16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-view-text.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Globe
|
||||
static const QPixmap &globe16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/globe.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Heading 1
|
||||
static const QPixmap &headingOne16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/text-heading-1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! User
|
||||
static const QPixmap &user16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/user.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Users
|
||||
static const QPixmap &users16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/users.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Joystick
|
||||
static const QPixmap &joystick16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/joystick.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Plugin
|
||||
static const QPixmap &plugin16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/plugin.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Docking
|
||||
static const QPixmap &dockTop16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/application-dock-090.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Docking
|
||||
static const QPixmap &dockBottom16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/application-dock-270.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Float all
|
||||
static const QPixmap &floatAll16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-cascade.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Float all
|
||||
static const QPixmap &floatOne16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-double.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Sound volume high
|
||||
static const QPixmap &volumeHigh16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/speaker-volume.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Sound volume low
|
||||
static const QPixmap &volumeLow16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/speaker-volume-low.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Sound volume muted
|
||||
static const QPixmap &volumeMuted16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/speaker-volume-control-mute.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Wrench
|
||||
static const QPixmap &wrench16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/wrench.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Radar
|
||||
static const QPixmap &radar16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/radar.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Radar
|
||||
static const QPixmap &tableRelationship16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/table-relationship.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Paper plane
|
||||
static const QPixmap &paperPlane16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/paper-plane.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Table sheet
|
||||
static const QPixmap &tableSheet16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/table-sheet.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Clouds
|
||||
static const QPixmap &weatherCloudy16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/weather-cloudy.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Monitor error
|
||||
static const QPixmap &monitorError16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/monitor-error.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Status bar
|
||||
static const QPixmap &statusBar16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-statusbar.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Unknown
|
||||
static const QPixmap &unknown16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/help.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Empty icon
|
||||
static const QPixmap &empty()
|
||||
{
|
||||
static const QPixmap pm;
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Empty icon
|
||||
static const QPixmap &empty16()
|
||||
{
|
||||
static const QPixmap pm(16, 16);
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Arrow
|
||||
static const QPixmap &arrowMediumNorth16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/arrow-090-medium.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Arrow
|
||||
static const QPixmap &arrowMediumSouth16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/arrow-270-medium.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Arrow
|
||||
static const QPixmap &arrowMediumEast16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/arrow-000-medium.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Arrow
|
||||
static const QPixmap &arrowMediumWest16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/arrow-180-medium.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon
|
||||
static const QPixmap &swift24()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swift24.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon
|
||||
static const QPixmap &swift48()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swift48.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon (nova)
|
||||
static const QPixmap &swiftNova24()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swiftCartoonNova24.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon (nova)
|
||||
static const QPixmap &swiftNova48()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swiftCartoonNova48.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Application weather
|
||||
static const QPixmap &appWeather16()
|
||||
{
|
||||
return weatherCloudy16();
|
||||
}
|
||||
|
||||
//! Application settings
|
||||
static const QPixmap &appSettings16()
|
||||
{
|
||||
return wrench16();
|
||||
}
|
||||
|
||||
//! Application users
|
||||
static const QPixmap &appUsers16()
|
||||
{
|
||||
return users16();
|
||||
}
|
||||
|
||||
//! Application flight plan
|
||||
static const QPixmap &appFlightPlan16()
|
||||
{
|
||||
return tableSheet16();
|
||||
}
|
||||
|
||||
//! Application simulator
|
||||
static const QPixmap &appSimulator16()
|
||||
{
|
||||
return joystick16();
|
||||
}
|
||||
|
||||
//! Application text messages
|
||||
static const QPixmap &appTextMessages16()
|
||||
{
|
||||
return text16();
|
||||
}
|
||||
|
||||
//! Application ATC
|
||||
static const QPixmap &appAtc16()
|
||||
{
|
||||
return radar16();
|
||||
}
|
||||
|
||||
//! Application aircrafts
|
||||
static const QPixmap &appAircrafts16()
|
||||
{
|
||||
return paperPlane16();
|
||||
}
|
||||
|
||||
//! Application mappings
|
||||
static const QPixmap &appMappings16()
|
||||
{
|
||||
return tableRelationship16();
|
||||
}
|
||||
|
||||
//! Application log/status messages
|
||||
static const QPixmap &appLog16()
|
||||
{
|
||||
return monitorError16();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Network and aviation
|
||||
// -------------------------------------------------------------
|
||||
|
||||
//! C1
|
||||
static const QPixmap &roleC1()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/C1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! C2
|
||||
static const QPixmap &roleC2()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/C2.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! C3
|
||||
static const QPixmap &roleC3()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/C2.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! S1
|
||||
static const QPixmap &roleS1()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/S1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! S2
|
||||
static const QPixmap &roleS2()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/S2.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! S3
|
||||
static const QPixmap &roleS3()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/S3.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! I1
|
||||
static const QPixmap &roleI1()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/I1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! I3
|
||||
static const QPixmap &roleI3()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/I3.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! MNT
|
||||
static const QPixmap &roleMnt()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/MNT.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! OBS
|
||||
static const QPixmap &roleObs()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/OBS.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! SUP
|
||||
static const QPixmap &roleSup()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/SUP.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Pilot
|
||||
static const QPixmap &rolePilot()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/pilot.png").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Approach
|
||||
static const QPixmap &roleApproach()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/app.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Ground
|
||||
static const QPixmap &roleGround()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/gnd.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Delivery
|
||||
static const QPixmap &roleDelivery()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/del.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Tower
|
||||
static const QPixmap &roleTower()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/twr.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Center
|
||||
static const QPixmap &roleCenter()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/ctr.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Unknown
|
||||
static const QPixmap &roleUnknown()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/help.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Full voice capability
|
||||
static const QPixmap &capabilityVoice()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/headphone.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Voice receive only
|
||||
static const QPixmap &capabilityVoiceReceiveOnly()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/headphone.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Text only
|
||||
static const QPixmap &capabilityTextOnly()
|
||||
{
|
||||
return CIcons::appTextMessages16();
|
||||
}
|
||||
|
||||
//! Text only
|
||||
static const QPixmap &capabilityUnknown()
|
||||
{
|
||||
return CIcons::unknown16();
|
||||
}
|
||||
|
||||
//! Attitude indicator
|
||||
static const QPixmap &attitudeIndicator16()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/attitude_indicator_climbing_16.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Geo position
|
||||
static const QPixmap &geoPosition16()
|
||||
{
|
||||
return globe16();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// By index
|
||||
// -------------------------------------------------------------
|
||||
|
||||
//! Pixmap by given index
|
||||
static const QPixmap &pixmapByIndex(IconIndexes index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case NotSet: return empty();
|
||||
case StandardIconInfo16: return info16();
|
||||
case StandardIconWarning16: return warning16();
|
||||
case StandardIconError16: return error16();
|
||||
case StandardIconClose16: return close16();
|
||||
case StandardIconResize16: return resize16();
|
||||
case StandardIconText16: return text16();
|
||||
case StandardIconGlobe16: return globe16();
|
||||
case StandardIconHeadingOne16: return headingOne16();
|
||||
case StandardIconUser16: return user16();
|
||||
case StandardIconUsers16: return users16();
|
||||
case StandardIconJoystick16: return joystick16();
|
||||
case StandardIconPlugin16: return plugin16();
|
||||
case StandardIconDockTop16: return dockTop16();
|
||||
case StandardIconDockBottom16: return dockBottom16();
|
||||
case StandardIconFloatAll16: return floatAll16();
|
||||
case StandardIconFloatOne16: return floatOne16();
|
||||
case StandardIconVolumeHigh16: return volumeHigh16();
|
||||
case StandardIconVolumeLow16: return volumeLow16();
|
||||
case StandardIconVolumeMuted16: return volumeMuted16();
|
||||
case StandardIconWrench16: return wrench16();
|
||||
case StandardIconRadar16: return radar16();
|
||||
case StandardIconTableRelationship16: return tableRelationship16();
|
||||
case StandardIconPaperPlane16: return paperPlane16();
|
||||
case StandardIconTableSheet16: return tableSheet16();
|
||||
case StandardIconWeatherCloudy16: return weatherCloudy16();
|
||||
case StandardIconMonitorError16: return monitorError16();
|
||||
case StandardIconStatusBar16: return statusBar16();
|
||||
case StandardIconUnknown16: return unknown16();
|
||||
case StandardIconArrowMediumNorth16: return arrowMediumNorth16();
|
||||
case StandardIconArrowMediumSouth16: return arrowMediumSouth16();
|
||||
case StandardIconArrowMediumWest16: return arrowMediumWest16();
|
||||
case StandardIconArrowMediumEast16: return arrowMediumEast16();
|
||||
case StandardIconEmpty: return empty();
|
||||
case StandardIconEmpty16: return empty16();
|
||||
case StandardIconSwift24: return swift24();
|
||||
case StandardIconSwift48: return swift48();
|
||||
case StandardIconSwiftNova24: return swiftNova24();
|
||||
case StandardIconSwiftNova48: return swiftNova48();
|
||||
case StandardIconAppWeather16: return appWeather16();
|
||||
case StandardIconAppSettings16: return appSettings16();
|
||||
case StandardIconAppUsers16: return appUsers16();
|
||||
case StandardIconAppFlightPlan16: return appFlightPlan16();
|
||||
case StandardIconAppSimulator16: return appSimulator16();
|
||||
case StandardIconAppTextMessages16: return appTextMessages16();
|
||||
case StandardIconAppAtc16: return appAtc16();
|
||||
case StandardIconAppAircrafts16: return appAircrafts16();
|
||||
case StandardIconAppMappings16: return appMappings16();
|
||||
case StandardIconAppLog16: return appLog16();
|
||||
case NetworkRoleC1: return roleC1();
|
||||
case NetworkRoleC3: return roleC3();
|
||||
case NetworkRoleI1: return roleI1();
|
||||
case NetworkRoleI3: return roleI3();
|
||||
case NetworkRoleS1: return roleS1();
|
||||
case NetworkRoleS2: return roleS2();
|
||||
case NetworkRoleS3: return roleS3();
|
||||
case NetworkRoleMnt: return roleMnt();
|
||||
case NetworkRoleSup: return roleSup();
|
||||
case NetworkRoleObs: return roleObs();
|
||||
case NetworkRolePilot: return rolePilot();
|
||||
case NetworkRoleApproach: return roleApproach();
|
||||
case NetworkRoleGround: return roleGround();
|
||||
case NetworkRoleDelivery: return roleDelivery();
|
||||
case NetworkRoleTower: return roleTower();
|
||||
case NetworkRoleCenter: return roleCenter();
|
||||
case NetworkRoleUnknown: return roleUnknown();
|
||||
case NetworkCapabilityVoice: return capabilityVoice();
|
||||
case NetworkCapabilityVoiceReceiveOnly: return capabilityVoiceReceiveOnly();
|
||||
case NetworkCapabilityTextOnly: return capabilityTextOnly();
|
||||
case NetworkCapabilityUnknown: return capabilityUnknown();
|
||||
case AviationAttitudeIndicator: return attitudeIndicator16();
|
||||
case GeoPosition: return geoPosition16();
|
||||
default: return empty();
|
||||
}
|
||||
}
|
||||
|
||||
//! Pixmap by given index rotated
|
||||
static QPixmap pixmapByIndex(IconIndexes index, int rotateDegrees)
|
||||
{
|
||||
const QPixmap original = pixmapByIndex(index);
|
||||
if (rotateDegrees == 0) return original;
|
||||
QMatrix rm;
|
||||
rm.rotate(rotateDegrees);
|
||||
QPixmap rotated = original.transformed(rm);
|
||||
int xoffset = (rotated.width() - original.width()) / 2;
|
||||
int yoffset = (rotated.height() - original.height()) / 2;
|
||||
rotated = rotated.copy(xoffset, yoffset, original.width(), original.height());
|
||||
return rotated;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif // guard
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 146 KiB |
@@ -1,203 +0,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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKMISC_ICONSNETWORK_H
|
||||
#define BLACKMISC_ICONSNETWORK_H
|
||||
|
||||
#include <QPixmap>
|
||||
#include "iconsstandard.h"
|
||||
|
||||
//! \file
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Standard icons
|
||||
class CIconsNetworkAndAviation
|
||||
{
|
||||
private:
|
||||
//! Constructor, use class static only
|
||||
CIconsNetworkAndAviation();
|
||||
|
||||
public:
|
||||
|
||||
//! C1
|
||||
static const QPixmap &roleC1()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/C1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! C2
|
||||
static const QPixmap &roleC2()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/C2.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! C3
|
||||
static const QPixmap &roleC3()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/C2.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! S1
|
||||
static const QPixmap &roleS1()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/S1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! S2
|
||||
static const QPixmap &roleS2()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/S2.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! S3
|
||||
static const QPixmap &roleS3()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/S3.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! I1
|
||||
static const QPixmap &roleI1()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/I1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! I3
|
||||
static const QPixmap &roleI3()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/I3.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! MNT
|
||||
static const QPixmap &roleMnt()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/MNT.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! OBS
|
||||
static const QPixmap &roleObs()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/OBS.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! SUP
|
||||
static const QPixmap &roleSup()
|
||||
{
|
||||
static const QPixmap pm(":/vatsim/icons/vatsim/SUP.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Pilot
|
||||
static const QPixmap &rolePilot()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/pilot.png").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Approach
|
||||
static const QPixmap &roleApproach()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/app.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Ground
|
||||
static const QPixmap &roleGround()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/gnd.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Delivery
|
||||
static const QPixmap &roleDelivery()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/del.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Tower
|
||||
static const QPixmap &roleTower()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/twr.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Center
|
||||
static const QPixmap &roleCenter()
|
||||
{
|
||||
static const QPixmap pm(QPixmap(":/own/icons/own/ctr.jpg").scaledToWidth(16, Qt::SmoothTransformation));
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Unknown
|
||||
static const QPixmap &roleUnknown()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/help.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Connected
|
||||
static const QPixmap &statusConnected()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/logingreen.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Disconnected
|
||||
static const QPixmap &statusDisconnected()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/loginred.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Transition
|
||||
static const QPixmap &statusTransition()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/loginyellow.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Full voice capability
|
||||
static const QPixmap &capabilityVoice()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/headphone.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Voice receive only
|
||||
static const QPixmap &capabilityVoiceReceiveOnly()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/headphone.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Text only
|
||||
static const QPixmap &capabilityTextOnly()
|
||||
{
|
||||
return CIconsStandard::appTextMessages16();
|
||||
}
|
||||
|
||||
//! Text only
|
||||
static const QPixmap &capabilityUnknown()
|
||||
{
|
||||
return CIconsStandard::unknown16();
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif // guard
|
||||
@@ -1,321 +0,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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKMISC_ICONSSTANDARD_H
|
||||
#define BLACKMISC_ICONSSTANDARD_H
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
//! \file
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Standard icons
|
||||
class CIconsStandard
|
||||
{
|
||||
private:
|
||||
//! Constructor, use class static only
|
||||
CIconsStandard();
|
||||
|
||||
public:
|
||||
|
||||
//! Info
|
||||
static const QPixmap &info16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/infomation.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Warning
|
||||
static const QPixmap &warning16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/bullet-error.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Error
|
||||
static const QPixmap &error16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/close-red.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Close
|
||||
static const QPixmap &close16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/cross-button.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Resize
|
||||
static const QPixmap &resize16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/arrow-resize-135.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Text
|
||||
static const QPixmap &text16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-view-text.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Heading 1
|
||||
static const QPixmap &headingOne16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/text-heading-1.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! User
|
||||
static const QPixmap &user16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/user.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Users
|
||||
static const QPixmap &users16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/users.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Joystick
|
||||
static const QPixmap &joystick16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/joystick.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Plugin
|
||||
static const QPixmap &plugin16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/plugin.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Docking
|
||||
static const QPixmap &dockTop16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/application-dock-090.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Docking
|
||||
static const QPixmap &dockBottom16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/application-dock-270.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Float all
|
||||
static const QPixmap &floatAll16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-cascade.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Float all
|
||||
static const QPixmap &floatOne16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-double.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Sound volume high
|
||||
static const QPixmap &volumneHigh16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/speaker-volume.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Sound volume low
|
||||
static const QPixmap &volumneLow16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/speaker-volume-low.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Sound volume muted
|
||||
static const QPixmap &volumneMuted16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/speaker-volume-control-mute.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Wrench
|
||||
static const QPixmap &wrench16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/wrench.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Radar
|
||||
static const QPixmap &radar16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/radar.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Radar
|
||||
static const QPixmap &tableRelationship16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/table-relationship.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Paper plane
|
||||
static const QPixmap &paperPlane16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/paper-plane.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Table sheet
|
||||
static const QPixmap &tableSheet16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/table-sheet.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Clouds
|
||||
static const QPixmap &weatherCloudy16()
|
||||
{
|
||||
static const QPixmap pm(":/diagona/icons/diagona/icons/weather-cloudy.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Monitor error
|
||||
static const QPixmap &monitorError16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/monitor-error.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Status bar
|
||||
static const QPixmap &statusBar16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/application-statusbar.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Unknown
|
||||
static const QPixmap &unknown16()
|
||||
{
|
||||
static const QPixmap pm(":/pastel/icons/pastel/16/help.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Empty icon
|
||||
static const QPixmap &empty()
|
||||
{
|
||||
static const QPixmap pm;
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Empty icon
|
||||
static const QPixmap &empty16()
|
||||
{
|
||||
static const QPixmap pm(16, 16);
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon
|
||||
static const QPixmap &swift24()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swift24.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon
|
||||
static const QPixmap &swift48()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swift48.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon (nova)
|
||||
static const QPixmap &swiftNova24()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swiftCartoonNova24.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! swift icon (nova)
|
||||
static const QPixmap &swiftNova48()
|
||||
{
|
||||
static const QPixmap pm(":/own/icons/own/swift/swiftCartoonNova48.png");
|
||||
return pm;
|
||||
}
|
||||
|
||||
//! Application weather
|
||||
static const QPixmap &appWeather16()
|
||||
{
|
||||
return weatherCloudy16();
|
||||
}
|
||||
|
||||
//! Application settings
|
||||
static const QPixmap &appSettings16()
|
||||
{
|
||||
return wrench16();
|
||||
}
|
||||
|
||||
//! Application users
|
||||
static const QPixmap &appUsers16()
|
||||
{
|
||||
return users16();
|
||||
}
|
||||
|
||||
//! Application flight plan
|
||||
static const QPixmap &appFlightplan16()
|
||||
{
|
||||
return tableSheet16();
|
||||
}
|
||||
|
||||
//! Application simulator
|
||||
static const QPixmap &appSimulator16()
|
||||
{
|
||||
return joystick16();
|
||||
}
|
||||
|
||||
//! Application text messages
|
||||
static const QPixmap &appTextMessages16()
|
||||
{
|
||||
return text16();
|
||||
}
|
||||
|
||||
//! Application ATC
|
||||
static const QPixmap &appAtc16()
|
||||
{
|
||||
return radar16();
|
||||
}
|
||||
|
||||
//! Application aircrafts
|
||||
static const QPixmap &appAircrafts16()
|
||||
{
|
||||
return paperPlane16();
|
||||
}
|
||||
|
||||
//! Application mappings
|
||||
static const QPixmap &appMappings16()
|
||||
{
|
||||
return tableRelationship16();
|
||||
}
|
||||
|
||||
//! Application log/status messages
|
||||
static const QPixmap &appLog16()
|
||||
{
|
||||
return monitorError16();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
#endif // guard
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "nwclient.h"
|
||||
#include "icon.h"
|
||||
#include <QString>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -194,8 +195,8 @@ namespace BlackMisc
|
||||
case IndexVoiceCapabilitiesString:
|
||||
return QVariant(this->m_voiceCapabilities.toQString(false));
|
||||
break;
|
||||
case IndexVoiceCapabilitiesIcon:
|
||||
return QVariant(this->m_voiceCapabilities.toIcon());
|
||||
case IndexVoiceCapabilitiesPixmap:
|
||||
return QVariant(this->m_voiceCapabilities.toPixmap());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace BlackMisc
|
||||
IndexServer,
|
||||
IndexVoiceCapabilities,
|
||||
IndexVoiceCapabilitiesString,
|
||||
IndexVoiceCapabilitiesIcon
|
||||
IndexVoiceCapabilitiesPixmap
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -125,7 +125,7 @@ namespace BlackMisc
|
||||
void setAircraftModel(const CAircraftModel &model) { this->m_model = model; }
|
||||
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual const QPixmap &toIcon() const override { return this->m_user.toIcon(); }
|
||||
virtual CIcon toIcon() const override { return this->m_user.toIcon(); }
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "nwuser.h"
|
||||
#include "blackmisc/icon.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include <tuple>
|
||||
|
||||
@@ -178,8 +179,8 @@ namespace BlackMisc
|
||||
return QVariant(this->m_realname);
|
||||
case IndexCallsign:
|
||||
return this->m_callsign.toQVariant();
|
||||
case IndexCallsignIcon:
|
||||
return this->m_callsign.toIcon();
|
||||
case IndexCallsignPixmap:
|
||||
return QVariant(this->m_callsign.toPixmap());
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace BlackMisc
|
||||
IndexPassword,
|
||||
IndexRealName,
|
||||
IndexCallsign,
|
||||
IndexCallsignIcon
|
||||
IndexCallsignPixmap
|
||||
};
|
||||
|
||||
//! Default constructor.
|
||||
@@ -118,7 +118,7 @@ namespace BlackMisc
|
||||
void setCallsign(const BlackMisc::Aviation::CCallsign &callsign) { m_callsign = callsign; }
|
||||
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual const QPixmap &toIcon() const override { return this->getCallsign().toIcon(); }
|
||||
virtual BlackMisc::CIcon toIcon() const override { return this->getCallsign().toIcon(); }
|
||||
|
||||
//! \brief Equal operator ==
|
||||
bool operator ==(const CUser &other) const;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "blackmisc/nwvoicecapabilities.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/iconsnetwork.h"
|
||||
#include "blackmisc/iconlist.h"
|
||||
#include <tuple>
|
||||
|
||||
using namespace BlackMisc;
|
||||
@@ -119,25 +119,28 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
* Icon
|
||||
*/
|
||||
const QPixmap &CVoiceCapabilities::toIcon() const
|
||||
CIcon CVoiceCapabilities::toIcon() const
|
||||
{
|
||||
switch (this->m_voiceCapabilities)
|
||||
{
|
||||
case Voice:
|
||||
return CIconsNetworkAndAviation::capabilityVoice();
|
||||
return CIconList::iconForIndex(CIcons::NetworkCapabilityVoice);
|
||||
case TextOnly:
|
||||
return CIconsNetworkAndAviation::capabilityTextOnly();
|
||||
return CIconList::iconForIndex(CIcons::NetworkCapabilityTextOnly);
|
||||
case Unknown:
|
||||
return CIconsNetworkAndAviation::capabilityUnknown();
|
||||
return CIconList::iconForIndex(CIcons::NetworkCapabilityUnknown);
|
||||
case VoiceReceivingOnly:
|
||||
return CIconsNetworkAndAviation::capabilityVoiceReceiveOnly();
|
||||
return CIconList::iconForIndex(CIcons::NetworkCapabilityVoiceReceiveOnly);
|
||||
}
|
||||
Q_ASSERT("Wrong index");
|
||||
return CIconsNetworkAndAviation::capabilityVoiceReceiveOnly(); // never reached
|
||||
return CIconList::iconForIndex(CIcons::NetworkCapabilityUnknown); // never reached
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CVoiceCapabilities::operator ==(const CVoiceCapabilities &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BlackMisc
|
||||
void setCapabilities(VoiceCapabilities capabilites) { m_voiceCapabilities = static_cast<uint>(capabilites); }
|
||||
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual const QPixmap &toIcon() const override;
|
||||
virtual CIcon toIcon() const override;
|
||||
|
||||
//! Equal operator ==
|
||||
bool operator ==(const CVoiceCapabilities &other) const;
|
||||
|
||||
34
src/blackmisc/pqangle.cpp
Normal file
34
src/blackmisc/pqangle.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
/* 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 "iconlist.h"
|
||||
#include "pqangle.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
BlackMisc::CIcon CAngle::toIcon() const
|
||||
{
|
||||
BlackMisc::CIcon i = CIconList::iconForIndex(CIcons::StandardIconArrowMediumNorth16);
|
||||
i.setRotation(*this);
|
||||
return i;
|
||||
}
|
||||
|
||||
double CAngle::piFactor() const
|
||||
{
|
||||
return BlackMisc::Math::CMath::round(this->value(CAngleUnit::rad()) / BlackMisc::Math::CMath::PI() , 6);
|
||||
}
|
||||
|
||||
const double &CAngle::PI()
|
||||
{
|
||||
return BlackMisc::Math::CMath::PI();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,8 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual BlackMisc::CIcon toIcon() const override;
|
||||
|
||||
//! Virtual destructor
|
||||
virtual ~CAngle() {}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "statusmessage.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
#include "iconsstandard.h"
|
||||
#include "iconlist.h"
|
||||
#include <QMetaEnum>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -109,14 +109,14 @@ namespace BlackMisc
|
||||
/*
|
||||
* Pixmap
|
||||
*/
|
||||
const QPixmap &CStatusMessage::convertToIcon(const CStatusMessage &statusMessage)
|
||||
const CIcon &CStatusMessage::convertToIcon(const CStatusMessage &statusMessage)
|
||||
{
|
||||
switch (statusMessage.getSeverity())
|
||||
{
|
||||
case SeverityInfo: return CIconsStandard::info16();
|
||||
case SeverityWarning: return CIconsStandard::warning16();
|
||||
case SeverityError: return CIconsStandard::error16();
|
||||
default: return CIconsStandard::info16();
|
||||
case SeverityInfo: return CIconList::iconForIndex(CIcons::StandardIconInfo16);
|
||||
case SeverityWarning: return CIconList::iconForIndex(CIcons::StandardIconWarning16);
|
||||
case SeverityError: return CIconList::iconForIndex(CIcons::StandardIconError16);
|
||||
default: return CIconList::iconForIndex(CIcons::StandardIconInfo16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#include "icon.h"
|
||||
#include "valueobject.h"
|
||||
#include <QDateTime>
|
||||
|
||||
@@ -100,7 +101,7 @@ namespace BlackMisc
|
||||
void setSeverity(StatusSeverity severity) { this->m_severity = severity; }
|
||||
|
||||
//! Representing icon
|
||||
virtual const QPixmap &toIcon() const override { return CStatusMessage::convertToIcon(*this); }
|
||||
virtual CIcon toIcon() const override { return CStatusMessage::convertToIcon(*this); }
|
||||
|
||||
//! Type as string
|
||||
const QString &getSeverityAsString() const;
|
||||
@@ -139,7 +140,7 @@ namespace BlackMisc
|
||||
static CStatusMessage getErrorMessage(const QString &message, StatusType type = CStatusMessage::TypeUnspecific);
|
||||
|
||||
//! Representing icon
|
||||
static const QPixmap &convertToIcon(const CStatusMessage &statusMessage);
|
||||
static const CIcon &convertToIcon(const CStatusMessage &statusMessage);
|
||||
|
||||
protected:
|
||||
//! \copydoc CValueObject::marshallToDbus
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "valueobject.h"
|
||||
#include "indexvariantmap.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
#include "iconlist.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -129,6 +130,22 @@ namespace BlackMisc
|
||||
return c;
|
||||
}
|
||||
|
||||
/*
|
||||
* Icon
|
||||
*/
|
||||
CIcon CValueObject::toIcon() const
|
||||
{
|
||||
return CIconList::iconForIndex(CIcons::StandardIconUnknown16);
|
||||
}
|
||||
|
||||
/*
|
||||
* Pixmap
|
||||
*/
|
||||
QPixmap CValueObject::toPixmap() const
|
||||
{
|
||||
return this->toIcon().toPixmap();
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare with value map
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace BlackMisc
|
||||
{
|
||||
// forward declaration
|
||||
class CIndexVariantMap;
|
||||
class CIcon;
|
||||
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
@@ -187,7 +188,10 @@ namespace BlackMisc
|
||||
virtual void fromJson(const QJsonObject &json) { Q_UNUSED(json); }
|
||||
|
||||
//! As icon, not implement by all classes
|
||||
virtual const QPixmap &toIcon() const { static const QPixmap p; return p; }
|
||||
virtual CIcon toIcon() const;
|
||||
|
||||
//! As pixmap, required for most GUI views
|
||||
virtual QPixmap toPixmap() const;
|
||||
|
||||
/*!
|
||||
* \brief Set property by index
|
||||
|
||||
Reference in New Issue
Block a user