When QutBox is selected then Display header item "Recipient" instead of "From"

Added to Count Total Inbox and Total Sent on Messages.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2813 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-04-28 21:05:11 +00:00
parent 7f8cafa8a9
commit caaf7884f8
2 changed files with 105 additions and 0 deletions

View File

@ -744,6 +744,15 @@ void MessagesDialog::insertMessages()
} }
} }
if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX )
{
MessagesModel->setHeaderData(2, Qt::Horizontal, tr("Recipient"));
}
else
{
MessagesModel->setHeaderData(2, Qt::Horizontal, tr("From"));
}
// No of Files. // No of Files.
{ {
std::ostringstream out; std::ostringstream out;
@ -1285,6 +1294,8 @@ void MessagesDialog::updateMessageSummaryList()
int newInboxCount = 0; int newInboxCount = 0;
int newOutboxCount = 0; int newOutboxCount = 0;
int newDraftCount = 0; int newDraftCount = 0;
int newSentboxCount = 0;
int inboxCount = 0;
/*calculating the new messages*/ /*calculating the new messages*/
for(it = msgList.begin(); it != msgList.end(); it++) for(it = msgList.begin(); it != msgList.end(); it++)
@ -1293,6 +1304,10 @@ void MessagesDialog::updateMessageSummaryList()
{ {
newInboxCount ++; newInboxCount ++;
} }
if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX )
{
inboxCount ++;
}
if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX ) if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX )
{ {
newOutboxCount ++; newOutboxCount ++;
@ -1301,6 +1316,10 @@ void MessagesDialog::updateMessageSummaryList()
{ {
newDraftCount ++; newDraftCount ++;
} }
if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_SENTBOX )
{
newSentboxCount ++;
}
} }
QString textItem; QString textItem;
@ -1375,6 +1394,50 @@ void MessagesDialog::updateMessageSummaryList()
item->setFont(qf); item->setFont(qf);
} }
/* Total Inbox */
if(inboxCount != 0)
{
QListWidgetItem* item = ui.listWidget->item(5);
textItem = tr("Total Inbox:") + " " + QString::number(inboxCount);
item->setText(textItem);
/*QFont qf = item->font();
qf.setBold(true);
item->setFont(qf);*/
}
else
{
QListWidgetItem* item = ui.listWidget->item(5);
textItem = tr("Total Inbox:") + " " + "0";
item->setText(textItem);
/*QFont qf = item->font();
qf.setBold(false);
item->setFont(qf);*/
}
/* Total Sent */
if(newSentboxCount != 0)
{
QListWidgetItem* item = ui.listWidget->item(6);
textItem = tr("Total Sent:") + " " + QString::number(newSentboxCount);
item->setText(textItem);
/*QFont qf = item->font();
qf.setBold(true);
item->setFont(qf);*/
}
else
{
QListWidgetItem* item = ui.listWidget->item(6);
textItem = tr("Total Sent:") + " " + "0";
item->setText(textItem);
/*QFont qf = item->font();
qf.setBold(false);
item->setFont(qf);*/
}
} }
/** clear Filter **/ /** clear Filter **/

View File

@ -1029,6 +1029,48 @@ border-image: url(:/images/closepressed.png)
<normaloff>:/images/folder-sent.png</normaloff>:/images/folder-sent.png</iconset> <normaloff>:/images/folder-sent.png</normaloff>:/images/folder-sent.png</iconset>
</property> </property>
</item> </item>
<item>
<property name="text">
<string/>
</property>
<property name="background">
<brush brushstyle="NoBrush">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</property>
<property name="foreground">
<brush brushstyle="NoBrush">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</property>
<property name="flags">
<set>ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Total Inbox:</string>
</property>
<property name="flags">
<set>ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Total Sent:</string>
</property>
<property name="flags">
<set>ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
</widget> </widget>
<widget class="QSplitter" name="msgSplitter"> <widget class="QSplitter" name="msgSplitter">
<property name="orientation"> <property name="orientation">