mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04: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
6 changed files with 55 additions and 55 deletions
|
@ -26,7 +26,7 @@
|
||||||
#include "GxsForumThreadWidget.h"
|
#include "GxsForumThreadWidget.h"
|
||||||
#include "ui_GxsForumThreadWidget.h"
|
#include "ui_GxsForumThreadWidget.h"
|
||||||
#include "GxsForumsFillThread.h"
|
#include "GxsForumsFillThread.h"
|
||||||
#include "gui/GxsForumsDialog.h"
|
#include "GxsForumsDialog.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "gui/common/RSTreeWidgetItem.h"
|
#include "gui/common/RSTreeWidgetItem.h"
|
||||||
#include "gui/common/RSItemDelegate.h"
|
#include "gui/common/RSItemDelegate.h"
|
||||||
|
|
|
@ -23,14 +23,14 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "GxsForumsDialog.h"
|
#include "GxsForumsDialog.h"
|
||||||
#include "gxsforums/GxsForumGroupDialog.h"
|
#include "GxsForumGroupDialog.h"
|
||||||
#include "gxsforums/GxsForumThreadWidget.h"
|
#include "GxsForumThreadWidget.h"
|
||||||
|
|
||||||
#include "settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "channels/ShareKey.h"
|
#include "gui/channels/ShareKey.h"
|
||||||
#include "common/RSTreeWidget.h"
|
#include "gui/common/RSTreeWidget.h"
|
||||||
#include "notifyqt.h"
|
#include "gui/notifyqt.h"
|
||||||
//#include "gui/common/UIStateHelper.h"
|
//#include "gui/common/UIStateHelper.h"
|
||||||
|
|
||||||
// These should be in retroshare/ folder.
|
// These should be in retroshare/ folder.
|
||||||
|
@ -52,7 +52,8 @@
|
||||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||||
|
|
||||||
#define TOKEN_TYPE_LISTING 1
|
#define TOKEN_TYPE_LISTING 1
|
||||||
//#define TOKEN_TYPE_CURRENTFORUM 2
|
#define TOKEN_TYPE_SUBSCRIBE_CHANGE 2
|
||||||
|
//#define TOKEN_TYPE_CURRENTFORUM 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Transformation Notes:
|
* 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(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int)));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
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()));
|
connect(ui.todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));
|
||||||
|
|
||||||
/* Initialize group tree */
|
/* Initialize group tree */
|
||||||
|
@ -129,7 +128,6 @@ void GxsForumsDialog::todo()
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, "Todo",
|
QMessageBox::information(this, "Todo",
|
||||||
"<b>Open points:</b><ul>"
|
"<b>Open points:</b><ul>"
|
||||||
"<li>Automatic refresh after subscribe/unsubscibe"
|
|
||||||
"<li>Restore forum keys"
|
"<li>Restore forum keys"
|
||||||
"<li>Display AUTHD"
|
"<li>Display AUTHD"
|
||||||
"<li>Copy/navigate forum link"
|
"<li>Copy/navigate forum link"
|
||||||
|
@ -265,16 +263,6 @@ void GxsForumsDialog::updateDisplay(bool /*initialFill*/)
|
||||||
insertForums();
|
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)
|
void GxsForumsDialog::forumInfoToGroupItemInfo(const RsGroupMetaData &forumInfo, GroupItemInfo &groupItemInfo)
|
||||||
{
|
{
|
||||||
groupItemInfo.id = QString::fromStdString(forumInfo.mGroupId);
|
groupItemInfo.id = QString::fromStdString(forumInfo.mGroupId);
|
||||||
|
@ -549,6 +537,7 @@ void GxsForumsDialog::forumSubscribe(bool subscribe)
|
||||||
|
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
rsGxsForums->subscribeToGroup(token, mForumId, subscribe);
|
rsGxsForums->subscribeToGroup(token, mForumId, subscribe);
|
||||||
|
mForumQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsForumsDialog::showForumDetails()
|
void GxsForumsDialog::showForumDetails()
|
||||||
|
@ -709,20 +698,12 @@ void GxsForumsDialog::requestGroupSummary()
|
||||||
{
|
{
|
||||||
// mStateHelper->setLoading(TOKEN_TYPE_LISTING, true);
|
// mStateHelper->setLoading(TOKEN_TYPE_LISTING, true);
|
||||||
|
|
||||||
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << "GxsForumsDialog::requestGroupSummary()";
|
std::cerr << "GxsForumsDialog::requestGroupSummary()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
std::list<uint32_t> tokens;
|
mForumQueue->cancelActiveRequestTokens(TOKEN_TYPE_LISTING);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RsTokReqOptions opts;
|
RsTokReqOptions opts;
|
||||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||||
|
@ -733,8 +714,10 @@ void GxsForumsDialog::requestGroupSummary()
|
||||||
|
|
||||||
void GxsForumsDialog::loadGroupSummary(const uint32_t &token)
|
void GxsForumsDialog::loadGroupSummary(const uint32_t &token)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << "GxsForumsDialog::loadGroupSummary()";
|
std::cerr << "GxsForumsDialog::loadGroupSummary()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
std::list<RsGroupMetaData> groupInfo;
|
std::list<RsGroupMetaData> groupInfo;
|
||||||
rsGxsForums->getGroupSummary(token, 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)
|
//void GxsForumsDialog::requestGroupSummary_CurrentForum(const std::string &forumId)
|
||||||
//{
|
//{
|
||||||
// RsTokReqOptions opts;
|
// RsTokReqOptions opts;
|
||||||
|
@ -802,8 +801,10 @@ void GxsForumsDialog::loadGroupSummary(const uint32_t &token)
|
||||||
|
|
||||||
void GxsForumsDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
void GxsForumsDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << "GxsForumsDialog::loadRequest() UserType: " << req.mUserType;
|
std::cerr << "GxsForumsDialog::loadRequest() UserType: " << req.mUserType;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (queue == mForumQueue)
|
if (queue == mForumQueue)
|
||||||
{
|
{
|
||||||
|
@ -814,6 +815,10 @@ void GxsForumsDialog::loadRequest(const TokenQueue *queue, const TokenRequest &r
|
||||||
loadGroupSummary(req.mToken);
|
loadGroupSummary(req.mToken);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TOKEN_TYPE_SUBSCRIBE_CHANGE:
|
||||||
|
acknowledgeSubscribeChange(req.mToken);
|
||||||
|
break;
|
||||||
|
|
||||||
// case TOKEN_TYPE_CURRENTFORUM:
|
// case TOKEN_TYPE_CURRENTFORUM:
|
||||||
// loadGroupSummary_CurrentForum(req.mToken);
|
// loadGroupSummary_CurrentForum(req.mToken);
|
||||||
// break;
|
// break;
|
|
@ -59,7 +59,6 @@ protected:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
void forceUpdateDisplay(); // TEMP HACK FN.
|
|
||||||
void todo();
|
void todo();
|
||||||
|
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
|
@ -108,6 +107,9 @@ private:
|
||||||
void requestGroupSummary();
|
void requestGroupSummary();
|
||||||
void loadGroupSummary(const uint32_t &token);
|
void loadGroupSummary(const uint32_t &token);
|
||||||
|
|
||||||
|
// subscribe/unsubscribe ack.
|
||||||
|
void acknowledgeSubscribeChange(const uint32_t &token);
|
||||||
|
|
||||||
GxsForumThreadWidget *forumThreadWidget(const std::string &forumId);
|
GxsForumThreadWidget *forumThreadWidget(const std::string &forumId);
|
||||||
GxsForumThreadWidget *createThreadWidget(const std::string &forumId);
|
GxsForumThreadWidget *createThreadWidget(const std::string &forumId);
|
||||||
|
|
|
@ -97,13 +97,6 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="refreshButton">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">Refresh</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="todoPushButton">
|
<widget class="QPushButton" name="todoPushButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -201,18 +194,18 @@
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>RSTabWidget</class>
|
|
||||||
<extends>QTabWidget</extends>
|
|
||||||
<header>gui/common/RSTabWidget.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>GroupTreeWidget</class>
|
<class>GroupTreeWidget</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>gui/common/GroupTreeWidget.h</header>
|
<header>gui/common/GroupTreeWidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>RSTabWidget</class>
|
||||||
|
<extends>QTabWidget</extends>
|
||||||
|
<header>gui/common/RSTabWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="images.qrc"/>
|
<include location="images.qrc"/>
|
|
@ -35,7 +35,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include "gui/WikiPoos/WikiDialog.h"
|
#include "gui/WikiPoos/WikiDialog.h"
|
||||||
#include "gui/Posted/PostedDialog.h"
|
#include "gui/Posted/PostedDialog.h"
|
||||||
#include "gui/GxsForumsDialog.h"
|
#include "gui/gxsforums/GxsForumsDialog.h"
|
||||||
#include "gui/gxschannels/ChannelDialog.h"
|
#include "gui/gxschannels/ChannelDialog.h"
|
||||||
|
|
||||||
// THESE HAVE TO BE CONVERTED TO VEG FORMAT
|
// THESE HAVE TO BE CONVERTED TO VEG FORMAT
|
||||||
|
|
|
@ -1052,17 +1052,17 @@ circles {
|
||||||
|
|
||||||
gxsforums {
|
gxsforums {
|
||||||
|
|
||||||
HEADERS += gui/GxsForumsDialog.h \
|
HEADERS += gui/gxsforums/GxsForumsDialog.h \
|
||||||
gui/gxsforums/GxsForumGroupDialog.h \
|
gui/gxsforums/GxsForumGroupDialog.h \
|
||||||
gui/gxsforums/CreateGxsForumMsg.h \
|
gui/gxsforums/CreateGxsForumMsg.h \
|
||||||
gui/gxsforums/GxsForumThreadWidget.h \
|
gui/gxsforums/GxsForumThreadWidget.h \
|
||||||
gui/gxsforums/GxsForumsFillThread.h
|
gui/gxsforums/GxsForumsFillThread.h
|
||||||
|
|
||||||
FORMS += gui/GxsForumsDialog.ui \
|
FORMS += gui/gxsforums/GxsForumsDialog.ui \
|
||||||
gui/gxsforums/CreateGxsForumMsg.ui \
|
gui/gxsforums/CreateGxsForumMsg.ui \
|
||||||
gui/gxsforums/GxsForumThreadWidget.ui
|
gui/gxsforums/GxsForumThreadWidget.ui
|
||||||
|
|
||||||
SOURCES += gui/GxsForumsDialog.cpp \
|
SOURCES += gui/gxsforums/GxsForumsDialog.cpp \
|
||||||
gui/gxsforums/GxsForumGroupDialog.cpp \
|
gui/gxsforums/GxsForumGroupDialog.cpp \
|
||||||
gui/gxsforums/CreateGxsForumMsg.cpp \
|
gui/gxsforums/CreateGxsForumMsg.cpp \
|
||||||
gui/gxsforums/GxsForumThreadWidget.cpp \
|
gui/gxsforums/GxsForumThreadWidget.cpp \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue