mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 11:56:57 +08:00
Tweak in icon / callsign
* conversion to Icon in callsign * toQIcon function
This commit is contained in:
@@ -41,17 +41,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (callsign.hasSuffix())
|
||||
{
|
||||
QString t = callsign.getSuffix();
|
||||
if (t.length() < 3) { return CIconList::iconByIndex(CIcons::NetworkRoleUnknown); }
|
||||
if ("APP" == t) { return CIconList::iconByIndex(CIcons::NetworkRoleApproach); }
|
||||
if ("GND" == t) { return CIconList::iconByIndex(CIcons::NetworkRoleGround); }
|
||||
if ("TWR" == t) { return CIconList::iconByIndex(CIcons::NetworkRoleTower); }
|
||||
if ("DEL" == t) { return CIconList::iconByIndex(CIcons::NetworkRoleDelivery); }
|
||||
if ("CTR" == t) { return CIconList::iconByIndex(CIcons::NetworkRoleCenter); }
|
||||
if ("SUP" == t) { return CIconList::iconByIndex(CIcons::NetworkRoleSup); }
|
||||
if ("OBS" == t) { return CIconList::iconByIndex(CIcons::NetworkRoleObs); }
|
||||
if ("ATIS" == t) { return CIconList::iconByIndex(CIcons::AviationAtis); }
|
||||
return CIconList::iconByIndex(CIcons::NetworkRoleUnknown);
|
||||
return suffixToIcon(callsign.getSuffix());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -59,6 +49,22 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
const CIcon &CCallsign::suffixToIcon(const QString &suffix)
|
||||
{
|
||||
if (suffix.length() < 3) { return CIconList::iconByIndex(CIcons::NetworkRoleUnknown); }
|
||||
QString sfx = suffix.toUpper();
|
||||
if ("APP" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleApproach); }
|
||||
if ("GND" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleGround); }
|
||||
if ("TWR" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleTower); }
|
||||
if ("DEL" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleDelivery); }
|
||||
if ("CTR" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleCenter); }
|
||||
if ("SUP" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleSup); }
|
||||
if ("OBS" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleObs); }
|
||||
if ("ATIS" == sfx) { return CIconList::iconByIndex(CIcons::AviationAtis); }
|
||||
if ("VATSIM" == sfx) { return CIconList::iconByIndex(CIcons::NetworkRoleMnt); }
|
||||
return CIconList::iconByIndex(CIcons::NetworkRoleUnknown);
|
||||
}
|
||||
|
||||
/*
|
||||
* ATC callsign?
|
||||
*/
|
||||
@@ -195,5 +201,6 @@ namespace BlackMisc
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user