improvements MessagesDialog:

- new read/unread state - stored locally
- show all recipients in Outbox, Sentbox and Draftbox


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2975 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-05-23 17:21:30 +00:00
parent 61e8d588a8
commit cef2c1218f
10 changed files with 1619 additions and 1379 deletions

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,8 @@
#include "mainpage.h" #include "mainpage.h"
#include "ui_MessagesDialog.h" #include "ui_MessagesDialog.h"
class RSettings;
class MessagesDialog : public MainPage class MessagesDialog : public MainPage
{ {
Q_OBJECT Q_OBJECT
@ -43,7 +45,6 @@ public:
/** Default Destructor */ /** Default Destructor */
~MessagesDialog(); ~MessagesDialog();
void insertMsgTxtAndFiles(QModelIndex index = QModelIndex());
// replaced by shortcut // replaced by shortcut
// virtual void keyPressEvent(QKeyEvent *) ; // virtual void keyPressEvent(QKeyEvent *) ;
void updateMessageSummaryList(); void updateMessageSummaryList();
@ -77,6 +78,9 @@ private slots:
void removemessage(); void removemessage();
void markAsRead();
void markAsUnread();
void anchorClicked (const QUrl &); void anchorClicked (const QUrl &);
void getcurrentrecommended(); void getcurrentrecommended();
@ -100,12 +104,15 @@ private:
class QStandardItemModel *MessagesModel; class QStandardItemModel *MessagesModel;
QSortFilterProxyModel *proxyModel; QSortFilterProxyModel *proxyModel;
void insertMsgTxtAndFiles(QModelIndex index = QModelIndex(), bool bSetToRead = true);
bool getCurrentMsg(std::string &cid, std::string &mid); bool getCurrentMsg(std::string &cid, std::string &mid);
void setMsgAsRead(const QModelIndex &index); void setMsgAsReadUnread(const QList<int> &Rows, bool bRead);
void setCurrentFileName(const QString &fileName); void setCurrentFileName(const QString &fileName);
int getSelectedMsgCount (); int getSelectedMsgCount (QList<int> *pRowsRead, QList<int> *pRowsUnread);
bool isMessageRead(int nRow);
/* internal handle splitter */ /* internal handle splitter */
void togglefileview_internal(); void togglefileview_internal();
@ -118,8 +125,8 @@ private:
std::string mCurrMsgId; std::string mCurrMsgId;
QString fileName; QString fileName;
QFont mFont; QFont mFont;
RSettings *m_pConfig;
// timer and index for showing message // timer and index for showing message
QTimer *timer; QTimer *timer;

View File

@ -270,6 +270,9 @@
<file>images/message-mail-forwarded-read.png</file> <file>images/message-mail-forwarded-read.png</file>
<file>images/message-mail-replied.png</file> <file>images/message-mail-replied.png</file>
<file>images/message-mail-forwarded.png</file> <file>images/message-mail-forwarded.png</file>
<file>images/message-mail-state-read.png</file>
<file>images/message-mail-state-unread.png</file>
<file>images/message-mail-state-header.png</file>
<file>images/message-news.png</file> <file>images/message-news.png</file>
<file>images/message.png</file> <file>images/message.png</file>
<file>images/messages_new.png</file> <file>images/messages_new.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

View File

@ -22,12 +22,13 @@
#include "MessagePage.h" #include "MessagePage.h"
#include "rshare.h" #include "rshare.h"
#include "rsharesettings.h"
MessagePage::MessagePage(QWidget * parent, Qt::WFlags flags) MessagePage::MessagePage(QWidget * parent, Qt::WFlags flags)
: ConfigPage(parent, flags) : ConfigPage(parent, flags)
{ {
ui.setupUi(this); ui.setupUi(this);
setAttribute(Qt::WA_QuitOnClose, false); setAttribute(Qt::WA_QuitOnClose, false);
} }
MessagePage::~MessagePage() MessagePage::~MessagePage()
@ -40,18 +41,19 @@ MessagePage::closeEvent (QCloseEvent * event)
QWidget::closeEvent(event); QWidget::closeEvent(event);
} }
/** Saves the changes on this page */ /** Saves the changes on this page */
bool bool
MessagePage::save(QString &errmsg) MessagePage::save(QString &errmsg)
{ {
return true; Settings->setMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked());
return true;
} }
/** Loads the settings for this page */ /** Loads the settings for this page */
void void
MessagePage::load() MessagePage::load()
{ {
ui.setMsgToReadOnActivate->setChecked(Settings->getMsgSetToReadOnActivate());
} }

File diff suppressed because it is too large Load Diff

View File

@ -345,3 +345,13 @@ void RshareSettings::loadWidgetInformation(QMainWindow *widget, QToolBar *toolBa
loadWidgetInformation(widget); loadWidgetInformation(widget);
} }
/* Messages */
bool RshareSettings::getMsgSetToReadOnActivate ()
{
return valueFromGroup("MessageDialog", "SetMsgToReadOnActivate", true).toBool();
}
void RshareSettings::setMsgSetToReadOnActivate (bool bValue)
{
setValueToGroup("MessageDialog", "SetMsgToReadOnActivate", bValue);
}

View File

@ -126,6 +126,10 @@ public:
//! Method overload. Restore window and toolbar information. //! Method overload. Restore window and toolbar information.
void loadWidgetInformation(QMainWindow *widget, QToolBar *toolBar); void loadWidgetInformation(QMainWindow *widget, QToolBar *toolBar);
/* Messages */
bool getMsgSetToReadOnActivate ();
void setMsgSetToReadOnActivate (bool bValue);
protected: protected:
/** Default constructor. */ /** Default constructor. */
RshareSettings(); RshareSettings();