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
This commit is contained in:
defnax 2010-01-16 02:42:11 +00:00
parent 3f22602b6c
commit 561104297e
5 changed files with 76 additions and 16 deletions

View File

@ -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);
}

View File

@ -13,6 +13,7 @@
<file>images/btn_27.png</file>
<file>images/btn_27_hover.png</file>
<file>images/connect_established.png</file>
<file>images/connect_creating.png</file>
<file>images/feedback_arrow.png</file>
<file>images/feedback_arrow_hover.png</file>
<file>images/feedback-bar-background.png</file>
@ -261,6 +262,9 @@
<file>images/message-mail-read.png</file>
<file>images/message-mail-imapdelete.png</file>
<file>images/message-mail-replied-read.png</file>
<file>images/message-mail-forwarded-read.png</file>
<file>images/message-mail-replied.png</file>
<file>images/message-mail-forwarded.png</file>
<file>images/message-news.png</file>
<file>images/message.png</file>
<file>images/messenger.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B