mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 02:36:23 -04:00
Added tabs to gxsforums.
Moved the thread message part from GxsForumsDialog to GxsForumThreadWidget. Added placeholder text to existing and new base classes to display for example "Loading". git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5905 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ca3ef27595
commit
25de47c6f9
13 changed files with 2946 additions and 2463 deletions
|
@ -32,47 +32,15 @@
|
|||
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
|
||||
#include "gui/gxs/GxsIdTreeWidgetItem.h"
|
||||
|
||||
class ForumInfo;
|
||||
|
||||
|
||||
/* These are all the parameters that are required for thread loading.
|
||||
* They are kept static for the load duration.
|
||||
*/
|
||||
|
||||
class GxsForumsThreadLoadParameters
|
||||
{
|
||||
public:
|
||||
std::string ForumId;
|
||||
std::string FocusMsgId;
|
||||
|
||||
uint32_t SubscribeFlags;
|
||||
int ViewType;
|
||||
uint32_t FilterColumn;
|
||||
|
||||
std::map<uint32_t, QTreeWidgetItem *> MsgTokens;
|
||||
QList<QTreeWidgetItem*> Items;
|
||||
QList<QTreeWidgetItem*> ItemToExpand;
|
||||
|
||||
bool FillComplete;
|
||||
bool FlatView;
|
||||
bool UseChildTS;
|
||||
bool ExpandNewMessages;
|
||||
};
|
||||
class RsGxsForumMsg;
|
||||
|
||||
class GxsForumsDialog : public RsAutoUpdatePage, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QColor textColorRead READ textColorRead WRITE setTextColorRead)
|
||||
Q_PROPERTY(QColor textColorUnread READ textColorUnread WRITE setTextColorUnread)
|
||||
Q_PROPERTY(QColor textColorUnreadChildren READ textColorUnreadChildren WRITE setTextColorUnreadChildren)
|
||||
Q_PROPERTY(QColor textColorNotSubscribed READ textColorNotSubscribed WRITE setTextColorNotSubscribed)
|
||||
Q_PROPERTY(QColor textColorMissing READ textColorMissing WRITE setTextColorMissing)
|
||||
|
||||
public:
|
||||
GxsForumsDialog(QWidget *parent = 0);
|
||||
~GxsForumsDialog();
|
||||
|
@ -87,56 +55,24 @@ public:
|
|||
// Callback for all Loads.
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
QColor textColorRead() const { return mTextColorRead; }
|
||||
QColor textColorUnread() const { return mTextColorUnread; }
|
||||
QColor textColorUnreadChildren() const { return mTextColorUnreadChildren; }
|
||||
QColor textColorNotSubscribed() const { return mTextColorNotSubscribed; }
|
||||
QColor textColorMissing() const { return mTextColorMissing; }
|
||||
|
||||
void setTextColorRead(QColor color) { mTextColorRead = color; }
|
||||
void setTextColorUnread(QColor color) { mTextColorUnread = color; }
|
||||
void setTextColorUnreadChildren(QColor color) { mTextColorUnreadChildren = color; }
|
||||
void setTextColorNotSubscribed(QColor color) { mTextColorNotSubscribed = color; }
|
||||
void setTextColorMissing(QColor color) { mTextColorMissing = color; }
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *ev);
|
||||
void changeEvent(QEvent *e);
|
||||
// Utility Fns.
|
||||
static QString titleFromInfo(const RsMsgMetaData &meta);
|
||||
static QString messageFromInfo(const RsGxsForumMsg &msg);
|
||||
|
||||
private slots:
|
||||
void forceUpdateDisplay(); // TEMP HACK FN.
|
||||
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void forumListCustomPopupMenu( QPoint point );
|
||||
void threadListCustomPopupMenu( QPoint point );
|
||||
|
||||
void restoreForumKeys();
|
||||
void newforum();
|
||||
|
||||
void changedForum(const QString &id);
|
||||
void changedThread();
|
||||
void clickedThread (QTreeWidgetItem *item, int column);
|
||||
void threadTabCloseRequested(int index);
|
||||
void threadTabChanged(QWidget *widget);
|
||||
|
||||
void replytomessage();
|
||||
void replyMessageData(const RsGxsForumMsg &msg);
|
||||
|
||||
//void print();
|
||||
//void printpreview();
|
||||
|
||||
//void removemessage();
|
||||
void markMsgAsRead();
|
||||
void markMsgAsReadChildren();
|
||||
void markMsgAsReadAll();
|
||||
void markMsgAsUnread();
|
||||
void markMsgAsUnreadAll();
|
||||
void markMsgAsUnreadChildren();
|
||||
void copyForumLink();
|
||||
void copyMessageLink();
|
||||
|
||||
/* handle splitter */
|
||||
void togglethreadview();
|
||||
|
||||
void createthread();
|
||||
void createmessage();
|
||||
|
||||
void subscribeToForum();
|
||||
void unsubscribeToForum();
|
||||
|
@ -144,110 +80,40 @@ private slots:
|
|||
void showForumDetails();
|
||||
void editForumDetails();
|
||||
|
||||
void previousMessage ();
|
||||
void nextMessage ();
|
||||
void nextUnreadMessage();
|
||||
void downloadAllFiles();
|
||||
|
||||
void changedViewBox();
|
||||
|
||||
void filterColumnChanged(int column);
|
||||
void filterItems(const QString &text);
|
||||
|
||||
void generateMassData();
|
||||
|
||||
void fillThreadFinished();
|
||||
void fillThreadProgress(int current, int count);
|
||||
|
||||
void shareKey();
|
||||
|
||||
private:
|
||||
void insertForums();
|
||||
void insertThreads();
|
||||
void insertPost();
|
||||
void insertPostData(const RsGxsForumMsg &msg); // Second Half.
|
||||
|
||||
// Utility Fns.
|
||||
QString titleFromInfo(const RsMsgMetaData &meta);
|
||||
QString messageFromInfo(const RsGxsForumMsg &msg);
|
||||
|
||||
void forumMsgReadStatusChanged(const QString &forumId, const QString &msgId, int status);
|
||||
int subscribeFlags(const std::string &forumId);
|
||||
|
||||
void updateMessageSummaryList(std::string forumId);
|
||||
// void forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo);
|
||||
void forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo);
|
||||
|
||||
void forumSubscribe(bool subscribe);
|
||||
void FillThreads(QList<QTreeWidgetItem *> &ThreadList, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
|
||||
void FillChildren(QTreeWidgetItem *Parent, QTreeWidgetItem *NewParent, bool bExpandNewMessages, QList<QTreeWidgetItem*> &itemToExpand);
|
||||
|
||||
int getSelectedMsgCount(QList<QTreeWidgetItem*> *pRows, QList<QTreeWidgetItem*> *pRowsRead, QList<QTreeWidgetItem*> *pRowsUnread);
|
||||
void setMsgReadStatus(QList<QTreeWidgetItem*> &Rows, bool bRead);
|
||||
void markMsgAsReadUnread(bool bRead, bool bChildren, bool bForum);
|
||||
void CalculateIconsAndFonts(QTreeWidgetItem *pItem = NULL);
|
||||
void CalculateIconsAndFonts(QTreeWidgetItem *pItem, bool &bHasReadChilddren, bool &bHasUnreadChilddren);
|
||||
|
||||
void processSettings(bool bLoad);
|
||||
void togglethreadview_internal();
|
||||
|
||||
bool filterItem(QTreeWidgetItem *pItem, const QString &text, int filterColumn);
|
||||
void processSettings(bool load);
|
||||
|
||||
// New Request/Response Loading Functions.
|
||||
void insertForumsData(const std::list<RsGroupMetaData> &forumList);
|
||||
void insertForumThreads(const RsGroupMetaData &fi);
|
||||
|
||||
void requestGroupSummary();
|
||||
void loadGroupSummary(const uint32_t &token);
|
||||
|
||||
void requestGroupSummary_CurrentForum(const std::string &forumId);
|
||||
void loadGroupSummary_CurrentForum(const uint32_t &token);
|
||||
|
||||
void loadCurrentForumThreads(const std::string &forumId);
|
||||
void requestGroupThreadData_InsertThreads(const std::string &forumId);
|
||||
void loadGroupThreadData_InsertThreads(const uint32_t &token);
|
||||
void loadForumBaseThread(const RsGxsForumMsg &msg);
|
||||
|
||||
void requestChildData_InsertThreads(uint32_t &token, const RsGxsGrpMsgIdPair &parentId);
|
||||
void loadChildData_InsertThreads(const uint32_t &token);
|
||||
void loadForumChildMsg(const RsGxsForumMsg &msg, QTreeWidgetItem *parent);
|
||||
|
||||
void requestMsgData_InsertPost(const RsGxsGrpMsgIdPair &msgId);
|
||||
void loadMsgData_InsertPost(const uint32_t &token);
|
||||
void requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &msgId);
|
||||
void loadMsgData_ReplyMessage(const uint32_t &token);
|
||||
|
||||
bool convertMsgToThreadWidget(const RsGxsForumMsg &msgInfo, bool useChildTS, uint32_t filterColumn, GxsIdTreeWidgetItem *item);
|
||||
// bool convertMsgToThreadWidget(const RsGxsForumMsg &msgInfo, std::string authorName, bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *item);
|
||||
// void requestGroupSummary_CurrentForum(const std::string &forumId);
|
||||
// void loadGroupSummary_CurrentForum(const uint32_t &token);
|
||||
|
||||
std::string mForumId;
|
||||
QMap<std::string, int> mSubscribeFlags;
|
||||
TokenQueue *mForumQueue;
|
||||
|
||||
bool m_bProcessSettings;
|
||||
bool inMsgAsReadUnread;
|
||||
|
||||
QTreeWidgetItem *yourForums;
|
||||
QTreeWidgetItem *subscribedForums;
|
||||
QTreeWidgetItem *popularForums;
|
||||
QTreeWidgetItem *otherForums;
|
||||
|
||||
RSTreeWidgetItemCompareRole *threadCompareRole;
|
||||
std::string mCurrForumId;
|
||||
std::string mCurrThreadId;
|
||||
int subscribeFlags;
|
||||
|
||||
int lastViewType;
|
||||
std::string lastForumID;
|
||||
|
||||
// New Datatypes to replace the FillThread.
|
||||
bool mThreadLoading;
|
||||
GxsForumsThreadLoadParameters mThreadLoad;
|
||||
|
||||
/* Color definitions (for standard see qss.default) */
|
||||
QColor mTextColorRead;
|
||||
QColor mTextColorUnread;
|
||||
QColor mTextColorUnreadChildren;
|
||||
QColor mTextColorNotSubscribed;
|
||||
QColor mTextColorMissing;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::GxsForumsDialog ui;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue