Merge pull request #93 from AsamK/pegmark_wiki

Disable pegmarkdown build by default, only used by disabled wiki
This commit is contained in:
Cyril Soler 2015-09-05 09:49:40 -04:00
commit cd2dce3e3e
10 changed files with 159 additions and 166 deletions

View File

@ -7,7 +7,6 @@ SUBDIRS += \
libbitdht \
libretroshare \
libresapi \
pegmarkdown \
retroshare_gui \
retroshare_nogui \
plugins
@ -22,10 +21,8 @@ libretroshare.depends = openpgpsdk libbitdht
libresapi.file = libresapi/src/libresapi.pro
libresapi.depends = libretroshare
pegmarkdown.file = supportlibs/pegmarkdown/pegmarkdown.pro
retroshare_gui.file = retroshare-gui/src/retroshare-gui.pro
retroshare_gui.depends = libretroshare libresapi pegmarkdown
retroshare_gui.depends = libretroshare libresapi
retroshare_gui.target = retroshare-gui
retroshare_nogui.file = retroshare-nogui/src/retroshare-nogui.pro
@ -35,3 +32,9 @@ retroshare_nogui.target = retroshare-nogui
plugins.file = plugins/plugins.pro
plugins.depends = retroshare_gui
plugins.target = plugins
wikipoos {
SUBDIRS += pegmarkdown
pegmarkdown.file = supportlibs/pegmarkdown/pegmarkdown.pro
retroshare_gui.depends += pegmarkdown
}

View File

@ -7,11 +7,6 @@ CONFIG -= qt
TARGET = retroshare
TARGET_PRL = libretroshare
#GXS Stuff.
# This should be disabled for releases until further notice.
CONFIG += gxs
#CONFIG += dsdv
profiling {
@ -696,8 +691,6 @@ SOURCES += zeroconf/p3zcnatassist.cc \
# new gxs cache system
# this should be disabled for releases until further notice.
gxs {
DEFINES *= RS_ENABLE_GXS
DEFINES *= SQLITE_HAS_CODEC
DEFINES *= GXS_ENABLE_SYNC_MSGS
@ -785,6 +778,7 @@ gxs {
serialiser/rsgxscommentitems.cc \
serialiser/rsgxschannelitems.cc \
wikipoos {
# Wiki Service
HEADERS += retroshare/rswiki.h \
services/p3wiki.h \
@ -792,7 +786,9 @@ gxs {
SOURCES += services/p3wiki.cc \
serialiser/rswikiitems.cc \
}
gxsthewire {
# Wire Service
HEADERS += retroshare/rswire.h \
services/p3wire.h \
@ -800,6 +796,7 @@ gxs {
SOURCES += services/p3wire.cc \
serialiser/rswireitems.cc \
}
# Posted Service
HEADERS += services/p3postbase.h \
@ -811,6 +808,7 @@ gxs {
services/p3posted.cc \
serialiser/rsposteditems.cc
gxsphotoshare {
#Photo Service
HEADERS += services/p3photoservice.h \
retroshare/rsphoto.h \
@ -858,6 +856,3 @@ test_bitdht {
# ENABLED UDP NOW.
}

View File

@ -1364,9 +1364,9 @@ int RsServer::StartupRetroShare()
RS_SERVICE_GXS_TYPE_WIKI,
NULL, rsInitConfig->gxs_passwd);
#ifdef RS_USE_WIKI
p3Wiki *mWiki = new p3Wiki(wiki_ds, NULL, mGxsIdService);
// create GXS photo service
// create GXS wiki service
RsGxsNetService* wiki_ns = new RsGxsNetService(
RS_SERVICE_GXS_TYPE_WIKI, wiki_ds, nxsMgr,
mWiki, mWiki->getServiceInfo(),
@ -1374,6 +1374,7 @@ int RsServer::StartupRetroShare()
pgpAuxUtils);
mWiki->setNetworkExchangeService(wiki_ns) ;
#endif
/**** Forum GXS service ****/
@ -1443,7 +1444,9 @@ int RsServer::StartupRetroShare()
pqih->addService(gxsid_ns, true);
pqih->addService(gxscircles_ns, true);
pqih->addService(posted_ns, true);
#ifdef RS_USE_WIKI
pqih->addService(wiki_ns, true);
#endif
pqih->addService(gxsforums_ns, true);
pqih->addService(gxschannels_ns, true);
//pqih->addService(photo_ns, true);
@ -1619,7 +1622,9 @@ int RsServer::StartupRetroShare()
mConfigMgr->addConfiguration("gxschannels.cfg", gxschannels_ns);
mConfigMgr->addConfiguration("gxscircles.cfg", gxscircles_ns);
mConfigMgr->addConfiguration("posted.cfg", posted_ns);
#ifdef RS_USE_WIKI
mConfigMgr->addConfiguration("wiki.cfg", wiki_ns);
#endif
//mConfigMgr->addConfiguration("photo.cfg", photo_ns);
//mConfigMgr->addConfiguration("wire.cfg", wire_ns);
#endif
@ -1728,7 +1733,9 @@ int RsServer::StartupRetroShare()
// Must Set the GXS pointers before starting threads.
rsIdentity = mGxsIdService;
rsGxsCircles = mGxsCircles;
#if RS_USE_WIKI
rsWiki = mWiki;
#endif
rsPosted = mPosted;
rsGxsForums = mGxsForums;
rsGxsChannels = mGxsChannels;
@ -1739,7 +1746,9 @@ int RsServer::StartupRetroShare()
startServiceThread(mGxsIdService);
startServiceThread(mGxsCircles);
startServiceThread(mPosted);
#if RS_USE_WIKI
startServiceThread(mWiki);
#endif
startServiceThread(mGxsForums);
startServiceThread(mGxsChannels);
@ -1750,7 +1759,9 @@ int RsServer::StartupRetroShare()
startServiceThread(gxsid_ns);
startServiceThread(gxscircles_ns);
startServiceThread(posted_ns);
#if RS_USE_WIKI
startServiceThread(wiki_ns);
#endif
startServiceThread(gxsforums_ns);
startServiceThread(gxschannels_ns);

View File

@ -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()));
}
}
}

View File

@ -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);
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();

View File

@ -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 */

View File

@ -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,7 +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
@ -245,8 +230,6 @@ macx {
LIBS += -framework CoreFoundation
LIBS += -framework Security
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS += ../../../lib/libsqlcipher.a
#LIBS += -lsqlite3
@ -266,7 +249,6 @@ freebsd-* {
LIBS *= -lgnome-keyring
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS += -lsqlite3
}
@ -284,7 +266,6 @@ openbsd-* {
LIBS *= -lgnome-keyring
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS += -lsqlite3
LIBS *= -rdynamic
@ -302,6 +283,10 @@ openbsd-* {
DEPENDPATH += . ../../libretroshare/src/
INCLUDEPATH += ../../libretroshare/src/
wikipoos {
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
}
# webinterface
DEPENDPATH += ../../libresapi/src
INCLUDEPATH += ../../libresapi/src
@ -1122,6 +1107,7 @@ 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 \
@ -1130,10 +1116,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 +1293,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 +1329,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 \

View File

@ -10,10 +10,6 @@ CONFIG += webui
CONFIG -= qt xml gui
CONFIG += link_prl
# if you are linking against the libretroshare with gxs.
# this option links against the required sqlite library.
CONFIG += gxs
#CONFIG += debug
debug {
QMAKE_CFLAGS -= -O2

View File

@ -1,3 +1,6 @@
# Gxs is always enabled now.
DEFINES *= RS_ENABLE_GXS
unix {
isEmpty(PREFIX) { PREFIX = "/usr" }
isEmpty(BIN_DIR) { BIN_DIR = "$${PREFIX}/bin" }
@ -5,3 +8,12 @@ unix {
isEmpty(LIB_DIR) { LIB_DIR = "$${PREFIX}/lib" }
isEmpty(DATA_DIR) { DATA_DIR = "$${PREFIX}/share/RetroShare06" }
}
unfinished {
CONFIG += gxscircles
CONFIG += gxsthewire
CONFIG += gxsphotoshare
CONFIG += wikipoos
}
wikipoos:DEFINES *= RS_USE_WIKI

View File

@ -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++ {