From 561104297e944ad91b6ba9320d82ab3c3e15191d Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 16 Jan 2010 02:42:11 +0000 Subject: [PATCH] Fixed to check if Messages contains Re or Fwd to not add more. Added when Messages contains Re or Fwd change Message icon git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2052 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MessagesDialog.cpp | 88 ++++++++++++++---- retroshare-gui/src/gui/images.qrc | 4 + .../src/gui/images/message-mail-forwarded.png | Bin 0 -> 656 bytes .../images/message-mail-replied-forw-read.png | Bin 0 -> 842 bytes .../gui/images/message-mail-replied-forw.png | Bin 0 -> 803 bytes 5 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 retroshare-gui/src/gui/images/message-mail-forwarded.png create mode 100644 retroshare-gui/src/gui/images/message-mail-replied-forw-read.png create mode 100644 retroshare-gui/src/gui/images/message-mail-replied-forw.png diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 1bb65cd3b..c875815a0 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -247,7 +247,18 @@ void MessagesDialog::replytomessage() /* fill it in */ //std::cerr << "MessagesDialog::newmessage()" << std::endl; nMsgDialog->newMsg(); + + QString text = QString::fromStdWString(msgInfo.title); + + if (text.startsWith("Re:", Qt::CaseInsensitive)) + { + nMsgDialog->insertTitleText( QString::fromStdWString(msgInfo.title).toStdString()) ; + } + else + { nMsgDialog->insertTitleText( (QString("Re: ") + QString::fromStdWString(msgInfo.title)).toStdString()) ; + } + nMsgDialog->setWindowTitle(tr("Re: ") + QString::fromStdWString(msgInfo.title) ) ; @@ -282,7 +293,17 @@ void MessagesDialog::replyallmessage() /* fill it in */ //std::cerr << "MessagesDialog::newmessage()" << std::endl; nMsgDialog->newMsg(); + + QString text = QString::fromStdWString(msgInfo.title); + + if (text.startsWith("Re:", Qt::CaseInsensitive)) + { + nMsgDialog->insertTitleText( QString::fromStdWString(msgInfo.title).toStdString()) ; + } + else + { nMsgDialog->insertTitleText( (QString("Re: ") + QString::fromStdWString(msgInfo.title)).toStdString()) ; + } nMsgDialog->setWindowTitle(tr("Re: ") + QString::fromStdWString(msgInfo.title) ) ; @@ -327,7 +348,18 @@ void MessagesDialog::forwardmessage() /* fill it in */ //std::cerr << "MessagesDialog::newmessage()" << std::endl; nMsgDialog->newMsg(); + + QString text = QString::fromStdWString(msgInfo.title); + + if (text.startsWith("Fwd:", Qt::CaseInsensitive)) + { + nMsgDialog->insertTitleText( QString::fromStdWString(msgInfo.title).toStdString()) ; + } + else + { nMsgDialog->insertTitleText( (QString("Fwd: ") + QString::fromStdWString(msgInfo.title)).toStdString()) ; + } + nMsgDialog->setWindowTitle(tr("Fwd: ") + QString::fromStdWString(msgInfo.title) ) ; @@ -585,6 +617,46 @@ void MessagesDialog::insertMessages() // Subject item -> setText(2, QString::fromStdWString(it->title)); + + // Change Message icon when Subject is Re: or Fwd: + QString text = QString::fromStdWString(it->title); + + if (text.startsWith("Re:", Qt::CaseInsensitive)) + { + item -> setIcon(2, (QIcon(":/images/message-mail-replied-read.png"))); + } + else if (text.startsWith("Fwd:", Qt::CaseInsensitive)) + { + item -> setIcon(2, (QIcon(":/images/message-mail-forwarded-read.png"))); + } + else + { + item -> setIcon(2, (QIcon(":/images/message-mail-read.png"))); + } + + if (it -> msgflags & RS_MSG_NEW) + { + for(int i = 0; i < 10; i++) + { + QFont qf = item->font(i); + qf.setBold(true); + item->setFont(i, qf); + } + QString text = QString::fromStdWString(it->title); + + if (text.startsWith("Re:", Qt::CaseInsensitive)) + { + item -> setIcon(2, (QIcon(":/images/message-mail-replied.png"))); + } + else if (text.startsWith("Fwd:", Qt::CaseInsensitive)) + { + item -> setIcon(2, (QIcon(":/images/message-mail-forwarded.png"))); + } + else + { + item -> setIcon(2, (QIcon(":/images/message-mail.png"))); + } + } // No of Files. { @@ -601,22 +673,6 @@ void MessagesDialog::insertMessages() newSelected = item; } - if (it -> msgflags & RS_MSG_NEW) - { - for(int i = 0; i < 10; i++) - { - QFont qf = item->font(i); - qf.setBold(true); - item->setFont(i, qf); - item -> setIcon(2, (QIcon(":/images/message-mail.png"))); - - } - } - else - { - item -> setIcon(2, (QIcon(":/images/message-mail-read.png"))); - } - /* add to the list */ items.append(item); } diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 82e44daf6..54d42f2be 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -13,6 +13,7 @@ images/btn_27.png images/btn_27_hover.png images/connect_established.png + images/connect_creating.png images/feedback_arrow.png images/feedback_arrow_hover.png images/feedback-bar-background.png @@ -261,6 +262,9 @@ images/message-mail-read.png images/message-mail-imapdelete.png images/message-mail-replied-read.png + images/message-mail-forwarded-read.png + images/message-mail-replied.png + images/message-mail-forwarded.png images/message-news.png images/message.png images/messenger.png diff --git a/retroshare-gui/src/gui/images/message-mail-forwarded.png b/retroshare-gui/src/gui/images/message-mail-forwarded.png new file mode 100644 index 0000000000000000000000000000000000000000..e7d9881a51948ebb97aaf4f2c2ff34e0d5dd810c GIT binary patch literal 656 zcmV;B0&o3^P)3jx(0?=go88yYF@HZ5%gk+IQgcy?4$%-#zDi2mYI{@NOdK zIwI~07vZ?b?*=NLv+WZ*J{1?XQyd(-n+mv&n+PUO(A3^dAQF?DE_gzsEz!nP=+?k7 zp;kedzbI$FGxzpGLS7m&gk*I>T@*6UaV!g;KO!lD64miz_zeuh!@$Aas!*7nCmIjP zYFyocvG6g*_2XY@>Nw5X`^VU&9OL~nlsDvy$d^S`LJ6l-U^SDWWq&iff{tuS=ouKo zcCjswr#CCK_MIU+`H1D2Dz`?Lu!`oNsS^xZ)tC4=eqR@c@2Z!lRy=Lm6-S8>dG}gD# q+^We9!;@pBOP&;3i+?iN8|mLpS2jfLML8A#000093#{)D~&*uJ`zfQB1J?7g8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