mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 18:56:23 -04:00
Merge branch 'master' of https://github.com/RetroShare/RetroShare
This commit is contained in:
commit
cc4be39025
16 changed files with 306 additions and 343 deletions
|
@ -79,7 +79,7 @@
|
|||
|
||||
/** Constructor */
|
||||
WikiDialog::WikiDialog(QWidget *parent)
|
||||
: MainPage(parent)
|
||||
: RsGxsUpdateBroadcastPage(rsWiki, parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
@ -103,11 +103,6 @@ WikiDialog::WikiDialog(QWidget *parent)
|
|||
connect(ui.groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupListCustomPopupMenu(QPoint)));
|
||||
connect(ui.groupTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(wikiGroupChanged(QString)));
|
||||
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
|
||||
timer->start(1000);
|
||||
|
||||
/* setup TokenQueue */
|
||||
mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);
|
||||
|
||||
|
@ -118,8 +113,6 @@ WikiDialog::WikiDialog(QWidget *parent)
|
|||
mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(IMAGE_FOLDERGREEN), false);
|
||||
mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(IMAGE_FOLDERYELLOW), false);
|
||||
|
||||
//Auto refresh seems not to work, temporary solution at start
|
||||
insertWikiGroups();
|
||||
}
|
||||
|
||||
WikiDialog::~WikiDialog()
|
||||
|
@ -127,20 +120,6 @@ WikiDialog::~WikiDialog()
|
|||
delete(mWikiQueue);
|
||||
}
|
||||
|
||||
void WikiDialog::checkUpdate()
|
||||
{
|
||||
/* update */
|
||||
if (!rsWiki)
|
||||
return;
|
||||
|
||||
if (rsWiki->updated())
|
||||
{
|
||||
insertWikiGroups();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void WikiDialog::OpenOrShowAddPageDialog()
|
||||
{
|
||||
RsGxsGroupId groupId = getSelectedGroup();
|
||||
|
@ -362,11 +341,6 @@ const RsGxsGroupId& WikiDialog::getSelectedGroup()
|
|||
/************************** Request / Response *************************/
|
||||
/*** Loading Main Index ***/
|
||||
|
||||
void WikiDialog::insertWikiGroups()
|
||||
{
|
||||
requestGroupMeta();
|
||||
}
|
||||
|
||||
void WikiDialog::requestGroupMeta()
|
||||
{
|
||||
std::cerr << "WikiDialog::requestGroupMeta()";
|
||||
|
@ -528,7 +502,7 @@ void WikiDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
|||
|
||||
#define GXSGROUP_NEWGROUPID 1
|
||||
case GXSGROUP_NEWGROUPID:
|
||||
insertWikiGroups();
|
||||
requestGroupMeta();
|
||||
break;
|
||||
default:
|
||||
std::cerr << "WikiDialog::loadRequest() ERROR: INVALID TYPE";
|
||||
|
@ -716,3 +690,20 @@ void WikiDialog::todo()
|
|||
"<li>Auto update Group trees"
|
||||
"</ul>");
|
||||
}
|
||||
|
||||
void WikiDialog::updateDisplay(bool complete)
|
||||
{
|
||||
if (complete || !getGrpIds().empty() || !getGrpIdsMeta().empty()) {
|
||||
/* Update group list */
|
||||
requestGroupMeta();
|
||||
} else {
|
||||
/* Update all groups of changed messages */
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgIds;
|
||||
getAllMsgIds(msgIds);
|
||||
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::iterator msgIt;
|
||||
for (msgIt = msgIds.begin(); msgIt != msgIds.end(); ++msgIt) {
|
||||
wikiGroupChanged(QString::fromStdString(msgIt->first.toStdString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "retroshare-gui/mainpage.h"
|
||||
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
||||
#include "ui_WikiDialog.h"
|
||||
|
||||
#include <retroshare/rswiki.h>
|
||||
|
@ -40,7 +40,7 @@
|
|||
class WikiAddDialog;
|
||||
class WikiEditDialog;
|
||||
|
||||
class WikiDialog : public MainPage, public TokenResponse
|
||||
class WikiDialog : public RsGxsUpdateBroadcastPage, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -52,12 +52,13 @@ public:
|
|||
virtual QString pageName() const { return tr("Wiki Pages") ; } //MainPage
|
||||
virtual QString helpText() const { return ""; } //MainPage
|
||||
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
public:
|
||||
virtual void updateDisplay(bool complete);
|
||||
|
||||
private slots:
|
||||
|
||||
void checkUpdate();
|
||||
void OpenOrShowAddPageDialog();
|
||||
void OpenOrShowAddGroupDialog();
|
||||
void OpenOrShowEditDialog();
|
||||
|
@ -69,8 +70,6 @@ private slots:
|
|||
void showGroupDetails();
|
||||
void editGroupDetails();
|
||||
|
||||
void insertWikiGroups();
|
||||
|
||||
// GroupTreeWidget stuff.
|
||||
void groupListCustomPopupMenu(QPoint point);
|
||||
void subscribeToGroup();
|
||||
|
|
|
@ -733,7 +733,7 @@ void WikiEditDialog::loadBaseHistory(const uint32_t &token)
|
|||
modItem->setText(WET_COL_DATE, text);
|
||||
modItem->setData(WET_COL_DATE, WET_ROLE_SORT, sort);
|
||||
}
|
||||
modItem->setId(page.mMeta.mAuthorId, WET_COL_AUTHORID);
|
||||
modItem->setId(page.mMeta.mAuthorId, WET_COL_AUTHORID, false);
|
||||
modItem->setText(WET_COL_PAGEID, QString::fromStdString(page.mMeta.mMsgId.toStdString()));
|
||||
|
||||
ui.treeWidget_History->addTopLevelItem(modItem);
|
||||
|
@ -847,7 +847,7 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token)
|
|||
modItem->setText(WET_COL_DATE, text);
|
||||
modItem->setData(WET_COL_DATE, WET_ROLE_SORT, sort);
|
||||
}
|
||||
modItem->setId(snapshot.mMeta.mAuthorId, WET_COL_AUTHORID);
|
||||
modItem->setId(snapshot.mMeta.mAuthorId, WET_COL_AUTHORID, false);
|
||||
modItem->setText(WET_COL_PAGEID, QString::fromStdString(snapshot.mMeta.mMsgId.toStdString()));
|
||||
|
||||
/* find the parent */
|
||||
|
|
|
@ -500,6 +500,10 @@ static void getNameWidget(QTreeWidget *treeWidget, QTreeWidgetItem *item, Elided
|
|||
nameLabel = new ElidedLabel(widget);
|
||||
textLabel = new ElidedLabel(widget);
|
||||
|
||||
widget->setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||
nameLabel->setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||
textLabel->setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||
|
||||
widget->setProperty("nameLabel", qVariantFromValue(nameLabel));
|
||||
widget->setProperty("textLabel", qVariantFromValue(textLabel));
|
||||
|
||||
|
|
|
@ -30,17 +30,6 @@ CONFIG += gxschannels
|
|||
CONFIG += posted
|
||||
CONFIG += gxsgui
|
||||
|
||||
# Gxs is always enabled now.
|
||||
|
||||
DEFINES += RS_ENABLE_GXS
|
||||
|
||||
unfinished {
|
||||
CONFIG += gxscircles
|
||||
CONFIG += gxsthewire
|
||||
CONFIG += gxsphotoshare
|
||||
CONFIG += wikipoos
|
||||
}
|
||||
|
||||
# Other Disabled Bits.
|
||||
#CONFIG += framecatcher
|
||||
#CONFIG += blogs
|
||||
|
@ -80,9 +69,6 @@ linux-* {
|
|||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= -lX11 -lXss
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
#LIBS *= -lglib-2.0
|
||||
LIBS *= -rdynamic -ldl
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= UBUNTU
|
||||
|
@ -199,9 +185,6 @@ win32 {
|
|||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += -L"$$LIBS_DIR/lib"
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlcipher
|
||||
|
||||
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32 -lgdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
|
@ -245,8 +228,6 @@ macx {
|
|||
LIBS += -framework CoreFoundation
|
||||
LIBS += -framework Security
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
LIBS += ../../../lib/libsqlcipher.a
|
||||
#LIBS += -lsqlite3
|
||||
|
||||
|
@ -266,7 +247,6 @@ freebsd-* {
|
|||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
}
|
||||
|
||||
|
@ -284,7 +264,6 @@ openbsd-* {
|
|||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
|
||||
LIBS *= -rdynamic
|
||||
|
@ -302,6 +281,10 @@ openbsd-* {
|
|||
DEPENDPATH += . ../../libretroshare/src/
|
||||
INCLUDEPATH += ../../libretroshare/src/
|
||||
|
||||
wikipoos {
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
}
|
||||
|
||||
# webinterface
|
||||
DEPENDPATH += ../../libresapi/src
|
||||
INCLUDEPATH += ../../libresapi/src
|
||||
|
@ -1122,7 +1105,8 @@ wikipoos {
|
|||
HEADERS += gui/WikiPoos/WikiDialog.h \
|
||||
gui/WikiPoos/WikiAddDialog.h \
|
||||
gui/WikiPoos/WikiEditDialog.h \
|
||||
|
||||
gui/gxs/WikiGroupDialog.h \
|
||||
|
||||
FORMS += gui/WikiPoos/WikiDialog.ui \
|
||||
gui/WikiPoos/WikiAddDialog.ui \
|
||||
gui/WikiPoos/WikiEditDialog.ui \
|
||||
|
@ -1130,10 +1114,10 @@ wikipoos {
|
|||
SOURCES += gui/WikiPoos/WikiDialog.cpp \
|
||||
gui/WikiPoos/WikiAddDialog.cpp \
|
||||
gui/WikiPoos/WikiEditDialog.cpp \
|
||||
|
||||
gui/gxs/WikiGroupDialog.cpp \
|
||||
|
||||
RESOURCES += gui/WikiPoos/Wiki_images.qrc
|
||||
|
||||
DEFINES *= RS_USE_WIKI
|
||||
}
|
||||
|
||||
|
||||
|
@ -1307,7 +1291,6 @@ posted {
|
|||
gxsgui {
|
||||
|
||||
HEADERS += gui/gxs/GxsGroupDialog.h \
|
||||
gui/gxs/WikiGroupDialog.h \
|
||||
gui/gxs/GxsIdDetails.h \
|
||||
gui/gxs/GxsIdChooser.h \
|
||||
gui/gxs/GxsIdLabel.h \
|
||||
|
@ -1344,7 +1327,6 @@ gxsgui {
|
|||
# gui/gxs/GxsCommentTreeWidget.ui
|
||||
|
||||
SOURCES += gui/gxs/GxsGroupDialog.cpp \
|
||||
gui/gxs/WikiGroupDialog.cpp \
|
||||
gui/gxs/GxsIdDetails.cpp \
|
||||
gui/gxs/GxsIdChooser.cpp \
|
||||
gui/gxs/GxsIdLabel.cpp \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue