@@ -189,6 +189,7 @@ namespace BlackGui::Components
189
189
for (const CTextMessage &message : messages)
190
190
{
191
191
bool relevantForMe = false ;
192
+ CNotificationSounds::NotificationFlag notification = CNotificationSounds::NoNotifications;
192
193
193
194
// SELCAL
194
195
if (!m_usedAsOverlayWidget && message.isSelcalMessage () && ownAircraft.isSelcalSelected (message.getSelcalCode ()))
@@ -211,6 +212,12 @@ namespace BlackGui::Components
211
212
if (message.isSendToUnicom ())
212
213
{
213
214
ui->tep_TextMessagesUnicom ->insertTextMessage (message);
215
+
216
+ // Message was received from others
217
+ if (!message.wasSent ())
218
+ {
219
+ notification = CNotificationSounds::NotificationTextMessageUnicom;
220
+ }
214
221
relevantForMe = true ;
215
222
}
216
223
@@ -231,18 +238,26 @@ namespace BlackGui::Components
231
238
if (message.isSendToFrequency (ownAircraft.getCom1System ().getFrequencyActive ()))
232
239
{
233
240
ui->tep_TextMessagesCOM1 ->insertTextMessage (message);
241
+ if (!message.isSendToUnicom ())
242
+ {
243
+ notification = CNotificationSounds::NotificationTextMessageFrequency;
244
+ }
234
245
relevantForMe = true ;
235
246
}
236
247
if (message.isSendToFrequency (ownAircraft.getCom2System ().getFrequencyActive ()))
237
248
{
238
249
ui->tep_TextMessagesCOM2 ->insertTextMessage (message);
250
+ if (!message.isSendToUnicom ())
251
+ {
252
+ notification = CNotificationSounds::NotificationTextMessageFrequency;
253
+ }
239
254
relevantForMe = true ;
240
255
}
241
256
242
257
// callsign mentioned notification
243
258
if (relevantForMe && audioCsMentioned && ownAircraft.hasCallsign () && message.mentionsCallsign (ownAircraft.getCallsign ()))
244
259
{
245
- sGui -> getCContextAudioBase ()-> playNotification ( CNotificationSounds::NotificationTextCallsignMentioned, false ) ;
260
+ notification = CNotificationSounds::NotificationTextCallsignMentioned;
246
261
// Flash taskbar icon
247
262
QApplication::alert (QWidget::topLevelWidget ());
248
263
}
@@ -270,6 +285,12 @@ namespace BlackGui::Components
270
285
}
271
286
if (!relevantForMe) { continue ; }
272
287
288
+ // Play notification
289
+ if (playNotification && notification != CNotificationSounds::NoNotifications)
290
+ {
291
+ sGui ->getCContextAudioBase ()->playNotification (notification, true );
292
+ }
293
+
273
294
// overlay message if this channel is not selected
274
295
if (message.isServerMessage ()) { continue ; }
275
296
if (message.isBroadcastMessage ()) { continue ; }
0 commit comments