mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Show the selected tag in the tab title in MessagesDialog.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4219 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
eae57516c5
commit
b1953fd769
@ -982,66 +982,74 @@ void MessagesDialog::insertMessages()
|
|||||||
|
|
||||||
/* check the mode we are in */
|
/* check the mode we are in */
|
||||||
unsigned int msgbox = 0;
|
unsigned int msgbox = 0;
|
||||||
bool bTrash = false;
|
bool isTrash = false;
|
||||||
bool bFill = true;
|
bool doFill = true;
|
||||||
uint32_t nTagId = 0;
|
uint32_t tagId = 0;
|
||||||
|
QString boxText;
|
||||||
|
QIcon boxIcon;
|
||||||
|
|
||||||
switch (m_eListMode) {
|
switch (m_eListMode) {
|
||||||
case LIST_NOTHING:
|
case LIST_NOTHING:
|
||||||
bFill = false;
|
doFill = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LIST_BOX:
|
case LIST_BOX:
|
||||||
{
|
{
|
||||||
|
QListWidgetItem *item = ui.listWidget->currentItem();
|
||||||
|
if (item) {
|
||||||
|
boxIcon = item->icon();
|
||||||
|
}
|
||||||
|
|
||||||
int listrow = ui.listWidget->currentRow();
|
int listrow = ui.listWidget->currentRow();
|
||||||
|
|
||||||
switch (listrow) {
|
switch (listrow) {
|
||||||
case ROW_INBOX:
|
case ROW_INBOX:
|
||||||
msgbox = RS_MSG_INBOX;
|
msgbox = RS_MSG_INBOX;
|
||||||
ui.tabWidget->setTabIcon ( 0, QIcon(":/images/folder-inbox.png") );
|
boxText = tr("Inbox");
|
||||||
ui.tabWidget->setTabText ( 0, tr ("Inbox") );
|
|
||||||
break;
|
break;
|
||||||
case ROW_OUTBOX:
|
case ROW_OUTBOX:
|
||||||
msgbox = RS_MSG_OUTBOX;
|
msgbox = RS_MSG_OUTBOX;
|
||||||
ui.tabWidget->setTabIcon ( 0, QIcon(":/images/folder-outbox.png") );
|
boxText = tr("Outbox");
|
||||||
ui.tabWidget->setTabText ( 0, tr ("Outbox") );
|
|
||||||
break;
|
break;
|
||||||
case ROW_DRAFTBOX:
|
case ROW_DRAFTBOX:
|
||||||
msgbox = RS_MSG_DRAFTBOX;
|
msgbox = RS_MSG_DRAFTBOX;
|
||||||
ui.tabWidget->setTabIcon ( 0, QIcon(":/images/folder-draft.png") );
|
boxText = tr("Drafts");
|
||||||
ui.tabWidget->setTabText ( 0, tr ("Drafts") );
|
|
||||||
break;
|
break;
|
||||||
case ROW_SENTBOX:
|
case ROW_SENTBOX:
|
||||||
msgbox = RS_MSG_SENTBOX;
|
msgbox = RS_MSG_SENTBOX;
|
||||||
ui.tabWidget->setTabIcon ( 0, QIcon(":/images/folder-sent.png") );
|
boxText = tr("Sent");
|
||||||
ui.tabWidget->setTabText ( 0, tr ("Sent") );
|
|
||||||
break;
|
break;
|
||||||
case ROW_TRASHBOX:
|
case ROW_TRASHBOX:
|
||||||
bTrash = true;
|
isTrash = true;
|
||||||
ui.tabWidget->setTabIcon ( 0, QIcon(":/images/folder-trash.png") );
|
boxText = tr("Trash");
|
||||||
ui.tabWidget->setTabText ( 0, tr ("Trash") );
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bFill = false;
|
doFill = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LIST_TAG:
|
case LIST_TAG:
|
||||||
{
|
{
|
||||||
QListWidgetItem *pItem = ui.tagWidget->currentItem();
|
QListWidgetItem *item = ui.tagWidget->currentItem();
|
||||||
if (pItem) {
|
if (item) {
|
||||||
nTagId = pItem->data (Qt::UserRole).toInt();
|
tagId = item->data (Qt::UserRole).toInt();
|
||||||
|
|
||||||
|
boxText = item->text();
|
||||||
|
boxIcon = item->icon();
|
||||||
} else {
|
} else {
|
||||||
bFill = false;
|
doFill = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bFill = false;
|
doFill = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui.tabWidget->setTabText (0, boxText);
|
||||||
|
ui.tabWidget->setTabIcon (0, boxIcon);
|
||||||
|
|
||||||
if (msgbox == RS_MSG_INBOX) {
|
if (msgbox == RS_MSG_INBOX) {
|
||||||
MessagesModel->setHeaderData(COLUMN_FROM, Qt::Horizontal, tr("From"));
|
MessagesModel->setHeaderData(COLUMN_FROM, Qt::Horizontal, tr("From"));
|
||||||
MessagesModel->setHeaderData(COLUMN_FROM, Qt::Horizontal, tr("Click to sort by from"), Qt::ToolTipRole);
|
MessagesModel->setHeaderData(COLUMN_FROM, Qt::Horizontal, tr("Click to sort by from"), Qt::ToolTipRole);
|
||||||
@ -1050,7 +1058,7 @@ void MessagesDialog::insertMessages()
|
|||||||
MessagesModel->setHeaderData(COLUMN_FROM, Qt::Horizontal, tr("Click to sort by to"), Qt::ToolTipRole);
|
MessagesModel->setHeaderData(COLUMN_FROM, Qt::Horizontal, tr("Click to sort by to"), Qt::ToolTipRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bFill) {
|
if (doFill) {
|
||||||
MsgTagType Tags;
|
MsgTagType Tags;
|
||||||
rsMsgs->getMessageTagTypes(Tags);
|
rsMsgs->getMessageTagTypes(Tags);
|
||||||
|
|
||||||
@ -1058,7 +1066,7 @@ void MessagesDialog::insertMessages()
|
|||||||
std::list<MsgInfoSummary> msgToShow;
|
std::list<MsgInfoSummary> msgToShow;
|
||||||
for(it = msgList.begin(); it != msgList.end(); it++) {
|
for(it = msgList.begin(); it != msgList.end(); it++) {
|
||||||
if (m_eListMode == LIST_BOX) {
|
if (m_eListMode == LIST_BOX) {
|
||||||
if (bTrash) {
|
if (isTrash) {
|
||||||
if ((it->msgflags & RS_MSG_TRASH) == 0) {
|
if ((it->msgflags & RS_MSG_TRASH) == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1073,7 +1081,7 @@ void MessagesDialog::insertMessages()
|
|||||||
} else if (m_eListMode == LIST_TAG) {
|
} else if (m_eListMode == LIST_TAG) {
|
||||||
MsgTagInfo tagInfo;
|
MsgTagInfo tagInfo;
|
||||||
rsMsgs->getMessageTag(it->msgId, tagInfo);
|
rsMsgs->getMessageTag(it->msgId, tagInfo);
|
||||||
if (std::find(tagInfo.tagIds.begin(), tagInfo.tagIds.end(), nTagId) == tagInfo.tagIds.end()) {
|
if (std::find(tagInfo.tagIds.begin(), tagInfo.tagIds.end(), tagId) == tagInfo.tagIds.end()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user