Merge pull request #1784 from drbob/update_unfinished_services

Update code to get Wiki / Wire and PhotoShare compiling again
This commit is contained in:
csoler 2020-02-11 11:29:35 +01:00 committed by GitHub
commit d88788f411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 105 additions and 27 deletions

View File

@ -20,6 +20,11 @@ DESTDIR = lib
#QMAKE_CFLAGS += -Werror
#QMAKE_CXXFLAGS += -Werror
## Uncomment to enable Unfinished Services.
#CONFIG += wikipoos
#CONFIG += gxsthewire
#CONFIG += gxsphotoshare
debug {
# DEFINES *= DEBUG
# DEFINES *= OPENDHT_DEBUG DHT_DEBUG CONN_DEBUG DEBUG_UDP_SORTER P3DISC_DEBUG DEBUG_UDP_LAYER FT_DEBUG EXTADDRSEARCH_DEBUG
@ -763,6 +768,8 @@ SOURCES += services/p3gxschannels.cc \
rsitems/rsgxschannelitems.cc \
wikipoos {
DEFINES *= RS_USE_WIKI
# Wiki Service
HEADERS += retroshare/rswiki.h \
services/p3wiki.h \
@ -773,6 +780,8 @@ wikipoos {
}
gxsthewire {
DEFINES *= RS_USE_WIRE
# Wire Service
HEADERS += retroshare/rswire.h \
services/p3wire.h \
@ -793,6 +802,8 @@ SOURCES += services/p3postbase.cc \
rsitems/rsposteditems.cc
gxsphotoshare {
DEFINES *= RS_USE_PHOTO
#Photo Service
HEADERS += services/p3photoservice.h \
retroshare/rsphoto.h \

View File

@ -51,6 +51,12 @@ void RsGxsWireGroupItem::serial_process(RsGenericSerializer::SerializeJob j,RsGe
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_DESCR,group.mDescription,"group.mDescription") ;
}
void RsGxsWirePulseItem::clear()
{
pulse.mPulseText.clear();
pulse.mHashTags.clear();
}
void RsGxsWirePulseItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
{
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_MSG,pulse.mPulseText,"pulse.mPulseText") ;

View File

@ -737,12 +737,13 @@ RsGRouter *rsGRouter = NULL ;
#include "pgp/pgpauxutils.h"
#include "services/p3idservice.h"
#include "services/p3gxscircles.h"
#include "services/p3wiki.h"
#include "services/p3posted.h"
#include "services/p3photoservice.h"
#include "services/p3gxsforums.h"
#include "services/p3gxschannels.h"
#include "services/p3wiki.h"
#include "services/p3wire.h"
#include "services/p3photoservice.h"
#endif // RS_ENABLE_GXS
@ -1361,35 +1362,35 @@ int RsServer::StartupRetroShare()
mGxsChannels->setNetworkExchangeService(gxschannels_ns) ;
#if 0 // PHOTO IS DISABLED FOR THE MOMENT
#ifdef RS_USE_PHOTO
/**** Photo service ****/
RsGeneralDataService* photo_ds = new RsDataService(currGxsDir + "/", "photoV2_db",
RS_SERVICE_GXS_TYPE_PHOTO, NULL, rsInitConfig->gxs_passwd);
// init gxs services
mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService);
p3PhotoService *mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService);
// create GXS photo service
RsGxsNetService* photo_ns = new RsGxsNetService(
RS_SERVICE_GXS_TYPE_PHOTO, photo_ds, nxsMgr,
mPhoto, mPhoto->getServiceInfo(),
mGxsIdService, mGxsCircles,mGxsIdService,
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils);
#endif
#if 0 // WIRE IS DISABLED FOR THE MOMENT
#ifdef RS_USE_WIRE
/**** Wire GXS service ****/
RsGeneralDataService* wire_ds = new RsDataService(currGxsDir + "/", "wire_db",
RS_SERVICE_GXS_TYPE_WIRE,
NULL, rsInitConfig->gxs_passwd);
mWire = new p3Wire(wire_ds, NULL, mGxsIdService);
p3Wire *mWire = new p3Wire(wire_ds, NULL, mGxsIdService);
// create GXS photo service
RsGxsNetService* wire_ns = new RsGxsNetService(
RS_SERVICE_GXS_TYPE_WIRE, wire_ds, nxsMgr,
mWire, mWire->getServiceInfo(),
mGxsIdService, mGxsCircles,mGxsIdService,
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils);
#endif
// now add to p3service
@ -1401,7 +1402,12 @@ int RsServer::StartupRetroShare()
#endif
pqih->addService(gxsforums_ns, true);
pqih->addService(gxschannels_ns, true);
//pqih->addService(photo_ns, true);
#ifdef RS_USE_PHOTO
pqih->addService(photo_ns, true);
#endif
#ifdef RS_USE_WIRE
pqih->addService(wire_ns, true);
#endif
# ifdef RS_GXS_TRANS
RsGeneralDataService* gxstrans_ds = new RsDataService(
@ -1630,8 +1636,12 @@ int RsServer::StartupRetroShare()
#ifdef RS_USE_WIKI
mConfigMgr->addConfiguration("wiki.cfg", wiki_ns);
#endif
//mConfigMgr->addConfiguration("photo.cfg", photo_ns);
//mConfigMgr->addConfiguration("wire.cfg", wire_ns);
#ifdef RS_USE_PHOTO
mConfigMgr->addConfiguration("photo.cfg", photo_ns);
#endif
#ifdef RS_USE_WIRE
mConfigMgr->addConfiguration("wire.cfg", wire_ns);
#endif
#endif //RS_ENABLE_GXS
mConfigMgr->addConfiguration("I2PBOB.cfg", mI2pBob);
@ -1793,8 +1803,12 @@ int RsServer::StartupRetroShare()
rsGxsChannels = mGxsChannels;
rsGxsTrans = mGxsTrans;
//rsPhoto = mPhoto;
//rsWire = mWire;
#if RS_USE_PHOTO
rsPhoto = mPhoto;
#endif
#if RS_USE_WIRE
rsWire = mWire;
#endif
/*** start up GXS core runner ***/
@ -1808,8 +1822,12 @@ int RsServer::StartupRetroShare()
startServiceThread(mGxsForums, "gxs forums");
startServiceThread(mGxsChannels, "gxs channels");
//createThread(*mPhoto);
//createThread(*mWire);
#if RS_USE_PHOTO
startServiceThread(mPhoto, "gxs photo");
#endif
#if RS_USE_WIRE
startServiceThread(mPhoto, "gxs wire");
#endif
// cores ready start up GXS net servers
startServiceThread(gxsid_ns, "gxs id ns");
@ -1821,8 +1839,12 @@ int RsServer::StartupRetroShare()
startServiceThread(gxsforums_ns, "gxs forums ns");
startServiceThread(gxschannels_ns, "gxs channels ns");
//createThread(*photo_ns);
//createThread(*wire_ns);
#if RS_USE_PHOTO
startServiceThread(photo_ns, "gxs photo ns");
#endif
#if RS_USE_WIRE
startServiceThread(photo_ns, "gxs wire ns");
#endif
# ifdef RS_GXS_TRANS
startServiceThread(mGxsTrans, "gxs trans");

View File

@ -40,7 +40,7 @@ RsWiki *rsWiki = NULL;
p3Wiki::p3Wiki(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs)
:RsGenExchange(gds, nes, new RsGxsWikiSerialiser(), RS_SERVICE_GXS_TYPE_WIKI, gixs, wikiAuthenPolicy()),
RsWiki(this)
RsWiki(static_cast<RsGxsIface&>(*this))
{
// Setup of dummy Pages.
mAboutActive = false;

View File

@ -33,7 +33,7 @@ RsWire *rsWire = NULL;
p3Wire::p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs)
:RsGenExchange(gds, nes, new RsGxsWireSerialiser(), RS_SERVICE_GXS_TYPE_WIRE, gixs, wireAuthenPolicy()),
RsWire(this), mWireMtx("WireMtx")
RsWire(static_cast<RsGxsIface&>(*this)), mWireMtx("WireMtx")
{
}

View File

@ -103,6 +103,12 @@
#ifdef RS_USE_WIKI
#include "gui/WikiPoos/WikiDialog.h"
#endif
#ifdef RS_USE_WIRE
#include "gui/TheWire/WireDialog.h"
#endif
#ifdef RS_USE_PHOTO
#include "gui/PhotoShare/PhotoShare.h"
#endif
#include "gui/Posted/PostedDialog.h"
#include "gui/statistics/StatisticsWindow.h"
@ -423,6 +429,17 @@ void MainWindow::initStackedPage()
addPage(wikiDialog = new WikiDialog(ui->stackPages), grp, &notify);
#endif
#ifdef RS_USE_WIRE
WireDialog *wireDialog = NULL;
addPage(wireDialog = new WireDialog(ui->stackPages), grp, &notify);
#endif
#ifdef RS_USE_PHOTO
PhotoShare *photoDialog = NULL;
addPage(photoDialog = new PhotoShare(ui->stackPages), grp, &notify);
#endif
std::cerr << "Looking for interfaces in existing plugins:" << std::endl;
for(int i = 0;i<rsPlugins->nbPlugins();++i)
{

View File

@ -61,7 +61,7 @@ void AlbumDialog::setUp()
QPixmap qtn;
GxsIdDetails::loadPixmapFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size, mAlbum.mThumbnail.type.c_str(),qtn);
GxsIdDetails::loadPixmapFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size,qtn, GxsIdDetails::ORIGINAL);
if(mAlbum.mThumbnail.size != 0)
{

View File

@ -39,6 +39,8 @@
#include "util/TokenQueue.h"
#include "PhotoShareItemHolder.h"
#define IMAGE_PHOTO ":/images/lphoto.png"
namespace Ui {
class PhotoShare;
}
@ -51,6 +53,10 @@ public:
PhotoShare(QWidget *parent = 0);
~PhotoShare();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_PHOTO) ; }
virtual QString pageName() const { return tr("Photo Albums") ; }
virtual QString helpText() const { return ""; }
void notifySelection(PhotoShareItem* selection);
private slots:

