2012-07-01 19:05:03 -04:00
|
|
|
/*
|
|
|
|
* Retroshare Posted List
|
|
|
|
*
|
|
|
|
* Copyright 2012-2012 by Robert Fernie.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License Version 2.1 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MRK_POSTED_LIST_DIALOG_H
|
|
|
|
#define MRK_POSTED_LIST_DIALOG_H
|
|
|
|
|
2012-07-27 11:41:52 -04:00
|
|
|
#include "retroshare-gui/mainpage.h"
|
2012-07-01 19:05:03 -04:00
|
|
|
#include "ui_PostedListDialog.h"
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
#include <retroshare/rsposted.h>
|
2012-07-01 19:05:03 -04:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "gui/Posted/PostedItem.h"
|
|
|
|
#include "gui/common/GroupTreeWidget.h"
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
#include "util/TokenQueue.h"
|
2012-07-01 19:05:03 -04:00
|
|
|
|
2012-07-27 11:41:52 -04:00
|
|
|
#include "retroshare-gui/RsAutoUpdatePage.h"
|
2012-07-01 19:05:03 -04:00
|
|
|
|
2012-10-29 18:41:41 -04:00
|
|
|
/*********************** **** **** **** ***********************/
|
|
|
|
/** Request / Response of Data ********************************/
|
|
|
|
/*********************** **** **** **** ***********************/
|
|
|
|
|
|
|
|
#define POSTEDDIALOG_LISTING 1
|
|
|
|
#define POSTEDDIALOG_CURRENTFORUM 2
|
|
|
|
#define POSTEDDIALOG_INSERTTHREADS 3
|
|
|
|
#define POSTEDDIALOG_INSERTCHILD 4
|
|
|
|
#define POSTEDDIALOG_INSERT_POST 5
|
|
|
|
#define POSTEDDIALOG_REPLY_MESSAGE 6
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
class PostedListDialog : public RsAutoUpdatePage, public PostedHolder, public TokenResponse
|
2012-07-01 19:05:03 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PostedListDialog(QWidget *parent = 0);
|
|
|
|
|
|
|
|
virtual void deletePostedItem(PostedItem *, uint32_t ptype) { return; }
|
|
|
|
virtual void notifySelection(PostedItem *item, int ptype) { return; }
|
2012-07-31 21:47:53 -04:00
|
|
|
virtual void requestComments(std::string threadId);
|
2012-07-01 19:05:03 -04:00
|
|
|
|
2012-07-31 21:47:53 -04:00
|
|
|
signals:
|
|
|
|
void loadComments( std::string );
|
2012-07-01 19:05:03 -04:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void groupListCustomPopupMenu( QPoint /*point*/ );
|
|
|
|
void changedTopic(const QString &id);
|
|
|
|
|
2012-07-30 19:55:21 -04:00
|
|
|
void sortButtonClicked( QAbstractButton *button );
|
|
|
|
void sortButtonPressed();
|
|
|
|
|
|
|
|
void periodChanged( int index );
|
|
|
|
|
|
|
|
void newGroup();
|
|
|
|
void showGroupDetails();
|
|
|
|
void editGroupDetails();
|
2012-11-07 18:24:23 -05:00
|
|
|
void createPost();
|
2012-07-30 19:55:21 -04:00
|
|
|
|
2012-07-01 19:05:03 -04:00
|
|
|
private:
|
|
|
|
|
|
|
|
void clearPosts();
|
|
|
|
|
|
|
|
void updateDisplay();
|
|
|
|
void loadPost(const RsPostedPost &post);
|
|
|
|
|
|
|
|
void insertGroups();
|
|
|
|
void requestGroupSummary();
|
2012-10-29 18:41:41 -04:00
|
|
|
void acknowledgeGroup(const uint32_t &token);
|
2012-07-01 19:05:03 -04:00
|
|
|
void loadGroupSummary(const uint32_t &token);
|
|
|
|
|
|
|
|
void requestGroupSummary_CurrentForum(const std::string &forumId);
|
|
|
|
void loadGroupSummary_CurrentForum(const uint32_t &token);
|
|
|
|
|
|
|
|
void insertThreads();
|
|
|
|
void loadCurrentForumThreads(const std::string &forumId);
|
|
|
|
|
|
|
|
void requestGroupThreadData_InsertThreads(const std::string &forumId);
|
|
|
|
void loadGroupThreadData_InsertThreads(const uint32_t &token);
|
|
|
|
|
|
|
|
|
|
|
|
void insertGroupData(const std::list<RsGroupMetaData> &groupList);
|
|
|
|
void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo);
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
2012-07-01 19:05:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *yourTopics;
|
|
|
|
QTreeWidgetItem *subscribedTopics;
|
|
|
|
QTreeWidgetItem *popularTopics;
|
|
|
|
QTreeWidgetItem *otherTopics;
|
|
|
|
|
2012-07-30 19:55:21 -04:00
|
|
|
QAbstractButton *mSortButton;
|
|
|
|
|
2012-07-01 19:05:03 -04:00
|
|
|
bool mThreadLoading;
|
|
|
|
std::string mCurrTopicId;
|
|
|
|
|
2012-10-29 18:41:41 -04:00
|
|
|
QMap<RsGxsGroupId, RsPostedGroup> mGroups;
|
2012-10-21 15:45:35 -04:00
|
|
|
TokenQueue *mPostedQueue;
|
2012-07-01 19:05:03 -04:00
|
|
|
|
|
|
|
/* UI - from Designer */
|
|
|
|
Ui::PostedListDialog ui;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|