mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Ref T385, allow to filter "by voiceroom"/"by frequency" so co-pilot (OBS login) can be shown
This commit is contained in:
@@ -21,8 +21,8 @@ namespace BlackGui
|
||||
QString CAtcStationsSettings::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
static const QString s("In range only: %1");
|
||||
return s.arg(boolToOnOff(this->showOnlyInRange()));
|
||||
static const QString s("In range only: %1 valid freq: %2 valid voice room: %3");
|
||||
return s.arg(boolToOnOff(this->showOnlyInRange()), boolToOnOff(this->showOnlyWithValidFrequency()), boolToOnOff(this->showOnlyWithValidVoiceRoom()));
|
||||
}
|
||||
|
||||
CVariant CAtcStationsSettings::propertyByIndex(const CPropertyIndex &index) const
|
||||
@@ -32,6 +32,8 @@ namespace BlackGui
|
||||
switch (i)
|
||||
{
|
||||
case IndexInRangeOnly: return CVariant::fromValue(m_showOnlyInRange);
|
||||
case IndexValidFrequencyOnly: return CVariant::fromValue(m_onlyWithValidFrequency);
|
||||
case IndexValidVoiceRoomOnly: return CVariant::fromValue(m_onlyWithValidVoiceRoom);
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
@@ -42,12 +44,10 @@ namespace BlackGui
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexInRangeOnly:
|
||||
this->setShowOnlyInRange(variant.toBool());
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
case IndexInRangeOnly: this->setShowOnlyInRange(variant.toBool()); break;
|
||||
case IndexValidFrequencyOnly: this->setShowOnlyWithValidFrequency(variant.toBool()); break;
|
||||
case IndexValidVoiceRoomOnly: this->setShowOnlyWithValidVoiceRoom(variant.toBool()); break;
|
||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -28,17 +28,31 @@ namespace BlackGui
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexInRangeOnly = BlackMisc::CPropertyIndex::GlobalIndexCAtcStationsSettings,
|
||||
IndexValidFrequencyOnly,
|
||||
IndexValidVoiceRoomOnly
|
||||
};
|
||||
|
||||
//! Default constructor
|
||||
CAtcStationsSettings();
|
||||
|
||||
//! Show in range ATC stations only
|
||||
//! Show in range ATC stations only?
|
||||
bool showOnlyInRange() const { return m_showOnlyInRange; }
|
||||
|
||||
//! Show in range ATC stations only?
|
||||
//! Show in range ATC stations only
|
||||
void setShowOnlyInRange(bool onlyInRange) { m_showOnlyInRange = onlyInRange; }
|
||||
|
||||
//! Show only with valid frequency?
|
||||
bool showOnlyWithValidFrequency() const { return m_onlyWithValidFrequency; }
|
||||
|
||||
//! Show only with valid frequency
|
||||
void setShowOnlyWithValidFrequency(bool onlyValidFrequency) { m_onlyWithValidFrequency = onlyValidFrequency; }
|
||||
|
||||
//! Show only with valid voice room?
|
||||
bool showOnlyWithValidVoiceRoom() const { return m_onlyWithValidVoiceRoom; }
|
||||
|
||||
//! Show only with valid voice room
|
||||
void setShowOnlyWithValidVoiceRoom(bool onlyValidVoiceRoom) { m_onlyWithValidVoiceRoom = onlyValidVoiceRoom; }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -50,10 +64,14 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
bool m_showOnlyInRange = true;
|
||||
bool m_onlyWithValidFrequency = true;
|
||||
bool m_onlyWithValidVoiceRoom = false;
|
||||
|
||||
BLACK_METACLASS(
|
||||
CAtcStationsSettings,
|
||||
BLACK_METAMEMBER(showOnlyInRange)
|
||||
BLACK_METAMEMBER(showOnlyInRange),
|
||||
BLACK_METAMEMBER(onlyWithValidFrequency),
|
||||
BLACK_METAMEMBER(onlyWithValidVoiceRoom)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user