disabled the new read/unread state in MessagesDialog

reason: the member msgId is not static yet

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2996 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-05-25 12:05:14 +00:00
parent 097caf6e98
commit 12af62d54f

View File

@ -33,6 +33,9 @@
#include <QtGui> #include <QtGui>
// Thunder: need a static msgId
//#define STATIC_MSGID
/* Images for context menu icons */ /* Images for context menu icons */
#define IMAGE_MESSAGE ":/images/folder-draft.png" #define IMAGE_MESSAGE ":/images/folder-draft.png"
#define IMAGE_MESSAGEREPLY ":/images/mail_reply.png" #define IMAGE_MESSAGEREPLY ":/images/mail_reply.png"
@ -423,6 +426,7 @@ void MessagesDialog::messageslistWidgetCostumPopupMenu( QPoint point )
contextMnu.addAction( ui.actionPrint); contextMnu.addAction( ui.actionPrint);
contextMnu.addSeparator(); contextMnu.addSeparator();
#ifdef STATIC_MSGID
markAsRead = new QAction(QIcon(":/images/message-mail-read.png"), tr( "Mark as read" ), this); markAsRead = new QAction(QIcon(":/images/message-mail-read.png"), tr( "Mark as read" ), this);
connect(markAsRead , SIGNAL(triggered()), this, SLOT(markAsRead())); connect(markAsRead , SIGNAL(triggered()), this, SLOT(markAsRead()));
contextMnu.addAction(markAsRead); contextMnu.addAction(markAsRead);
@ -438,6 +442,7 @@ void MessagesDialog::messageslistWidgetCostumPopupMenu( QPoint point )
} }
contextMnu.addSeparator(); contextMnu.addSeparator();
#endif
newmsgAct = new QAction(QIcon(IMAGE_MESSAGE), tr( "New Message" ), this ); newmsgAct = new QAction(QIcon(IMAGE_MESSAGE), tr( "New Message" ), this );
connect( newmsgAct , SIGNAL( triggered() ), this, SLOT( newmessage() ) ); connect( newmsgAct , SIGNAL( triggered() ), this, SLOT( newmessage() ) );
@ -787,6 +792,7 @@ static void InitIconAndFont(RSettings *pConfig, QStandardItem *pItem [COLUMN_COU
} }
} }
#ifdef STATIC_MSGID
// show the locale "New" state // show the locale "New" state
if (bNew == false) { if (bNew == false) {
// check locale config // check locale config
@ -800,6 +806,7 @@ static void InitIconAndFont(RSettings *pConfig, QStandardItem *pItem [COLUMN_COU
} else { } else {
pItem[COLUMN_READ]->setIcon(QIcon(":/images/message-mail-state-read.png")); pItem[COLUMN_READ]->setIcon(QIcon(":/images/message-mail-state-read.png"));
} }
#endif
// set font // set font
for (int i = 0; i < COLUMN_COUNT; i++) { for (int i = 0; i < COLUMN_COUNT; i++) {
@ -1058,7 +1065,11 @@ void MessagesDialog::insertMessages()
ui.messagestreeView->showColumn(COLUMN_ATTACHEMENTS); ui.messagestreeView->showColumn(COLUMN_ATTACHEMENTS);
ui.messagestreeView->showColumn(COLUMN_SUBJECT); ui.messagestreeView->showColumn(COLUMN_SUBJECT);
#ifdef STATIC_MSGID
ui.messagestreeView->showColumn(COLUMN_READ); ui.messagestreeView->showColumn(COLUMN_READ);
#else
ui.messagestreeView->hideColumn(COLUMN_READ);
#endif
ui.messagestreeView->showColumn(COLUMN_FROM); ui.messagestreeView->showColumn(COLUMN_FROM);
ui.messagestreeView->showColumn(COLUMN_DATE); ui.messagestreeView->showColumn(COLUMN_DATE);
ui.messagestreeView->hideColumn(COLUMN_SRCID); ui.messagestreeView->hideColumn(COLUMN_SRCID);
@ -1154,12 +1165,16 @@ void MessagesDialog::setMsgAsReadUnread(const QList<int> &Rows, bool bRead)
m_pConfig->beginGroup(CONFIG_SECTION_UNREAD); m_pConfig->beginGroup(CONFIG_SECTION_UNREAD);
if (bRead) { if (bRead) {
// set as read in config // set as read in config
#ifdef STATIC_MSGID
m_pConfig->setValue(mid, false); m_pConfig->setValue(mid, false);
#endif
// set message to read // set message to read
rsMsgs->MessageRead(mid.toStdString()); rsMsgs->MessageRead(mid.toStdString());
} else { } else {
// set as unread in config // set as unread in config
#ifdef STATIC_MSGID
m_pConfig->setValue(mid, true); m_pConfig->setValue(mid, true);
#endif
} }
m_pConfig->endGroup(); m_pConfig->endGroup();
@ -1715,11 +1730,13 @@ void MessagesDialog::updateMessageSummaryList()
newInboxCount++; newInboxCount++;
} else { } else {
// check locale config // check locale config
#ifdef STATIC_MSGID
m_pConfig->beginGroup(CONFIG_SECTION_UNREAD); m_pConfig->beginGroup(CONFIG_SECTION_UNREAD);
if (m_pConfig->value(QString::fromStdString(it->msgId), false).toBool()) { if (m_pConfig->value(QString::fromStdString(it->msgId), false).toBool()) {
newInboxCount++; newInboxCount++;
} }
m_pConfig->endGroup(); m_pConfig->endGroup();
#endif
} }
break; break;
case RS_MSG_OUTBOX: case RS_MSG_OUTBOX: