Switched MessagesDialog from QTreeView to QTreeWidget and use GxsIdRSTreeWidgetItem to show the gxs id for a distant message.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7593 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-10-09 22:04:12 +00:00
parent 39e8028837
commit 210357ab21
3 changed files with 358 additions and 401 deletions

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@
#define IMAGE_MESSAGES ":/images/evolution.png" #define IMAGE_MESSAGES ":/images/evolution.png"
class RSTreeWidgetItemCompareRole;
class MessageWidget; class MessageWidget;
class MessagesDialog : public MainPage class MessagesDialog : public MainPage
@ -66,16 +67,16 @@ public slots:
private slots: private slots:
/** Create the context popup menu and it's submenus */ /** Create the context popup menu and it's submenus */
void messageslistWidgetCustomPopupMenu( QPoint point ); void messageTreeWidgetCustomPopupMenu(QPoint point);
void folderlistWidgetCustomPopupMenu(QPoint); void folderlistWidgetCustomPopupMenu(QPoint);
void decryptSelectedMsg() ; void decryptSelectedMsg() ;
void changeBox(int newrow); void changeBox(int newrow);
void changeQuickView(int newrow); void changeQuickView(int newrow);
void updateCurrentMessage(); void updateCurrentMessage();
void currentChanged(const QModelIndex&); void currentItemChanged(QTreeWidgetItem *item);
void clicked(const QModelIndex&); void clicked(QTreeWidgetItem *item, int column);
void doubleClicked(const QModelIndex &); void doubleClicked(QTreeWidgetItem *item, int column);
void newmessage(); void newmessage();
void openAsWindow(); void openAsWindow();
@ -103,8 +104,6 @@ private slots:
void tabChanged(int tab); void tabChanged(int tab);
void tabCloseRequested(int tab); void tabCloseRequested(int tab);
void updateInterface();
private: private:
class LockUpdate class LockUpdate
{ {
@ -119,21 +118,20 @@ private:
bool m_bUpdate; bool m_bUpdate;
}; };
class QStandardItemModel *MessagesModel; void updateInterface();
QSortFilterProxyModel *proxyModel;
void connectActions(); void connectActions();
void updateMessageSummaryList(); void updateMessageSummaryList();
void insertMsgTxtAndFiles(QModelIndex index = QModelIndex(), bool bSetToRead = true); void insertMsgTxtAndFiles(QTreeWidgetItem *item = NULL, bool bSetToRead = true);
bool getCurrentMsg(std::string &cid, std::string &mid); bool getCurrentMsg(std::string &cid, std::string &mid);
void setMsgAsReadUnread(const QList<int> &Rows, bool read); void setMsgAsReadUnread(const QList<QTreeWidgetItem *> &items, bool read);
void setMsgStar(const QList<int> &Rows, bool mark); void setMsgStar(const QList<QTreeWidgetItem *> &items, bool mark);
int getSelectedMsgCount (QList<int> *pRows, QList<int> *pRowsRead, QList<int> *pRowsUnread, QList<int> *pRowsStar); int getSelectedMsgCount (QList<QTreeWidgetItem *> *items, QList<QTreeWidgetItem *> *itemsRead, QList<QTreeWidgetItem *> *itemsUnread, QList<QTreeWidgetItem *> *itemsStar);
bool isMessageRead(int nRow); bool isMessageRead(QTreeWidgetItem *item);
bool hasMessageStar(int nRow); bool hasMessageStar(QTreeWidgetItem *item);
void processSettings(bool load); void processSettings(bool load);
@ -152,8 +150,9 @@ private:
// timer and index for showing message // timer and index for showing message
QTimer *timer; QTimer *timer;
QModelIndex timerIndex; int timerIndex;
RSTreeWidgetItemCompareRole *mMessageCompareRole;
MessageWidget *msgWidget; MessageWidget *msgWidget;
/* Color definitions (for standard see qss.default) */ /* Color definitions (for standard see qss.default) */

View File

@ -708,7 +708,7 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<widget class="RSTreeView" name="messagestreeView"> <widget class="RSTreeWidget" name="messageTreeWidget">
<property name="font"> <property name="font">
<font> <font>
<pointsize>9</pointsize> <pointsize>9</pointsize>
@ -720,12 +720,23 @@
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum> <enum>QAbstractItemView::ExtendedSelection</enum>
</property> </property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="sortingEnabled"> <property name="sortingEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="allColumnsShowFocus"> <property name="allColumnsShowFocus">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="expandsOnDoubleClick">
<bool>false</bool>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget> </widget>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout" name="msgLayout"/> <layout class="QGridLayout" name="msgLayout"/>
@ -822,9 +833,9 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>RSTreeView</class> <class>RSTreeWidget</class>
<extends>QTreeView</extends> <extends>QTreeWidget</extends>
<header>gui/common/RSTreeView.h</header> <header>gui/common/RSTreeWidget.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>