mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-20 20:31:46 -05:00
Make wikis compile
- rsWiki->updated() doesn't exist anymore, so I ported WikiDialog to inherit from RsGxsUpdateBroadcastPage - add -lglib-2.0 to pegmarkdown.pro
This commit is contained in:
parent
2bf81be6a7
commit
ae43058520
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
WikiDialog::WikiDialog(QWidget *parent)
|
WikiDialog::WikiDialog(QWidget *parent)
|
||||||
: MainPage(parent)
|
: RsGxsUpdateBroadcastPage(rsWiki, parent)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
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(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupListCustomPopupMenu(QPoint)));
|
||||||
connect(ui.groupTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(wikiGroupChanged(QString)));
|
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 */
|
/* setup TokenQueue */
|
||||||
mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);
|
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);
|
mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(IMAGE_FOLDERGREEN), false);
|
||||||
mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(IMAGE_FOLDERYELLOW), 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()
|
WikiDialog::~WikiDialog()
|
||||||
@ -127,20 +120,6 @@ WikiDialog::~WikiDialog()
|
|||||||
delete(mWikiQueue);
|
delete(mWikiQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WikiDialog::checkUpdate()
|
|
||||||
{
|
|
||||||
/* update */
|
|
||||||
if (!rsWiki)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (rsWiki->updated())
|
|
||||||
{
|
|
||||||
insertWikiGroups();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WikiDialog::OpenOrShowAddPageDialog()
|
void WikiDialog::OpenOrShowAddPageDialog()
|
||||||
{
|
{
|
||||||
RsGxsGroupId groupId = getSelectedGroup();
|
RsGxsGroupId groupId = getSelectedGroup();
|
||||||
@ -362,11 +341,6 @@ const RsGxsGroupId& WikiDialog::getSelectedGroup()
|
|||||||
/************************** Request / Response *************************/
|
/************************** Request / Response *************************/
|
||||||
/*** Loading Main Index ***/
|
/*** Loading Main Index ***/
|
||||||
|
|
||||||
void WikiDialog::insertWikiGroups()
|
|
||||||
{
|
|
||||||
requestGroupMeta();
|
|
||||||
}
|
|
||||||
|
|
||||||
void WikiDialog::requestGroupMeta()
|
void WikiDialog::requestGroupMeta()
|
||||||
{
|
{
|
||||||
std::cerr << "WikiDialog::requestGroupMeta()";
|
std::cerr << "WikiDialog::requestGroupMeta()";
|
||||||
@ -528,7 +502,7 @@ void WikiDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
|||||||
|
|
||||||
#define GXSGROUP_NEWGROUPID 1
|
#define GXSGROUP_NEWGROUPID 1
|
||||||
case GXSGROUP_NEWGROUPID:
|
case GXSGROUP_NEWGROUPID:
|
||||||
insertWikiGroups();
|
requestGroupMeta();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
std::cerr << "WikiDialog::loadRequest() ERROR: INVALID TYPE";
|
std::cerr << "WikiDialog::loadRequest() ERROR: INVALID TYPE";
|
||||||
@ -716,3 +690,20 @@ void WikiDialog::todo()
|
|||||||
"<li>Auto update Group trees"
|
"<li>Auto update Group trees"
|
||||||
"</ul>");
|
"</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 <QMessageBox>
|
||||||
|
|
||||||
#include "retroshare-gui/mainpage.h"
|
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
||||||
#include "ui_WikiDialog.h"
|
#include "ui_WikiDialog.h"
|
||||||
|
|
||||||
#include <retroshare/rswiki.h>
|
#include <retroshare/rswiki.h>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
class WikiAddDialog;
|
class WikiAddDialog;
|
||||||
class WikiEditDialog;
|
class WikiEditDialog;
|
||||||
|
|
||||||
class WikiDialog : public MainPage, public TokenResponse
|
class WikiDialog : public RsGxsUpdateBroadcastPage, public TokenResponse
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -52,12 +52,13 @@ public:
|
|||||||
virtual QString pageName() const { return tr("Wiki Pages") ; } //MainPage
|
virtual QString pageName() const { return tr("Wiki Pages") ; } //MainPage
|
||||||
virtual QString helpText() const { return ""; } //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:
|
private slots:
|
||||||
|
|
||||||
void checkUpdate();
|
|
||||||
void OpenOrShowAddPageDialog();
|
void OpenOrShowAddPageDialog();
|
||||||
void OpenOrShowAddGroupDialog();
|
void OpenOrShowAddGroupDialog();
|
||||||
void OpenOrShowEditDialog();
|
void OpenOrShowEditDialog();
|
||||||
@ -69,8 +70,6 @@ private slots:
|
|||||||
void showGroupDetails();
|
void showGroupDetails();
|
||||||
void editGroupDetails();
|
void editGroupDetails();
|
||||||
|
|
||||||
void insertWikiGroups();
|
|
||||||
|
|
||||||
// GroupTreeWidget stuff.
|
// GroupTreeWidget stuff.
|
||||||
void groupListCustomPopupMenu(QPoint point);
|
void groupListCustomPopupMenu(QPoint point);
|
||||||
void subscribeToGroup();
|
void subscribeToGroup();
|
||||||
|
@ -733,7 +733,7 @@ void WikiEditDialog::loadBaseHistory(const uint32_t &token)
|
|||||||
modItem->setText(WET_COL_DATE, text);
|
modItem->setText(WET_COL_DATE, text);
|
||||||
modItem->setData(WET_COL_DATE, WET_ROLE_SORT, sort);
|
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()));
|
modItem->setText(WET_COL_PAGEID, QString::fromStdString(page.mMeta.mMsgId.toStdString()));
|
||||||
|
|
||||||
ui.treeWidget_History->addTopLevelItem(modItem);
|
ui.treeWidget_History->addTopLevelItem(modItem);
|
||||||
@ -847,7 +847,7 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token)
|
|||||||
modItem->setText(WET_COL_DATE, text);
|
modItem->setText(WET_COL_DATE, text);
|
||||||
modItem->setData(WET_COL_DATE, WET_ROLE_SORT, sort);
|
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()));
|
modItem->setText(WET_COL_PAGEID, QString::fromStdString(snapshot.mMeta.mMsgId.toStdString()));
|
||||||
|
|
||||||
/* find the parent */
|
/* find the parent */
|
||||||
|
@ -69,7 +69,6 @@ linux-* {
|
|||||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||||
LIBS *= -lX11 -lXss
|
LIBS *= -lX11 -lXss
|
||||||
|
|
||||||
#LIBS *= -lglib-2.0
|
|
||||||
LIBS *= -rdynamic -ldl
|
LIBS *= -rdynamic -ldl
|
||||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||||
DEFINES *= UBUNTU
|
DEFINES *= UBUNTU
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
|
CONFIG += create_prl
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
TARGET = pegmarkdown
|
TARGET = pegmarkdown
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ debug {
|
|||||||
################################# Linux ##########################################
|
################################# Linux ##########################################
|
||||||
linux-* {
|
linux-* {
|
||||||
DESTDIR = lib
|
DESTDIR = lib
|
||||||
|
LIBS *= -lglib-2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
linux-g++ {
|
linux-g++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user