View File

@ -31,6 +31,8 @@
#include "gui/TheWire/PulseItem.h"
#include "gui/TheWire/PulseAddDialog.h"
#define IMAGE_WIRE ":/images/kgames.png"
class WireDialog : public MainPage, public PulseHolder
{
Q_OBJECT
@ -38,6 +40,10 @@ class WireDialog : public MainPage, public PulseHolder
public:
WireDialog(QWidget *parent = 0);
virtual QIcon iconPixmap() const { return QIcon(IMAGE_WIRE) ; }
virtual QString pageName() const { return tr("The Wire") ; }
virtual QString helpText() const { return ""; }
virtual void deletePulseItem(PulseItem *, uint32_t type);
virtual void notifySelection(PulseItem *item, int ptype);

View File

@ -436,8 +436,8 @@ void WikiDialog::requestWikiPage(const RsGxsGrpMsgIdPair &msgId)
uint32_t token;
GxsMsgReq msgIds;
std::vector<RsGxsMessageId> &vect_msgIds = msgIds[msgId.first];
vect_msgIds.push_back(msgId.second);
std::set<RsGxsMessageId> &set_msgIds = msgIds[msgId.first];
set_msgIds.insert(msgId.second);
mWikiQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, WIKIDIALOG_WIKI_PAGE);
}
@ -698,10 +698,10 @@ void WikiDialog::updateDisplay(bool complete)
requestGroupMeta();
} else {
/* Update all groups of changed messages */
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgIds;
std::map<RsGxsGroupId, std::set<RsGxsMessageId> > msgIds;
getAllMsgIds(msgIds);
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::iterator msgIt;
std::map<RsGxsGroupId, std::set<RsGxsMessageId> >::iterator msgIt;
for (msgIt = msgIds.begin(); msgIt != msgIds.end(); ++msgIt) {
wikiGroupChanged(QString::fromStdString(msgIt->first.toStdString()));
}

View File

@ -622,8 +622,8 @@ void WikiEditDialog::requestPage(const RsGxsGrpMsgIdPair &msgId)
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
GxsMsgReq msgIds;
std::vector<RsGxsMessageId> &vect_msgIds = msgIds[msgId.first];
vect_msgIds.push_back(msgId.second);
std::set<RsGxsMessageId> &set_msgIds = msgIds[msgId.first];
set_msgIds.insert(msgId.second);
uint32_t token;
mWikiQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, WIKIEDITDIALOG_PAGE);

