mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Count of new messages in systemtray tooltip corrected
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2872 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a726f3c063
commit
20908b2c48
@ -358,24 +358,25 @@ void MainWindow::updateStatus()
|
||||
std::list<MsgInfoSummary>::const_iterator it;
|
||||
|
||||
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(newInboxCount)
|
||||
messageAction->setIcon(QIcon(QPixmap(":/images/messages_new.png"))) ;
|
||||
else
|
||||
messageAction->setIcon(QIcon(QPixmap(":/images/evolution.png"))) ;
|
||||
|
||||
if(new_msg)
|
||||
messageAction->setIcon(QIcon(QPixmap(":/images/messages_new.png"))) ;
|
||||
else
|
||||
messageAction->setIcon(QIcon(QPixmap(":/images/evolution.png"))) ;
|
||||
|
||||
if(new_msg)
|
||||
if(newInboxCount)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(":/images/newmsg.png"));
|
||||
trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new message").arg(newInboxCount));
|
||||
if (newInboxCount > 1) {
|
||||
trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new messages").arg(newInboxCount));
|
||||
} else {
|
||||
trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new message").arg(newInboxCount));
|
||||
}
|
||||
}
|
||||
else if (online == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user