mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 11:00:14 -05:00
GxsForums:
- added automatic refresh after subscribe/unsubscribe - removed some debug output - moved GxsForumsDialog.* to gui/gxsforums git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6505 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6ac95b28cd
commit
11d2701edc
@ -26,7 +26,7 @@
|
||||
#include "GxsForumThreadWidget.h"
|
||||
#include "ui_GxsForumThreadWidget.h"
|
||||
#include "GxsForumsFillThread.h"
|
||||
#include "gui/GxsForumsDialog.h"
|
||||
#include "GxsForumsDialog.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/common/RSTreeWidgetItem.h"
|
||||
#include "gui/common/RSItemDelegate.h"
|
||||
|
@ -23,14 +23,14 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "GxsForumsDialog.h"
|
||||
#include "gxsforums/GxsForumGroupDialog.h"
|
||||
#include "gxsforums/GxsForumThreadWidget.h"
|
||||
#include "GxsForumGroupDialog.h"
|
||||
#include "GxsForumThreadWidget.h"
|
||||
|
||||
#include "settings/rsharesettings.h"
|
||||
#include "RetroShareLink.h"
|
||||
#include "channels/ShareKey.h"
|
||||
#include "common/RSTreeWidget.h"
|
||||
#include "notifyqt.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/channels/ShareKey.h"
|
||||
#include "gui/common/RSTreeWidget.h"
|
||||
#include "gui/notifyqt.h"
|
||||
//#include "gui/common/UIStateHelper.h"
|
||||
|
||||
// These should be in retroshare/ folder.
|
||||
@ -51,8 +51,9 @@
|
||||
#define IMAGE_FORUMAUTHD ":/images/konv_message2.png"
|
||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||
|
||||
#define TOKEN_TYPE_LISTING 1
|
||||
//#define TOKEN_TYPE_CURRENTFORUM 2
|
||||
#define TOKEN_TYPE_LISTING 1
|
||||
#define TOKEN_TYPE_SUBSCRIBE_CHANGE 2
|
||||
//#define TOKEN_TYPE_CURRENTFORUM 3
|
||||
|
||||
/*
|
||||
* Transformation Notes:
|
||||
@ -88,8 +89,6 @@ GxsForumsDialog::GxsForumsDialog(QWidget *parent)
|
||||
connect(NotifyQt::getInstance(), SIGNAL(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
||||
|
||||
// HACK - TEMPORARY HIJACKING THIS BUTTON FOR REFRESH.
|
||||
connect(ui.refreshButton, SIGNAL(clicked()), this, SLOT(forceUpdateDisplay()));
|
||||
connect(ui.todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));
|
||||
|
||||
/* Initialize group tree */
|
||||
@ -129,7 +128,6 @@ void GxsForumsDialog::todo()
|
||||
{
|
||||
QMessageBox::information(this, "Todo",
|
||||
"<b>Open points:</b><ul>"
|
||||
"<li>Automatic refresh after subscribe/unsubscibe"
|
||||
"<li>Restore forum keys"
|
||||
"<li>Display AUTHD"
|
||||
"<li>Copy/navigate forum link"
|
||||
@ -265,16 +263,6 @@ void GxsForumsDialog::updateDisplay(bool /*initialFill*/)
|
||||
insertForums();
|
||||
}
|
||||
|
||||
// HACK until update works.
|
||||
void GxsForumsDialog::forceUpdateDisplay()
|
||||
{
|
||||
std::cerr << "GxsForumsDialog::forceUpdateDisplay()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* update Forums List */
|
||||
insertForums();
|
||||
}
|
||||
|
||||
void GxsForumsDialog::forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo)
|
||||
{
|
||||
groupItemInfo.id = QString::fromStdString(forumInfo.mGroupId);
|
||||
@ -549,6 +537,7 @@ void GxsForumsDialog::forumSubscribe(bool subscribe)
|
||||
|
||||
uint32_t token;
|
||||
rsGxsForums->subscribeToGroup(token, mForumId, subscribe);
|
||||
mForumQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE);
|
||||
}
|
||||
|
||||
void GxsForumsDialog::showForumDetails()
|
||||
@ -709,20 +698,12 @@ void GxsForumsDialog::requestGroupSummary()
|
||||
{
|
||||
// mStateHelper->setLoading(TOKEN_TYPE_LISTING, true);
|
||||
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "GxsForumsDialog::requestGroupSummary()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
std::list<uint32_t> tokens;
|
||||
mForumQueue->activeRequestTokens(TOKEN_TYPE_LISTING, tokens);
|
||||
if (!tokens.empty()) {
|
||||
std::list<uint32_t>::iterator tokenIt;
|
||||
for (tokenIt = tokens.begin(); tokenIt != tokens.end(); ++tokenIt) {
|
||||
std::cerr << "GxsForumsDialog::requestGroupSummary() Canceling Request: " << *tokenIt;
|
||||
std::cerr << std::endl;
|
||||
|
||||
mForumQueue->cancelRequest(*tokenIt);
|
||||
}
|
||||
}
|
||||
mForumQueue->cancelActiveRequestTokens(TOKEN_TYPE_LISTING);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||
@ -733,8 +714,10 @@ void GxsForumsDialog::requestGroupSummary()
|
||||
|
||||
void GxsForumsDialog::loadGroupSummary(const uint32_t &token)
|
||||
{
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "GxsForumsDialog::loadGroupSummary()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
std::list<RsGroupMetaData> groupInfo;
|
||||
rsGxsForums->getGroupSummary(token, groupInfo);
|
||||
@ -759,6 +742,22 @@ void GxsForumsDialog::loadGroupSummary(const uint32_t &token)
|
||||
/*********************** **** **** **** ***********************/
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
||||
void GxsForumsDialog::acknowledgeSubscribeChange(const uint32_t &token)
|
||||
{
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "GxsForumsDialog::acknowledgeSubscribeChange()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
RsGxsGroupId groupId;
|
||||
rsGxsForums->acknowledgeGrp(token, groupId);
|
||||
|
||||
insertForums();
|
||||
}
|
||||
|
||||
/*********************** **** **** **** ***********************/
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
||||
//void GxsForumsDialog::requestGroupSummary_CurrentForum(const std::string &forumId)
|
||||
//{
|
||||
// RsTokReqOptions opts;
|
||||
@ -802,8 +801,10 @@ void GxsForumsDialog::loadGroupSummary(const uint32_t &token)
|
||||
|
||||
void GxsForumsDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
#ifdef DEBUG_FORUMS
|
||||
std::cerr << "GxsForumsDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
if (queue == mForumQueue)
|
||||
{
|
||||
@ -814,6 +815,10 @@ void GxsForumsDialog::loadRequest(const TokenQueue *queue, const TokenRequest &r
|
||||
loadGroupSummary(req.mToken);
|
||||
break;
|
||||
|
||||
case TOKEN_TYPE_SUBSCRIBE_CHANGE:
|
||||
acknowledgeSubscribeChange(req.mToken);
|
||||
break;
|
||||
|
||||
// case TOKEN_TYPE_CURRENTFORUM:
|
||||
// loadGroupSummary_CurrentForum(req.mToken);
|
||||
// break;
|
@ -59,7 +59,6 @@ protected:
|
||||
|
||||
private slots:
|
||||
void settingsChanged();
|
||||
void forceUpdateDisplay(); // TEMP HACK FN.
|
||||
void todo();
|
||||
|
||||
/** Create the context popup menu and it's submenus */
|
||||
@ -108,6 +107,9 @@ private:
|
||||
void requestGroupSummary();
|
||||
void loadGroupSummary(const uint32_t &token);
|
||||
|
||||
// subscribe/unsubscribe ack.
|
||||
void acknowledgeSubscribeChange(const uint32_t &token);
|
||||
|
||||
GxsForumThreadWidget *forumThreadWidget(const std::string &forumId);
|
||||
GxsForumThreadWidget *createThreadWidget(const std::string &forumId);
|
||||
|
@ -97,13 +97,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="refreshButton">
|
||||
<property name="text">
|
||||
<string notr="true">Refresh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="todoPushButton">
|
||||
<property name="text">
|
||||
@ -201,18 +194,18 @@
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>RSTabWidget</class>
|
||||
<extends>QTabWidget</extends>
|
||||
<header>gui/common/RSTabWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>GroupTreeWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>gui/common/GroupTreeWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>RSTabWidget</class>
|
||||
<extends>QTabWidget</extends>
|
||||
<header>gui/common/RSTabWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="images.qrc"/>
|
@ -35,7 +35,7 @@
|
||||
#endif
|
||||
#include "gui/WikiPoos/WikiDialog.h"
|
||||
#include "gui/Posted/PostedDialog.h"
|
||||
#include "gui/GxsForumsDialog.h"
|
||||
#include "gui/gxsforums/GxsForumsDialog.h"
|
||||
#include "gui/gxschannels/ChannelDialog.h"
|
||||
|
||||
// THESE HAVE TO BE CONVERTED TO VEG FORMAT
|
||||
|
@ -1051,18 +1051,18 @@ circles {
|
||||
|
||||
|
||||
gxsforums {
|
||||
|
||||
HEADERS += gui/GxsForumsDialog.h \
|
||||
|
||||
HEADERS += gui/gxsforums/GxsForumsDialog.h \
|
||||
gui/gxsforums/GxsForumGroupDialog.h \
|
||||
gui/gxsforums/CreateGxsForumMsg.h \
|
||||
gui/gxsforums/GxsForumThreadWidget.h \
|
||||
gui/gxsforums/GxsForumsFillThread.h
|
||||
|
||||
FORMS += gui/GxsForumsDialog.ui \
|
||||
|
||||
FORMS += gui/gxsforums/GxsForumsDialog.ui \
|
||||
gui/gxsforums/CreateGxsForumMsg.ui \
|
||||
gui/gxsforums/GxsForumThreadWidget.ui
|
||||
|
||||
SOURCES += gui/GxsForumsDialog.cpp \
|
||||
|
||||
SOURCES += gui/gxsforums/GxsForumsDialog.cpp \
|
||||
gui/gxsforums/GxsForumGroupDialog.cpp \
|
||||
gui/gxsforums/CreateGxsForumMsg.cpp \
|
||||
gui/gxsforums/GxsForumThreadWidget.cpp \
|
||||
|
Loading…
x
Reference in New Issue
Block a user