diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index ca7757321b..76aee52123 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -339,27 +339,27 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list) checkActivityTabVisibility(); - int newGuiLogCount = accNotified.count(); + const int newGuiLogCount = accNotified.count(); if (newGuiLogCount > 0) { // restart the gui log timer now that we show a notification _guiLogTimer.start(); // Assemble a tray notification - QString msg = tr("You received %n new notification(s) from %1.", "", accNotified[accNotified.keys().at(0)]).arg(accNotified.keys().at(0)); - - if (newGuiLogCount >= 2) { - QString acc1 = accNotified.keys().at(0); - QString acc2 = accNotified.keys().at(1); + QString msg; + if (newGuiLogCount == 1) { + msg = tr("You received %n new request(s) from %1.", "", accNotified.begin().value()).arg(accNotified.begin().key()); + } else if (newGuiLogCount >= 2) { + const auto acc1 = accNotified.begin(); + const auto acc2 = acc1 + 1; if (newGuiLogCount == 2) { - int notiCount = accNotified[acc1] + accNotified[acc2]; - msg = tr("You received %n new notification(s) from %1 and %2.", "", notiCount).arg(acc1, acc2); + const int notiCount = acc1.value() + acc2.value(); + msg = tr("You received %n new request(s) from %1 and %2.", "", notiCount).arg(acc1.key(), acc2.key()); } else { - msg = tr("You received new notifications from %1, %2 and other accounts.").arg(acc1, acc2); + msg = tr("You received new request from %1, %2 and other accounts.").arg(acc1.key(), acc2.key()); } } - - const QString log = tr("%1 Notifications - Action Required").arg(Theme::instance()->appNameGUI()); + const QString log = tr("Action required. Open the activity view to react."); emit guiLog(log, msg); }