mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-15 09:27:09 -05:00
improvements MessagesDialog:
- filled tag list and filter the messages after the selected tag - state of tag list is saved in settings bugfix MessagesDialog: - remove tag with uncheck of menu item git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3048 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
860f3a0568
commit
7c73ecef47
@ -204,6 +204,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
m_bProcessSettings = false;
|
m_bProcessSettings = false;
|
||||||
|
m_bInChange = false;
|
||||||
m_pConfig = new RSettings (CONFIG_FILE);
|
m_pConfig = new RSettings (CONFIG_FILE);
|
||||||
|
|
||||||
connect( ui.messagestreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( messageslistWidgetCostumPopupMenu( QPoint ) ) );
|
connect( ui.messagestreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( messageslistWidgetCostumPopupMenu( QPoint ) ) );
|
||||||
@ -211,6 +212,9 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||||||
connect( ui.messagestreeView, SIGNAL(clicked ( const QModelIndex &) ) , this, SLOT( clicked( const QModelIndex & ) ) );
|
connect( ui.messagestreeView, SIGNAL(clicked ( const QModelIndex &) ) , this, SLOT( clicked( const QModelIndex & ) ) );
|
||||||
connect( ui.messagestreeView, SIGNAL(doubleClicked ( const QModelIndex& ) ) , this, SLOT( doubleClicked( const QModelIndex & ) ) );
|
connect( ui.messagestreeView, SIGNAL(doubleClicked ( const QModelIndex& ) ) , this, SLOT( doubleClicked( const QModelIndex & ) ) );
|
||||||
connect( ui.listWidget, SIGNAL( currentRowChanged ( int) ), this, SLOT( changeBox ( int) ) );
|
connect( ui.listWidget, SIGNAL( currentRowChanged ( int) ), this, SLOT( changeBox ( int) ) );
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
connect( ui.tagWidget, SIGNAL( currentRowChanged ( int) ), this, SLOT( changeTag ( int) ) );
|
||||||
|
#endif
|
||||||
|
|
||||||
connect(ui.newmessageButton, SIGNAL(clicked()), this, SLOT(newmessage()));
|
connect(ui.newmessageButton, SIGNAL(clicked()), this, SLOT(newmessage()));
|
||||||
connect(ui.removemessageButton, SIGNAL(clicked()), this, SLOT(removemessage()));
|
connect(ui.removemessageButton, SIGNAL(clicked()), this, SLOT(removemessage()));
|
||||||
@ -241,6 +245,8 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||||||
|
|
||||||
connect(ui.filterColumnComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterColumnChanged()));
|
connect(ui.filterColumnComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterColumnChanged()));
|
||||||
|
|
||||||
|
m_eListMode = LIST_NOTHING;
|
||||||
|
|
||||||
mCurrCertId = "";
|
mCurrCertId = "";
|
||||||
mCurrMsgId = "";
|
mCurrMsgId = "";
|
||||||
|
|
||||||
@ -344,9 +350,12 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||||||
|
|
||||||
#ifdef STATIC_MSGID
|
#ifdef STATIC_MSGID
|
||||||
// create tag menu
|
// create tag menu
|
||||||
createTagMenu();
|
fillTags();
|
||||||
#else
|
#else
|
||||||
ui.tagButton->setHidden(true);
|
ui.tagButton->setHidden(true);
|
||||||
|
|
||||||
|
ui.Tags_Button->setHidden(true);
|
||||||
|
ui.tagWidget->setHidden(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// create timer for navigation
|
// create timer for navigation
|
||||||
@ -397,6 +406,12 @@ void MessagesDialog::processSettings(bool bLoad)
|
|||||||
// state of message tree
|
// state of message tree
|
||||||
msgwheader->restoreState(Settings->value("MessageTree").toByteArray());
|
msgwheader->restoreState(Settings->value("MessageTree").toByteArray());
|
||||||
|
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
// state of tag list
|
||||||
|
bValue = Settings->value("tagList", true).toBool();
|
||||||
|
ui.Tags_Button->setChecked(bValue);
|
||||||
|
#endif
|
||||||
|
|
||||||
// state of splitter
|
// state of splitter
|
||||||
ui.msgSplitter->restoreState(Settings->value("Splitter").toByteArray());
|
ui.msgSplitter->restoreState(Settings->value("Splitter").toByteArray());
|
||||||
ui.msgSplitter_2->restoreState(Settings->value("Splitter2").toByteArray());
|
ui.msgSplitter_2->restoreState(Settings->value("Splitter2").toByteArray());
|
||||||
@ -406,6 +421,11 @@ void MessagesDialog::processSettings(bool bLoad)
|
|||||||
// state of message tree
|
// state of message tree
|
||||||
Settings->setValue("MessageTree", msgwheader->saveState());
|
Settings->setValue("MessageTree", msgwheader->saveState());
|
||||||
|
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
// state of tag list
|
||||||
|
Settings->setValue("tagList", ui.Tags_Button->isChecked());
|
||||||
|
#endif
|
||||||
|
|
||||||
// state of splitter
|
// state of splitter
|
||||||
Settings->setValue("Splitter", ui.msgSplitter->saveState());
|
Settings->setValue("Splitter", ui.msgSplitter->saveState());
|
||||||
Settings->setValue("Splitter2", ui.msgSplitter_2->saveState());
|
Settings->setValue("Splitter2", ui.msgSplitter_2->saveState());
|
||||||
@ -417,7 +437,7 @@ void MessagesDialog::processSettings(bool bLoad)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STATIC_MSGID
|
#ifdef STATIC_MSGID
|
||||||
static void getMessageTags (RSettings *pConfig, QString &msgId, QList<int> &tagIds)
|
static void getMessageTags (RSettings *pConfig, QString msgId, QList<int> &tagIds)
|
||||||
{
|
{
|
||||||
pConfig->beginGroup(CONFIG_SECTION_TAG);
|
pConfig->beginGroup(CONFIG_SECTION_TAG);
|
||||||
|
|
||||||
@ -568,19 +588,21 @@ void MessagesDialog::setTagItems(std::map<int, TagItem> &Items)
|
|||||||
|
|
||||||
m_pConfig->endGroup();
|
m_pConfig->endGroup();
|
||||||
|
|
||||||
createTagMenu();
|
fillTags();
|
||||||
insertMessages();
|
insertMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesDialog::createTagMenu()
|
void MessagesDialog::fillTags()
|
||||||
{
|
{
|
||||||
|
std::map<int, TagItem> TagItems;
|
||||||
|
std::map<int, TagItem>::iterator Item;
|
||||||
|
getTagItems(TagItems);
|
||||||
|
|
||||||
|
// create tag menu
|
||||||
QMenu *pMenu = new MyMenu (tr("Tag"), this);
|
QMenu *pMenu = new MyMenu (tr("Tag"), this);
|
||||||
connect(pMenu, SIGNAL(triggered (QAction*)), this, SLOT(tagTriggered(QAction*)));
|
connect(pMenu, SIGNAL(triggered (QAction*)), this, SLOT(tagTriggered(QAction*)));
|
||||||
connect(pMenu, SIGNAL(aboutToShow()), this, SLOT(tagAboutToShow()));
|
connect(pMenu, SIGNAL(aboutToShow()), this, SLOT(tagAboutToShow()));
|
||||||
|
|
||||||
std::map<int, TagItem> TagItems;
|
|
||||||
getTagItems(TagItems);
|
|
||||||
|
|
||||||
bool bUser = false;
|
bool bUser = false;
|
||||||
|
|
||||||
QAction *pAction;
|
QAction *pAction;
|
||||||
@ -596,7 +618,6 @@ void MessagesDialog::createTagMenu()
|
|||||||
|
|
||||||
pMenu->addSeparator();
|
pMenu->addSeparator();
|
||||||
|
|
||||||
std::map<int, TagItem>::iterator Item;
|
|
||||||
for (Item = TagItems.begin(); Item != TagItems.end(); Item++) {
|
for (Item = TagItems.begin(); Item != TagItems.end(); Item++) {
|
||||||
pAction = new QAction(Item->second.text, pMenu);
|
pAction = new QAction(Item->second.text, pMenu);
|
||||||
Values [ACTION_TAGSINDEX_TYPE] = ACTION_TAGS_TAG;
|
Values [ACTION_TAGSINDEX_TYPE] = ACTION_TAGS_TAG;
|
||||||
@ -624,6 +645,38 @@ void MessagesDialog::createTagMenu()
|
|||||||
pMenu->addAction(pAction);
|
pMenu->addAction(pAction);
|
||||||
|
|
||||||
ui.tagButton->setMenu(pMenu);
|
ui.tagButton->setMenu(pMenu);
|
||||||
|
|
||||||
|
// fill tags
|
||||||
|
m_bInChange = true;
|
||||||
|
|
||||||
|
// save current selection
|
||||||
|
QListWidgetItem *pItem = ui.tagWidget->currentItem();
|
||||||
|
int nSelectecTagId = 0;
|
||||||
|
if (pItem) {
|
||||||
|
nSelectecTagId = pItem->data(Qt::UserRole).toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
QListWidgetItem *pItemToSelect = NULL;
|
||||||
|
|
||||||
|
ui.tagWidget->clear();
|
||||||
|
for (Item = TagItems.begin(); Item != TagItems.end(); Item++) {
|
||||||
|
pItem = new QListWidgetItem (Item->second.text, ui.tagWidget);
|
||||||
|
pItem->setForeground(QBrush(QColor(Item->second.color)));
|
||||||
|
pItem->setData(Qt::UserRole, Item->first);
|
||||||
|
pItem->setData(Qt::UserRole + 1, Item->second.text); // for updateMessageSummaryList
|
||||||
|
|
||||||
|
if (Item->first == nSelectecTagId) {
|
||||||
|
pItemToSelect = pItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pItemToSelect) {
|
||||||
|
ui.tagWidget->setCurrentItem(pItemToSelect);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_bInChange = false;
|
||||||
|
|
||||||
|
updateMessageSummaryList();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1067,12 +1120,46 @@ void MessagesDialog::getallrecommended()
|
|||||||
|
|
||||||
void MessagesDialog::changeBox(int)
|
void MessagesDialog::changeBox(int)
|
||||||
{
|
{
|
||||||
|
if (m_bInChange) {
|
||||||
|
// already in change method
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_bInChange = true;
|
||||||
|
|
||||||
MessagesModel->removeRows (0, MessagesModel->rowCount());
|
MessagesModel->removeRows (0, MessagesModel->rowCount());
|
||||||
|
|
||||||
|
ui.tagWidget->setCurrentItem(NULL);
|
||||||
|
m_eListMode = LIST_BOX;
|
||||||
|
|
||||||
insertMessages();
|
insertMessages();
|
||||||
insertMsgTxtAndFiles();
|
insertMsgTxtAndFiles();
|
||||||
|
|
||||||
|
m_bInChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
void MessagesDialog::changeTag(int)
|
||||||
|
{
|
||||||
|
if (m_bInChange) {
|
||||||
|
// already in change method
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_bInChange = true;
|
||||||
|
|
||||||
|
MessagesModel->removeRows (0, MessagesModel->rowCount());
|
||||||
|
|
||||||
|
ui.listWidget->setCurrentItem(NULL);
|
||||||
|
m_eListMode = LIST_TAG;
|
||||||
|
|
||||||
|
insertMessages();
|
||||||
|
insertMsgTxtAndFiles();
|
||||||
|
|
||||||
|
m_bInChange = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void InitIconAndFont(RSettings *pConfig, QStandardItem *pItem [COLUMN_COUNT], int nFlag)
|
static void InitIconAndFont(RSettings *pConfig, QStandardItem *pItem [COLUMN_COUNT], int nFlag)
|
||||||
{
|
{
|
||||||
QString sText = pItem [COLUMN_SUBJECT]->text();
|
QString sText = pItem [COLUMN_SUBJECT]->text();
|
||||||
@ -1137,10 +1224,7 @@ void MessagesDialog::insertMessages()
|
|||||||
|
|
||||||
rsMsgs -> getMessageSummaries(msgList);
|
rsMsgs -> getMessageSummaries(msgList);
|
||||||
|
|
||||||
int listrow = ui.listWidget -> currentRow();
|
|
||||||
|
|
||||||
std::cerr << "MessagesDialog::insertMessages()" << std::endl;
|
std::cerr << "MessagesDialog::insertMessages()" << std::endl;
|
||||||
std::cerr << "Current Row: " << listrow << std::endl;
|
|
||||||
fflush(0);
|
fflush(0);
|
||||||
|
|
||||||
int nFilterColumn = FilterColumnFromComboBox(ui.filterColumnComboBox->currentIndex());
|
int nFilterColumn = FilterColumnFromComboBox(ui.filterColumnComboBox->currentIndex());
|
||||||
@ -1149,23 +1233,54 @@ void MessagesDialog::insertMessages()
|
|||||||
unsigned int msgbox = 0;
|
unsigned int msgbox = 0;
|
||||||
bool bTrash = false;
|
bool bTrash = false;
|
||||||
bool bFill = true;
|
bool bFill = true;
|
||||||
switch(listrow)
|
#ifdef STATIC_MSGID
|
||||||
{
|
int nTagId = 0;
|
||||||
case ROW_INBOX:
|
#endif
|
||||||
msgbox = RS_MSG_INBOX;
|
|
||||||
|
switch (m_eListMode) {
|
||||||
|
case LIST_NOTHING:
|
||||||
|
bFill = false;
|
||||||
break;
|
break;
|
||||||
case ROW_OUTBOX:
|
|
||||||
msgbox = RS_MSG_OUTBOX;
|
case LIST_BOX:
|
||||||
|
{
|
||||||
|
int listrow = ui.listWidget->currentRow();
|
||||||
|
|
||||||
|
switch (listrow) {
|
||||||
|
case ROW_INBOX:
|
||||||
|
msgbox = RS_MSG_INBOX;
|
||||||
|
break;
|
||||||
|
case ROW_OUTBOX:
|
||||||
|
msgbox = RS_MSG_OUTBOX;
|
||||||
|
break;
|
||||||
|
case ROW_DRAFTBOX:
|
||||||
|
msgbox = RS_MSG_DRAFTBOX;
|
||||||
|
break;
|
||||||
|
case ROW_SENTBOX:
|
||||||
|
msgbox = RS_MSG_SENTBOX;
|
||||||
|
break;
|
||||||
|
case ROW_TRASHBOX:
|
||||||
|
bTrash = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
bFill = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ROW_DRAFTBOX:
|
|
||||||
msgbox = RS_MSG_DRAFTBOX;
|
#ifdef STATIC_MSGID
|
||||||
break;
|
case LIST_TAG:
|
||||||
case ROW_SENTBOX:
|
{
|
||||||
msgbox = RS_MSG_SENTBOX;
|
QListWidgetItem *pItem = ui.tagWidget->currentItem();
|
||||||
break;
|
if (pItem) {
|
||||||
case ROW_TRASHBOX:
|
nTagId = pItem->data (Qt::UserRole).toInt();
|
||||||
bTrash = true;
|
} else {
|
||||||
|
bFill = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bFill = false;
|
bFill = false;
|
||||||
}
|
}
|
||||||
@ -1182,11 +1297,10 @@ void MessagesDialog::insertMessages()
|
|||||||
getTagItems(TagItems);
|
getTagItems(TagItems);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* remove old items */
|
/* search messages */
|
||||||
int nRowCount = MessagesModel->rowCount();
|
std::list<MsgInfoSummary> msgToShow;
|
||||||
int nRow = 0;
|
for(it = msgList.begin(); it != msgList.end(); it++) {
|
||||||
for (nRow = 0; nRow < nRowCount; ) {
|
if (m_eListMode == LIST_BOX) {
|
||||||
for(it = msgList.begin(); it != msgList.end(); it++) {
|
|
||||||
if (bTrash) {
|
if (bTrash) {
|
||||||
if ((it->msgflags & RS_MSG_TRASH) == 0) {
|
if ((it->msgflags & RS_MSG_TRASH) == 0) {
|
||||||
continue;
|
continue;
|
||||||
@ -1199,13 +1313,33 @@ void MessagesDialog::insertMessages()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
} else if (m_eListMode == LIST_TAG) {
|
||||||
|
QList<int> tagIds;
|
||||||
|
getMessageTags (m_pConfig, QString::fromStdString(it->msgId), tagIds);
|
||||||
|
if (qFind(tagIds.begin(), tagIds.end(), nTagId) == tagIds.end()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (it->msgId == MessagesModel->item(nRow, COLUMN_MSGID)->text().toStdString()) {
|
msgToShow.push_back(*it);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* remove old items */
|
||||||
|
int nRowCount = MessagesModel->rowCount();
|
||||||
|
int nRow = 0;
|
||||||
|
for (nRow = 0; nRow < nRowCount; ) {
|
||||||
|
std::string msgIdFromRow = MessagesModel->item(nRow, COLUMN_MSGID)->text().toStdString();
|
||||||
|
for(it = msgToShow.begin(); it != msgToShow.end(); it++) {
|
||||||
|
if (it->msgId == msgIdFromRow) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it == msgList.end ()) {
|
if (it == msgToShow.end ()) {
|
||||||
MessagesModel->removeRow (nRow);
|
MessagesModel->removeRow (nRow);
|
||||||
nRowCount = MessagesModel->rowCount();
|
nRowCount = MessagesModel->rowCount();
|
||||||
} else {
|
} else {
|
||||||
@ -1213,7 +1347,7 @@ void MessagesDialog::insertMessages()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(it = msgList.begin(); it != msgList.end(); it++)
|
for(it = msgToShow.begin(); it != msgToShow.end(); it++)
|
||||||
{
|
{
|
||||||
/* check the message flags, to decide which
|
/* check the message flags, to decide which
|
||||||
* group it should go in...
|
* group it should go in...
|
||||||
@ -1233,19 +1367,6 @@ void MessagesDialog::insertMessages()
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (bTrash) {
|
|
||||||
if ((it->msgflags & RS_MSG_TRASH) == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (it->msgflags & RS_MSG_TRASH) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((it->msgflags & RS_MSG_BOXMASK) != msgbox) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bGotInfo = false;
|
bGotInfo = false;
|
||||||
msgInfo = MessageInfo(); // clear
|
msgInfo = MessageInfo(); // clear
|
||||||
|
|
||||||
@ -1438,6 +1559,7 @@ void MessagesDialog::insertMessages()
|
|||||||
ui.messagestreeView->hideColumn(COLUMN_SRCID);
|
ui.messagestreeView->hideColumn(COLUMN_SRCID);
|
||||||
ui.messagestreeView->hideColumn(COLUMN_MSGID);
|
ui.messagestreeView->hideColumn(COLUMN_MSGID);
|
||||||
ui.messagestreeView->hideColumn(COLUMN_CONTENT);
|
ui.messagestreeView->hideColumn(COLUMN_CONTENT);
|
||||||
|
|
||||||
updateMessageSummaryList();
|
updateMessageSummaryList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2044,8 +2166,24 @@ void MessagesDialog::updateMessageSummaryList()
|
|||||||
|
|
||||||
rsMsgs->getMessageSummaries(msgList);
|
rsMsgs->getMessageSummaries(msgList);
|
||||||
|
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
QMap<int, int> tagCount;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*calculating the new messages*/
|
/*calculating the new messages*/
|
||||||
for (it = msgList.begin(); it != msgList.end(); it++) {
|
for (it = msgList.begin(); it != msgList.end(); it++) {
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
/* calcluate tag count */
|
||||||
|
QList<int> tagIds;
|
||||||
|
getMessageTags (m_pConfig, QString::fromStdString(it->msgId), tagIds);
|
||||||
|
for (QList<int>::iterator tagId = tagIds.begin(); tagId != tagIds.end(); tagId++) {
|
||||||
|
int nCount = tagCount [*tagId];
|
||||||
|
nCount++;
|
||||||
|
tagCount [*tagId] = nCount;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* calculate box */
|
||||||
if (it->msgflags & RS_MSG_TRASH) {
|
if (it->msgflags & RS_MSG_TRASH) {
|
||||||
trashboxCount++;
|
trashboxCount++;
|
||||||
continue;
|
continue;
|
||||||
@ -2086,7 +2224,7 @@ void MessagesDialog::updateMessageSummaryList()
|
|||||||
QListWidgetItem* item = ui.listWidget->item(ROW_INBOX);
|
QListWidgetItem* item = ui.listWidget->item(ROW_INBOX);
|
||||||
if (newInboxCount != 0)
|
if (newInboxCount != 0)
|
||||||
{
|
{
|
||||||
textItem = tr("Inbox") + " " + "(" + QString::number(newInboxCount)+")";
|
textItem = tr("Inbox") + " (" + QString::number(newInboxCount)+")";
|
||||||
item->setText(textItem);
|
item->setText(textItem);
|
||||||
QFont qf = item->font();
|
QFont qf = item->font();
|
||||||
qf.setBold(true);
|
qf.setBold(true);
|
||||||
@ -2109,7 +2247,7 @@ void MessagesDialog::updateMessageSummaryList()
|
|||||||
item = ui.listWidget->item(ROW_OUTBOX);
|
item = ui.listWidget->item(ROW_OUTBOX);
|
||||||
if (newOutboxCount != 0)
|
if (newOutboxCount != 0)
|
||||||
{
|
{
|
||||||
textItem = tr("Outbox") + " " + "(" + QString::number(newOutboxCount)+")";
|
textItem = tr("Outbox") + " (" + QString::number(newOutboxCount)+")";
|
||||||
item->setText(textItem);
|
item->setText(textItem);
|
||||||
QFont qf = item->font();
|
QFont qf = item->font();
|
||||||
qf.setBold(true);
|
qf.setBold(true);
|
||||||
@ -2129,7 +2267,7 @@ void MessagesDialog::updateMessageSummaryList()
|
|||||||
item = ui.listWidget->item(ROW_DRAFTBOX);
|
item = ui.listWidget->item(ROW_DRAFTBOX);
|
||||||
if (newDraftCount != 0)
|
if (newDraftCount != 0)
|
||||||
{
|
{
|
||||||
textItem = tr("Drafts") + " " + "(" + QString::number(newDraftCount)+")";
|
textItem = tr("Drafts") + " (" + QString::number(newDraftCount)+")";
|
||||||
item->setText(textItem);
|
item->setText(textItem);
|
||||||
QFont qf = item->font();
|
QFont qf = item->font();
|
||||||
qf.setBold(true);
|
qf.setBold(true);
|
||||||
@ -2148,7 +2286,7 @@ void MessagesDialog::updateMessageSummaryList()
|
|||||||
item = ui.listWidget->item(ROW_TRASHBOX);
|
item = ui.listWidget->item(ROW_TRASHBOX);
|
||||||
if (trashboxCount != 0)
|
if (trashboxCount != 0)
|
||||||
{
|
{
|
||||||
textItem = tr("Trash") + " " + "(" + QString::number(trashboxCount)+")";
|
textItem = tr("Trash") + " (" + QString::number(trashboxCount)+")";
|
||||||
item->setText(textItem);
|
item->setText(textItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2164,6 +2302,22 @@ void MessagesDialog::updateMessageSummaryList()
|
|||||||
/* Total Sent */
|
/* Total Sent */
|
||||||
textItem = tr("Total Sent:") + " " + QString::number(newSentboxCount);
|
textItem = tr("Total Sent:") + " " + QString::number(newSentboxCount);
|
||||||
ui.totalSentbox_label->setText(textItem);
|
ui.totalSentbox_label->setText(textItem);
|
||||||
|
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
/* set tag counts */
|
||||||
|
int nRowCount = ui.tagWidget->count();
|
||||||
|
for (int nRow = 0; nRow < nRowCount; nRow++) {
|
||||||
|
QListWidgetItem *pItem = ui.tagWidget->item(nRow);
|
||||||
|
int nCount = tagCount[pItem->data(Qt::UserRole).toInt()];
|
||||||
|
|
||||||
|
QString sText = pItem->data(Qt::UserRole + 1).toString();
|
||||||
|
if (nCount) {
|
||||||
|
sText += " (" + QString::number(nCount) + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
pItem->setText(sText);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** clear Filter **/
|
/** clear Filter **/
|
||||||
@ -2270,7 +2424,7 @@ void MessagesDialog::tagTriggered(QAction *pAction)
|
|||||||
QList<int> tagIds;
|
QList<int> tagIds;
|
||||||
getMessageTags(m_pConfig, msgId, tagIds);
|
getMessageTags(m_pConfig, msgId, tagIds);
|
||||||
|
|
||||||
QList<int>::iterator tagId = qFind(tagIds.begin(), tagIds.end(), pAction->data().toInt());
|
QList<int>::iterator tagId = qFind(tagIds.begin(), tagIds.end(), nId);
|
||||||
|
|
||||||
bool bSaveAndRefresh = false;
|
bool bSaveAndRefresh = false;
|
||||||
if (bSet) {
|
if (bSet) {
|
||||||
|
@ -70,6 +70,9 @@ private slots:
|
|||||||
void msgfilelistWidgetCostumPopupMenu(QPoint);
|
void msgfilelistWidgetCostumPopupMenu(QPoint);
|
||||||
|
|
||||||
void changeBox( int newrow );
|
void changeBox( int newrow );
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
void changeTag( int newrow );
|
||||||
|
#endif
|
||||||
void updateCurrentMessage();
|
void updateCurrentMessage();
|
||||||
void currentChanged(const QModelIndex&);
|
void currentChanged(const QModelIndex&);
|
||||||
void clicked(const QModelIndex&);
|
void clicked(const QModelIndex&);
|
||||||
@ -139,9 +142,17 @@ private:
|
|||||||
|
|
||||||
void setToolbarButtonStyle(Qt::ToolButtonStyle style);
|
void setToolbarButtonStyle(Qt::ToolButtonStyle style);
|
||||||
#ifdef STATIC_MSGID
|
#ifdef STATIC_MSGID
|
||||||
void createTagMenu();
|
void fillTags();
|
||||||
#endif
|
#endif
|
||||||
bool m_bProcessSettings;
|
bool m_bProcessSettings;
|
||||||
|
bool m_bInChange;
|
||||||
|
|
||||||
|
enum { LIST_NOTHING,
|
||||||
|
LIST_BOX,
|
||||||
|
#ifdef STATIC_MSGID
|
||||||
|
LIST_TAG
|
||||||
|
#endif
|
||||||
|
} m_eListMode;
|
||||||
|
|
||||||
std::string mCurrCertId;
|
std::string mCurrCertId;
|
||||||
std::string mCurrMsgId;
|
std::string mCurrMsgId;
|
||||||
|
Loading…
Reference in New Issue
Block a user