[AFV] Ref T730, changed/added settings for AFV and allow still to use old swift notifications

This commit is contained in:
Klaus Basan
2019-10-17 18:13:57 +02:00
parent 3a469d4654
commit 7fdc2c3db3
5 changed files with 26 additions and 14 deletions

View File

@@ -62,9 +62,12 @@ namespace BlackMisc
bool textMessageSupervisor() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextMessageSupervisor); }
bool textCallsignMentioned() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationTextCallsignMentioned); }
bool noAudioTransmission() const { return this->isNotificationFlagSet(CNotificationSounds::NotificationNoAudioTransmission); }
bool pttClickDown() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyDown); }
bool pttClickUp() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp); }
bool pttBlocked() const { return this->isNotificationFlagSet(CNotificationSounds::PTTBlocked); }
bool pttClickDown() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyDown); }
bool pttClickUp() const { return this->isNotificationFlagSet(CNotificationSounds::PTTClickKeyUp); }
bool pttBlocked() const { return this->isNotificationFlagSet(CNotificationSounds::PTTBlocked); }
bool afvClicked() const { return this->isNotificationFlagSet(CNotificationSounds::AFVClicked); }
bool afvBlocked() const { return this->isNotificationFlagSet(CNotificationSounds::AFVBlocked); }
//! @}
//! Settings value

View File

@@ -33,6 +33,8 @@ namespace BlackMisc
static const QString pttBlocked("PTT blocked");
static const QString load("load sounds");
static const QString noaudiotx("No audio tx");
static const QString afvclick("AFC click");
static const QString afvblock("AFV blocked");
switch (notification)
{
@@ -46,6 +48,8 @@ namespace BlackMisc
case PTTClickKeyDown: return pttDown;
case PTTClickKeyUp: return pttUp;
case PTTBlocked: return pttBlocked;
case AFVClicked: return afvclick;
case AFVBlocked: return afvblock;
default: break;
}
return unknown;
@@ -64,6 +68,9 @@ namespace BlackMisc
if (notification.testFlag(PTTClickKeyUp)) n << flagToString(PTTClickKeyUp);
if (notification.testFlag(PTTClickKeyDown)) n << flagToString(PTTClickKeyDown);
if (notification.testFlag(PTTBlocked)) n << flagToString(PTTBlocked);
if (notification.testFlag(AFVClicked)) n << flagToString(AFVClicked);
if (notification.testFlag(AFVBlocked)) n << flagToString(AFVBlocked);
return n.join(", ");
}
} // ns

View File

@@ -46,7 +46,9 @@ namespace BlackMisc
NotificationNoAudioTransmission = 1 << 6,
PTTClickKeyDown = 1 << 7,
PTTClickKeyUp = 1 << 8,
PTTBlocked = 1 << 9
PTTBlocked = 1 << 9,
AFVClicked = 1 << 14,
AFVBlocked = 1 << 15
};
Q_DECLARE_FLAGS(Notification, NotificationFlag)
@@ -59,8 +61,11 @@ namespace BlackMisc
//! All PTT notification flags
constexpr static Notification AllPTTNotifications = Notification(PTTBlocked | PTTClickKeyUp | PTTClickKeyDown);
//! All AFV flags
constexpr static Notification AllAfv = Notification(AFVClicked | AFVBlocked);
//! All notification flags
constexpr static Notification AllNotifications = Notification(NotificationError | AllTextNotifications | AllLoginNotifications | AllPTTNotifications);
constexpr static Notification AllNotifications = Notification(NotificationError | AllTextNotifications | AllLoginNotifications | AllPTTNotifications | AllAfv);
//! Default notification flags
constexpr static Notification DefaultNotifications = Notification(AllNotifications);