From 4c3651d597fdb2ae6bc9f2e6685eb7bac17b5572 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 15 Apr 2010 14:35:27 +0000 Subject: [PATCH] Added to count new messages on Tray icon git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2722 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index b336455e2..64fda29e5 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -348,10 +348,13 @@ void MainWindow::updateStatus() rsMsgs -> getMessageSummaries(msgList); bool new_msg = false ; + int newInboxCount = 0; for(it = msgList.begin(); it != msgList.end(); it++) if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX && ((it -> msgflags & RS_MSG_NEW) == RS_MSG_NEW)) new_msg = true ; + newInboxCount ++; + if(new_msg) messageAction->setIcon(QIcon(QPixmap(":/images/messages_new.png"))) ; @@ -361,7 +364,7 @@ void MainWindow::updateStatus() if(new_msg) { trayIcon->setIcon(QIcon(":/images/newmsg.png")); - trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You have received a new message")); + trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new message").arg(newInboxCount)); } else if (online == 0) {