mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04: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 */
|
||||
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 */
|
||||
|
@ -69,7 +69,6 @@ linux-* {
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= -lX11 -lXss
|
||||
|
||||
#LIBS *= -lglib-2.0
|
||||
LIBS *= -rdynamic -ldl
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= UBUNTU
|
||||
|
@ -1,5 +1,6 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
CONFIG += create_prl
|
||||
CONFIG -= qt
|
||||
TARGET = pegmarkdown
|
||||
|
||||
@ -15,6 +16,7 @@ debug {
|
||||
################################# Linux ##########################################
|
||||
linux-* {
|
||||
DESTDIR = lib
|
||||
LIBS *= -lglib-2.0
|
||||
}
|
||||
|
||||
linux-g++ {
|
||||
|
Loading…
Reference in New Issue
Block a user