mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-10 10:05:19 -04:00
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:
parent
3f22602b6c
commit
561104297e
5 changed files with 76 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue