mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
refs #304, Icons, using new CIcon class
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
#include "blackcore/context_settings.h"
|
#include "blackcore/context_settings.h"
|
||||||
#include "blackcore/context_application.h"
|
#include "blackcore/context_application.h"
|
||||||
#include "blackcore/context_application_impl.h"
|
#include "blackcore/context_application_impl.h"
|
||||||
#include "blackmisc/iconsstandard.h"
|
#include "blackmisc/icons.h"
|
||||||
#include "blackmisc/networkutils.h"
|
#include "blackmisc/networkutils.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/project.h"
|
#include "blackmisc/project.h"
|
||||||
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// metadata are registered in runtime
|
// metadata are registered in runtime
|
||||||
QApplication a(argc, argv); // not QCoreApplication because of icon, http://qt-project.org/forums/viewthread/15412
|
QApplication a(argc, argv); // not QCoreApplication because of icon, http://qt-project.org/forums/viewthread/15412
|
||||||
QIcon icon(BlackMisc::CIconsStandard::swiftNova24());
|
QIcon icon(BlackMisc::CIcons::swiftNova24());
|
||||||
QApplication::setWindowIcon(icon);
|
QApplication::setWindowIcon(icon);
|
||||||
QTextStream cin(stdin);
|
QTextStream cin(stdin);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "blackcore/context_runtime_config.h"
|
#include "blackcore/context_runtime_config.h"
|
||||||
#include "blacksim/blacksimfreefunctions.h"
|
#include "blacksim/blacksimfreefunctions.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include "blackmisc/iconsstandard.h"
|
#include "blackmisc/icons.h"
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// application
|
// application
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
QIcon icon(BlackMisc::CIconsStandard::swift24());
|
QIcon icon(BlackMisc::CIcons::swift24());
|
||||||
QApplication::setWindowIcon(icon);
|
QApplication::setWindowIcon(icon);
|
||||||
const QString s = CStyleSheetUtility::instance().styles(
|
const QString s = CStyleSheetUtility::instance().styles(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig)
|
|||||||
QHBoxLayout *menuBarLayout = new QHBoxLayout();
|
QHBoxLayout *menuBarLayout = new QHBoxLayout();
|
||||||
QPushButton *closeIcon = new QPushButton(this);
|
QPushButton *closeIcon = new QPushButton(this);
|
||||||
closeIcon->setStyleSheet("margin: 0; padding: 0; background: transparent;");
|
closeIcon->setStyleSheet("margin: 0; padding: 0; background: transparent;");
|
||||||
closeIcon->setIcon(CIconsStandard::close16());
|
closeIcon->setIcon(CIcons::close16());
|
||||||
QObject::connect(closeIcon, &QPushButton::clicked, this, &QMainWindow::close);
|
QObject::connect(closeIcon, &QPushButton::clicked, this, &QMainWindow::close);
|
||||||
menuBarLayout->addWidget(this->ui->mb_MainMenuBar, 0, Qt::AlignTop | Qt::AlignLeft);
|
menuBarLayout->addWidget(this->ui->mb_MainMenuBar, 0, Qt::AlignTop | Qt::AlignLeft);
|
||||||
menuBarLayout->addWidget(closeIcon, 0, Qt::AlignTop | Qt::AlignRight);
|
menuBarLayout->addWidget(closeIcon, 0, Qt::AlignTop | Qt::AlignRight);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "blackmisc/iconsstandard.h"
|
#include "blackmisc/icons.h"
|
||||||
#include "blackgui/models/atcstationlistmodel.h"
|
#include "blackgui/models/atcstationlistmodel.h"
|
||||||
#include "blackcore/dbus_server.h"
|
#include "blackcore/dbus_server.h"
|
||||||
#include "blackcore/context_network.h"
|
#include "blackcore/context_network.h"
|
||||||
@@ -76,8 +76,8 @@ void MainWindow::ps_setAudioVolumes()
|
|||||||
com1.setEnabled(!muted);
|
com1.setEnabled(!muted);
|
||||||
com2.setEnabled(!muted);
|
com2.setEnabled(!muted);
|
||||||
this->ui->pb_SoundMute->setText(muted ? "Unmute" : "Mute");
|
this->ui->pb_SoundMute->setText(muted ? "Unmute" : "Mute");
|
||||||
this->ui->lbl_StatusVoiceStatus->setPixmap(muted ? CIconsStandard::volumneMuted16() : CIconsStandard::volumneHigh16());
|
this->ui->comp_InfoBarStatus->setVolume(muted ? 0 : 66); // TODO
|
||||||
this->ui->comp_Cockpit->setCockpitVoiceStatusPixmap(muted ? CIconsStandard::volumneMuted16() : CIconsStandard::volumneHigh16());
|
this->ui->comp_Cockpit->setCockpitVoiceStatusPixmap(muted ? CIcons::volumeMuted16() : CIcons::volumeHigh16());
|
||||||
this->ui->pb_SoundMute->setStyleSheet(muted ? "background-color: red;" : "");
|
this->ui->pb_SoundMute->setStyleSheet(muted ? "background-color: red;" : "");
|
||||||
if (muted) this->m_compInfoWindow->displayStringMessage("Sound is muted!");
|
if (muted) this->m_compInfoWindow->displayStringMessage("Sound is muted!");
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "infowindowcomponent.h"
|
#include "infowindowcomponent.h"
|
||||||
#include "ui_infowindowcomponent.h"
|
#include "ui_infowindowcomponent.h"
|
||||||
|
#include "blackmisc/icon.h"
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ namespace BlackGui
|
|||||||
this->ui->le_SmSeverity->setText(statusMessage.getSeverityAsString());
|
this->ui->le_SmSeverity->setText(statusMessage.getSeverityAsString());
|
||||||
this->ui->le_SmType->setText(statusMessage.getTypeAsString());
|
this->ui->le_SmType->setText(statusMessage.getTypeAsString());
|
||||||
this->ui->te_SmStatusMessage->setText(statusMessage.getMessage());
|
this->ui->te_SmStatusMessage->setText(statusMessage.getMessage());
|
||||||
this->ui->lbl_SmSeverityIcon->setPixmap(statusMessage.toIcon());
|
this->ui->lbl_SmSeverityIcon->setPixmap(statusMessage.toPixmap());
|
||||||
|
|
||||||
this->setCurrentPage(this->ui->pg_StatusMessage);
|
this->setCurrentPage(this->ui->pg_StatusMessage);
|
||||||
this->showWindow(displayTimeMs);
|
this->showWindow(displayTimeMs);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "ui_maininfoareacomponent.h"
|
#include "ui_maininfoareacomponent.h"
|
||||||
#include "../stylesheetutility.h"
|
#include "../stylesheetutility.h"
|
||||||
#include "../guiutility.h"
|
#include "../guiutility.h"
|
||||||
#include "blackmisc/iconsstandard.h"
|
#include "blackmisc/icons.h"
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QListIterator>
|
#include <QListIterator>
|
||||||
#include <QSignalMapper>
|
#include <QSignalMapper>
|
||||||
@@ -28,7 +28,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
this->ps_setInfoAreaFloating(this->m_infoAreaFloating);
|
this->ps_setInfoAreaFloating(this->m_infoAreaFloating);
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowIcon(CIconsStandard::swift24());
|
this->setWindowIcon(CIcons::swift24());
|
||||||
|
|
||||||
// after setup, GUI established
|
// after setup, GUI established
|
||||||
if (this->m_dockableWidgets.isEmpty())
|
if (this->m_dockableWidgets.isEmpty())
|
||||||
@@ -61,9 +61,9 @@ namespace BlackGui
|
|||||||
void CMainInfoAreaComponent::addToContextMenu(QMenu *menu) const
|
void CMainInfoAreaComponent::addToContextMenu(QMenu *menu) const
|
||||||
{
|
{
|
||||||
if (!menu) return;
|
if (!menu) return;
|
||||||
menu->addAction(CIconsStandard::dockTop16(), "Dock all", this, SLOT(dockAllWidgets()));
|
menu->addAction(CIcons::dockTop16(), "Dock all", this, SLOT(dockAllWidgets()));
|
||||||
menu->addAction(CIconsStandard::floatAll16(), "Float all", this, SLOT(floatAllWidgets()));
|
menu->addAction(CIcons::floatAll16(), "Float all", this, SLOT(floatAllWidgets()));
|
||||||
menu->addAction(CIconsStandard::floatOne16(), "Dock / float info area", this, SLOT(toggleFloating()));
|
menu->addAction(CIcons::floatOne16(), "Dock / float info area", this, SLOT(toggleFloating()));
|
||||||
|
|
||||||
bool c = false;
|
bool c = false;
|
||||||
if (!this->m_dockableWidgets.isEmpty())
|
if (!this->m_dockableWidgets.isEmpty())
|
||||||
@@ -118,13 +118,13 @@ namespace BlackGui
|
|||||||
QAction *showMenuText = new QAction(menu);
|
QAction *showMenuText = new QAction(menu);
|
||||||
showMenuText->setObjectName("ShowDockedWidgetTextAction");
|
showMenuText->setObjectName("ShowDockedWidgetTextAction");
|
||||||
showMenuText->setIconText("Show tab text");
|
showMenuText->setIconText("Show tab text");
|
||||||
showMenuText->setIcon(CIconsStandard::headingOne16());
|
showMenuText->setIcon(CIcons::headingOne16());
|
||||||
showMenuText->setCheckable(true);
|
showMenuText->setCheckable(true);
|
||||||
showMenuText->setChecked(this->m_showTabTexts);
|
showMenuText->setChecked(this->m_showTabTexts);
|
||||||
menu->addAction(showMenuText);
|
menu->addAction(showMenuText);
|
||||||
connect(showMenuText, &QAction::toggled, this, &CMainInfoAreaComponent::ps_showTabTexts);
|
connect(showMenuText, &QAction::toggled, this, &CMainInfoAreaComponent::ps_showTabTexts);
|
||||||
|
|
||||||
menu->addAction(CIconsStandard::dockBottom16(), "Toogle tabbar position", this, SLOT(ps_toggleTabBarPosition()));
|
menu->addAction(CIcons::dockBottom16(), "Toogle tabbar position", this, SLOT(ps_toggleTabBarPosition()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,27 +373,27 @@ namespace BlackGui
|
|||||||
switch (infoArea)
|
switch (infoArea)
|
||||||
{
|
{
|
||||||
case InfoAreaUsers:
|
case InfoAreaUsers:
|
||||||
return CIconsStandard::appUsers16();
|
return CIcons::appUsers16();
|
||||||
case InfoAreaWeather:
|
case InfoAreaWeather:
|
||||||
return CIconsStandard::appWeather16();
|
return CIcons::appWeather16();
|
||||||
case InfoAreaAtc:
|
case InfoAreaAtc:
|
||||||
return CIconsStandard::appAtc16();
|
return CIcons::appAtc16();
|
||||||
case InfoAreaAircrafts:
|
case InfoAreaAircrafts:
|
||||||
return CIconsStandard::appAircrafts16();
|
return CIcons::appAircrafts16();
|
||||||
case InfoAreaSettings:
|
case InfoAreaSettings:
|
||||||
return CIconsStandard::appSettings16();
|
return CIcons::appSettings16();
|
||||||
case InfoAreaFlightPlan:
|
case InfoAreaFlightPlan:
|
||||||
return CIconsStandard::appFlightplan16();
|
return CIcons::appFlightPlan16();
|
||||||
case InfoAreaTextMessages:
|
case InfoAreaTextMessages:
|
||||||
return CIconsStandard::appTextMessages16();
|
return CIcons::appTextMessages16();
|
||||||
case InfoAreaSimulator:
|
case InfoAreaSimulator:
|
||||||
return CIconsStandard::appSimulator16();
|
return CIcons::appSimulator16();
|
||||||
case InfoAreaMappings:
|
case InfoAreaMappings:
|
||||||
return CIconsStandard::appMappings16();
|
return CIcons::appMappings16();
|
||||||
case InfoAreaLog:
|
case InfoAreaLog:
|
||||||
return CIconsStandard::appLog16();
|
return CIcons::appLog16();
|
||||||
default:
|
default:
|
||||||
return CIconsStandard::empty();
|
return CIcons::empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "dockwidgetinfoarea.h"
|
#include "dockwidgetinfoarea.h"
|
||||||
#include "components/maininfoareacomponent.h"
|
#include "components/maininfoareacomponent.h"
|
||||||
#include "blackmisc/iconsstandard.h"
|
#include "blackmisc/icons.h"
|
||||||
|
|
||||||
using namespace BlackGui::Components;
|
using namespace BlackGui::Components;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace BlackGui
|
|||||||
case NotSet:
|
case NotSet:
|
||||||
case StationsOnline:
|
case StationsOnline:
|
||||||
this->m_columns.addColumn(CColumn("callsign", CAtcStation::IndexCallsignAsStringAsSet));
|
this->m_columns.addColumn(CColumn("callsign", CAtcStation::IndexCallsignAsStringAsSet));
|
||||||
this->m_columns.addColumn(CColumn(CAtcStation::IndexIcon, true));
|
this->m_columns.addColumn(CColumn(CAtcStation::IndexPixmap, true));
|
||||||
this->m_columns.addColumn(CColumn("distance", CAtcStation::IndexDistance, Qt::AlignRight | Qt::AlignVCenter));
|
this->m_columns.addColumn(CColumn("distance", CAtcStation::IndexDistance, Qt::AlignRight | Qt::AlignVCenter));
|
||||||
this->m_columns.addColumn(CColumn("frequency", CAtcStation::IndexFrequency, Qt::AlignRight | Qt::AlignVCenter));
|
this->m_columns.addColumn(CColumn("frequency", CAtcStation::IndexFrequency, Qt::AlignRight | Qt::AlignVCenter));
|
||||||
this->m_columns.addColumn(CColumn("controllername", CAtcStation::IndexControllerRealName));
|
this->m_columns.addColumn(CColumn("controllername", CAtcStation::IndexControllerRealName));
|
||||||
@@ -59,7 +59,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
case StationsBooked:
|
case StationsBooked:
|
||||||
this->m_columns.addColumn(CColumn("callsign", CAtcStation::IndexCallsignAsStringAsSet));
|
this->m_columns.addColumn(CColumn("callsign", CAtcStation::IndexCallsignAsStringAsSet));
|
||||||
this->m_columns.addColumn(CColumn(CAtcStation::IndexIcon, true));
|
this->m_columns.addColumn(CColumn(CAtcStation::IndexPixmap, true));
|
||||||
this->m_columns.addColumn(CColumn("controllername", CAtcStation::IndexControllerRealName));
|
this->m_columns.addColumn(CColumn("controllername", CAtcStation::IndexControllerRealName));
|
||||||
this->m_columns.addColumn(CColumn("bookedfrom", CAtcStation::IndexBookedFrom));
|
this->m_columns.addColumn(CColumn("bookedfrom", CAtcStation::IndexBookedFrom));
|
||||||
this->m_columns.addColumn(CColumn("bookeduntil", CAtcStation::IndexBookedUntil));
|
this->m_columns.addColumn(CColumn("bookeduntil", CAtcStation::IndexBookedUntil));
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "clientlistmodel.h"
|
#include "clientlistmodel.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
#include "blackmisc/icon.h"
|
||||||
#include <QMetaProperty>
|
#include <QMetaProperty>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ namespace BlackGui
|
|||||||
this->m_columns.addColumn(CColumn("", CClient::IndexCallsignIcon));
|
this->m_columns.addColumn(CColumn("", CClient::IndexCallsignIcon));
|
||||||
this->m_columns.addColumn(CColumn("callsign", CClient::IndexCallsign));
|
this->m_columns.addColumn(CColumn("callsign", CClient::IndexCallsign));
|
||||||
this->m_columns.addColumn(CColumn("realname", CClient::IndexRealName));
|
this->m_columns.addColumn(CColumn("realname", CClient::IndexRealName));
|
||||||
this->m_columns.addColumn(CColumn("", CClient::IndexVoiceCapabilitiesIcon));
|
this->m_columns.addColumn(CColumn("", CClient::IndexVoiceCapabilitiesPixmap));
|
||||||
this->m_columns.addColumn(CColumn("capabilities", CClient::IndexCapabilitiesString));
|
this->m_columns.addColumn(CColumn("capabilities", CClient::IndexCapabilitiesString));
|
||||||
this->m_columns.addColumn(CColumn("model", CClient::IndexQueriedModelString));
|
this->m_columns.addColumn(CColumn("model", CClient::IndexQueriedModelString));
|
||||||
this->m_columns.addColumn(CColumn("server", CClient::IndexServer));
|
this->m_columns.addColumn(CColumn("server", CClient::IndexServer));
|
||||||
@@ -53,7 +54,7 @@ namespace BlackGui
|
|||||||
if (role == Qt::DecorationRole)
|
if (role == Qt::DecorationRole)
|
||||||
{
|
{
|
||||||
CClient u = this->at(modelIndex);
|
CClient u = this->at(modelIndex);
|
||||||
return u.toIcon();
|
return QVariant(u.toPixmap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CListModelBase::data(modelIndex, role);
|
return CListModelBase::data(modelIndex, role);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "statusmessagelistmodel.h"
|
#include "statusmessagelistmodel.h"
|
||||||
|
#include "blackmisc/icon.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
#include <QMetaProperty>
|
#include <QMetaProperty>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
@@ -43,7 +44,7 @@ namespace BlackGui
|
|||||||
if (role == Qt::DecorationRole)
|
if (role == Qt::DecorationRole)
|
||||||
{
|
{
|
||||||
CStatusMessage msg = this->at(modelIndex);
|
CStatusMessage msg = this->at(modelIndex);
|
||||||
return msg.toIcon();
|
return QVariant(msg.toPixmap());
|
||||||
}
|
}
|
||||||
else if (role == Qt::DisplayRole)
|
else if (role == Qt::DisplayRole)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "avatcstation.h"
|
#include "avatcstation.h"
|
||||||
#include "aviocomsystem.h"
|
#include "aviocomsystem.h"
|
||||||
#include "voiceroom.h"
|
#include "voiceroom.h"
|
||||||
|
#include "icon.h"
|
||||||
#include "blackmiscfreefunctions.h"
|
#include "blackmiscfreefunctions.h"
|
||||||
|
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
@@ -319,8 +320,8 @@ namespace BlackMisc
|
|||||||
return QVariant(this->m_callsign.asString());
|
return QVariant(this->m_callsign.asString());
|
||||||
case IndexCallsignAsStringAsSet:
|
case IndexCallsignAsStringAsSet:
|
||||||
return QVariant(this->m_callsign.getStringAsSet());
|
return QVariant(this->m_callsign.getStringAsSet());
|
||||||
case IndexIcon:
|
case IndexPixmap:
|
||||||
return QVariant(this->m_callsign.toIcon());
|
return QVariant(this->m_callsign.toPixmap());
|
||||||
case IndexController:
|
case IndexController:
|
||||||
return this->m_controller.toQVariant();
|
return this->m_controller.toQVariant();
|
||||||
case IndexControllerRealName:
|
case IndexControllerRealName:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
|||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
IndexCallsign = 0,
|
IndexCallsign = 0,
|
||||||
IndexIcon, // representing icon
|
IndexPixmap, // representing icon
|
||||||
IndexCallsignAsString,
|
IndexCallsignAsString,
|
||||||
IndexCallsignAsStringAsSet,
|
IndexCallsignAsStringAsSet,
|
||||||
IndexController,
|
IndexController,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "avcallsign.h"
|
#include "avcallsign.h"
|
||||||
#include "iconsnetwork.h"
|
#include "iconlist.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -35,26 +35,26 @@ namespace BlackMisc
|
|||||||
/*
|
/*
|
||||||
* Iconify
|
* Iconify
|
||||||
*/
|
*/
|
||||||
const QPixmap &CCallsign::convertToIcon(const CCallsign &callsign)
|
const CIcon &CCallsign::convertToIcon(const CCallsign &callsign)
|
||||||
{
|
{
|
||||||
QString t = callsign.asString().toUpper();
|
QString t = callsign.asString().toUpper();
|
||||||
if (t.length() < 3) return CIconsNetworkAndAviation::roleUnknown();
|
if (t.length() < 3) return CIconList::iconForIndex(CIcons::NetworkRoleUnknown);
|
||||||
t = t.right(3);
|
t = t.right(3);
|
||||||
|
|
||||||
if (callsign.getStringAsSet().contains("_"))
|
if (callsign.getStringAsSet().contains("_"))
|
||||||
{
|
{
|
||||||
if ("APP" == t) return CIconsNetworkAndAviation::roleApproach();
|
if ("APP" == t) return CIconList::iconForIndex(CIcons::NetworkRoleApproach);
|
||||||
if ("GND" == t) return CIconsNetworkAndAviation::roleGround();
|
if ("GND" == t) return CIconList::iconForIndex(CIcons::NetworkRoleGround);
|
||||||
if ("TWR" == t) return CIconsNetworkAndAviation::roleTower();
|
if ("TWR" == t) return CIconList::iconForIndex(CIcons::NetworkRoleTower);
|
||||||
if ("DEL" == t) return CIconsNetworkAndAviation::roleDelivery();
|
if ("DEL" == t) return CIconList::iconForIndex(CIcons::NetworkRoleDelivery);
|
||||||
if ("CTR" == t) return CIconsNetworkAndAviation::roleCenter();
|
if ("CTR" == t) return CIconList::iconForIndex(CIcons::NetworkRoleCenter);
|
||||||
if ("SUP" == t) return CIconsNetworkAndAviation::roleSup();
|
if ("SUP" == t) return CIconList::iconForIndex(CIcons::NetworkRoleSup);
|
||||||
if ("OBS" == t) return CIconsNetworkAndAviation::roleObs();
|
if ("OBS" == t) return CIconList::iconForIndex(CIcons::NetworkRoleApproach);
|
||||||
return CIconsNetworkAndAviation::roleUnknown();
|
return CIconList::iconForIndex(CIcons::NetworkRoleUnknown);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return CIconsNetworkAndAviation::rolePilot();
|
return CIconList::iconForIndex(CIcons::NetworkRolePilot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,9 @@ namespace BlackMisc
|
|||||||
//! \copydoc CValueObject::fromJson
|
//! \copydoc CValueObject::fromJson
|
||||||
virtual void fromJson(const QJsonObject &json) override;
|
virtual void fromJson(const QJsonObject &json) override;
|
||||||
|
|
||||||
|
//! \copydoc CValueObject::toIcon
|
||||||
|
virtual CIcon toIcon() const override;
|
||||||
|
|
||||||
//! Register metadata
|
//! Register metadata
|
||||||
static void registerMetadata();
|
static void registerMetadata();
|
||||||
|
|
||||||
|
|||||||
@@ -214,6 +214,39 @@
|
|||||||
<file>icons/diagona/icons/compass--minus.png</file>
|
<file>icons/diagona/icons/compass--minus.png</file>
|
||||||
<file>icons/diagona/icons/compass--pencil.png</file>
|
<file>icons/diagona/icons/compass--pencil.png</file>
|
||||||
<file>icons/diagona/icons/compass--plus.png</file>
|
<file>icons/diagona/icons/compass--plus.png</file>
|
||||||
|
<file>icons/diagona/icons/globe.png</file>
|
||||||
|
<file>icons/diagona/icons/globe-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/globe-medium-green.png</file>
|
||||||
|
<file>icons/diagona/icons/globe-place.png</file>
|
||||||
|
<file>icons/diagona/icons/globe-small-green.png</file>
|
||||||
|
<file>icons/diagona/icons/script-globe.png</file>
|
||||||
|
<file>icons/diagona/icons/radio.png</file>
|
||||||
|
<file>icons/diagona/icons/radio--exclamation.png</file>
|
||||||
|
<file>icons/diagona/icons/radio-old.png</file>
|
||||||
|
<file>icons/diagona/icons/radio--plus.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-000-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-000-small.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-045.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-045-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-045-small.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-090.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-090-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-090-small.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-135.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-135-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-135-small.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-180.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-180-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-180-small.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-225.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-225-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-225-small.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-270.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-270-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-270-small.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-315.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-315-medium.png</file>
|
||||||
|
<file>icons/diagona/icons/arrow-315-small.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/own">
|
<qresource prefix="/own">
|
||||||
<file>icons/own/app.jpg</file>
|
<file>icons/own/app.jpg</file>
|
||||||
@@ -257,8 +290,6 @@
|
|||||||
<file>icons/qled/round_purple.svg</file>
|
<file>icons/qled/round_purple.svg</file>
|
||||||
<file>icons/qled/round_red.svg</file>
|
<file>icons/qled/round_red.svg</file>
|
||||||
<file>icons/qled/round_yellow.svg</file>
|
<file>icons/qled/round_yellow.svg</file>
|
||||||
<file>icons/qled/screenshot.png</file>
|
|
||||||
<file>icons/qled/screenshot2.png</file>
|
|
||||||
<file>icons/qled/square_blue.svg</file>
|
<file>icons/qled/square_blue.svg</file>
|
||||||
<file>icons/qled/square_green.svg</file>
|
<file>icons/qled/square_green.svg</file>
|
||||||
<file>icons/qled/square_grey.svg</file>
|
<file>icons/qled/square_grey.svg</file>
|
||||||
|
|||||||
@@ -13,13 +13,14 @@
|
|||||||
#include "mathallclasses.h"
|
#include "mathallclasses.h"
|
||||||
#include "geoallclasses.h"
|
#include "geoallclasses.h"
|
||||||
#include "networkallclasses.h"
|
#include "networkallclasses.h"
|
||||||
#include "settingsblackmiscclasses.h"
|
#include "audioallclasses.h"
|
||||||
#include "hwallclasses.h"
|
#include "hwallclasses.h"
|
||||||
|
#include "settingsblackmiscclasses.h"
|
||||||
#include "indexvariantmap.h"
|
#include "indexvariantmap.h"
|
||||||
#include "namevariantpairlist.h"
|
#include "namevariantpairlist.h"
|
||||||
#include "variant.h"
|
#include "variant.h"
|
||||||
#include "statusmessagelist.h"
|
#include "statusmessagelist.h"
|
||||||
#include "audioallclasses.h"
|
#include "iconlist.h"
|
||||||
#include <QtNetwork/QHostInfo>
|
#include <QtNetwork/QHostInfo>
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
@@ -151,9 +152,10 @@ void BlackMisc::registerMetadata()
|
|||||||
CIndexVariantMap::registerMetadata();
|
CIndexVariantMap::registerMetadata();
|
||||||
CNameVariantPair::registerMetadata();
|
CNameVariantPair::registerMetadata();
|
||||||
CNameVariantPairList::registerMetadata();
|
CNameVariantPairList::registerMetadata();
|
||||||
|
|
||||||
CStatusMessage::registerMetadata();
|
CStatusMessage::registerMetadata();
|
||||||
CStatusMessageList::registerMetadata();
|
CStatusMessageList::registerMetadata();
|
||||||
|
CIcon::registerMetadata();
|
||||||
|
CIconList::registerMetadata();
|
||||||
|
|
||||||
// sub namespaces
|
// sub namespaces
|
||||||
PhysicalQuantities::registerMetadata();
|
PhysicalQuantities::registerMetadata();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "blackmisc/geoearthangle.h"
|
#include "blackmisc/geoearthangle.h"
|
||||||
#include "blackmisc/geolatitude.h"
|
#include "blackmisc/geolatitude.h"
|
||||||
#include "blackmisc/geolongitude.h"
|
#include "blackmisc/geolongitude.h"
|
||||||
|
#include "blackmisc/iconlist.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -102,6 +103,14 @@ namespace BlackMisc
|
|||||||
return CAngle::compareImpl(other);
|
return CAngle::compareImpl(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Icon
|
||||||
|
*/
|
||||||
|
template <class LATorLON> CIcon CEarthAngle<LATorLON>::toIcon() const
|
||||||
|
{
|
||||||
|
return BlackMisc::CIconList::iconForIndex(CIcons::GeoPosition);
|
||||||
|
}
|
||||||
|
|
||||||
// see here for the reason of thess forward instantiations
|
// see here for the reason of thess forward instantiations
|
||||||
// http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html
|
// http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html
|
||||||
template class CEarthAngle<CLatitude>;
|
template class CEarthAngle<CLatitude>;
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ namespace BlackMisc
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! \copydoc CValueObject::toIcon
|
||||||
|
CIcon toIcon() const override;
|
||||||
|
|
||||||
//! Register metadata
|
//! Register metadata
|
||||||
static void registerMetadata();
|
static void registerMetadata();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "namevariantpair.h"
|
#include "namevariantpair.h"
|
||||||
|
#include "iconlist.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
@@ -16,10 +17,26 @@ namespace BlackMisc
|
|||||||
/*
|
/*
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
CNameVariantPair::CNameVariantPair(const QString &name, const CVariant &variant)
|
CNameVariantPair::CNameVariantPair(const QString &name, const CVariant &variant, const CIcon &icon)
|
||||||
: m_name(name), m_variant(variant)
|
: m_name(name), m_variant(variant), m_icon(icon)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Icon
|
||||||
|
*/
|
||||||
|
const CIcon &CNameVariantPair::getIcon() const
|
||||||
|
{
|
||||||
|
return this->m_icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Icon?
|
||||||
|
*/
|
||||||
|
bool CNameVariantPair::hasIcon() const
|
||||||
|
{
|
||||||
|
return this->getIcon().isSet();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert to string
|
* Convert to string
|
||||||
*/
|
*/
|
||||||
@@ -108,6 +125,10 @@ namespace BlackMisc
|
|||||||
return QVariant(this->m_name);
|
return QVariant(this->m_name);
|
||||||
case IndexVariant:
|
case IndexVariant:
|
||||||
return this->m_variant.toQVariant();
|
return this->m_variant.toQVariant();
|
||||||
|
case IndexIcon:
|
||||||
|
return this->m_icon.toQVariant();
|
||||||
|
case IndexPixmap:
|
||||||
|
return this->m_icon.toPixmap();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -130,6 +151,17 @@ namespace BlackMisc
|
|||||||
case IndexVariant:
|
case IndexVariant:
|
||||||
this->m_variant = variant;
|
this->m_variant = variant;
|
||||||
break;
|
break;
|
||||||
|
case IndexIcon:
|
||||||
|
if (variant.canConvert<int>())
|
||||||
|
{
|
||||||
|
CIcons::IconIndexes index = static_cast<CIcons::IconIndexes>(variant.toInt());
|
||||||
|
this->m_icon = CIconList::iconForIndex(index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->m_icon = variant.value<BlackMisc::CIcon>();
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Q_ASSERT_X(false, "CNameVariantPair", "index unknown");
|
Q_ASSERT_X(false, "CNameVariantPair", "index unknown");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "variant.h"
|
#include "variant.h"
|
||||||
#include "valueobject.h"
|
#include "valueobject.h"
|
||||||
|
#include "icon.h"
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -27,7 +28,7 @@ namespace BlackMisc
|
|||||||
CNameVariantPair() {}
|
CNameVariantPair() {}
|
||||||
|
|
||||||
//! Constructor.
|
//! Constructor.
|
||||||
CNameVariantPair(const QString &name, const CVariant &variant);
|
CNameVariantPair(const QString &name, const CVariant &variant, const CIcon &icon = CIcon());
|
||||||
|
|
||||||
//! \copydoc CValueObject::toQVariant
|
//! \copydoc CValueObject::toQVariant
|
||||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||||
@@ -44,6 +45,12 @@ namespace BlackMisc
|
|||||||
//! Set variant.
|
//! Set variant.
|
||||||
void setVariant(const CVariant &variant) { m_variant = variant; }
|
void setVariant(const CVariant &variant) { m_variant = variant; }
|
||||||
|
|
||||||
|
//! Icon
|
||||||
|
const CIcon &getIcon() const;
|
||||||
|
|
||||||
|
//! Has icon
|
||||||
|
bool hasIcon() const;
|
||||||
|
|
||||||
//! Equal operator ==
|
//! Equal operator ==
|
||||||
bool operator ==(const CNameVariantPair &other) const;
|
bool operator ==(const CNameVariantPair &other) const;
|
||||||
|
|
||||||
@@ -70,6 +77,8 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
IndexName = 0,
|
IndexName = 0,
|
||||||
IndexVariant,
|
IndexVariant,
|
||||||
|
IndexIcon,
|
||||||
|
IndexPixmap
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \copydoc CValueObject::propertyByIndex()
|
//! \copydoc CValueObject::propertyByIndex()
|
||||||
@@ -99,12 +108,13 @@ namespace BlackMisc
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
BLACK_ENABLE_TUPLE_CONVERSION(CNameVariantPair)
|
BLACK_ENABLE_TUPLE_CONVERSION(CNameVariantPair)
|
||||||
QString m_name;
|
QString m_name;
|
||||||
CVariant m_variant;
|
CVariant m_variant;
|
||||||
|
CIcon m_icon; //!< optional icon
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CNameVariantPair, (o.m_name, o.m_variant))
|
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::CNameVariantPair, (o.m_name, o.m_variant, o.m_icon))
|
||||||
Q_DECLARE_METATYPE(BlackMisc::CNameVariantPair)
|
Q_DECLARE_METATYPE(BlackMisc::CNameVariantPair)
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
Reference in New Issue
Block a user