View File

@ -114,6 +114,11 @@ CONFIG += gxscircles
#CONFIG += framecatcher
#CONFIG += blogs
## To enable unfinished services
#CONFIG += wikipoos
#CONFIG += gxsthewire
#CONFIG += gxsphotoshare
DEFINES += RS_RELEASE_VERSION
RCC_DIR = temp/qrc
UI_DIR = temp/ui
@ -342,6 +347,7 @@ openbsd-* {
wikipoos {
PRE_TARGETDEPS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS *= -lglib-2.0
}
# Tor controller
@ -1144,7 +1150,8 @@ unfinished_services {
gxsphotoshare {
#DEFINES += RS_USE_PHOTOSHARE
#DEFINES += RS_USE_PHOTOSHARE # to enable in unfinished.
DEFINES += RS_USE_PHOTO # enable in MainWindow
HEADERS += \
gui/PhotoShare/PhotoDrop.h \
@ -1189,6 +1196,7 @@ gxsphotoshare {
wikipoos {
DEFINES += RS_USE_WIKI
DEPENDPATH += ../../supportlibs/pegmarkdown
INCLUDEPATH += ../../supportlibs/pegmarkdown
@ -1215,6 +1223,8 @@ wikipoos {
gxsthewire {
DEFINES += RS_USE_WIRE
HEADERS += gui/TheWire/PulseItem.h \
gui/TheWire/WireDialog.h \
gui/TheWire/PulseAddDialog.h \