fresh recompile needed!

TokenQueueV2 added, 
first change to photoshare to deal with gxs backend 
needed to redirect meta types to mine in order to get compilation working and definition fixes 
to rsgenexchange. 
Next step is to get GxsRunner going

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5377 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-08-03 06:39:50 +00:00
parent 09b5d7a8c6
commit d220e14c4a
21 changed files with 490 additions and 156 deletions

View file

@ -45,12 +45,11 @@ PhotoAddDialog::PhotoAddDialog(QWidget *parent)
mPhotoDetails = NULL;
mPhotoQueue = new TokenQueue(rsPhoto, this);
mPhotoQueue = new TokenQueueV2(rsPhotoV2->getTokenService(), this);
ui.AlbumDrop->setSingleImage();
connect(ui.AlbumDrop, SIGNAL( photosChanged( void ) ), this, SLOT( albumImageChanged( void ) ) );
connect(ui.scrollAreaWidgetContents, SIGNAL( photosChanged( void ) ), this, SLOT( photoImageChanged( void ) ) );
}
@ -333,7 +332,7 @@ void PhotoAddDialog::publishAlbum()
std::cerr << std::endl;
uint32_t token;
rsPhoto->submitAlbumDetails(token, album, true);
rsPhotoV2->submitAlbumDetails(album);
// tell tokenQueue to expect results from submission.
mPhotoQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_SUMMARY, 0);
@ -413,12 +412,12 @@ void PhotoAddDialog::publishPhotos(std::string albumId)
if (isNewPhoto)
{
std::cerr << "Is a New Photo";
rsPhoto->submitPhoto(token, photo, true);
rsPhotoV2->submitPhoto(photo);
}
else if (isModifiedPhoto)
{
std::cerr << "Is Updated";
rsPhoto->submitPhoto(token, photo, false);
rsPhotoV2->submitPhoto(photo);
}
else
{
@ -479,7 +478,7 @@ void PhotoAddDialog::loadAlbum(const std::string &albumId)
RsTokReqOptions opts;
uint32_t token;
std::list<std::string> albumIds;
std::list<RsGxsGroupId> albumIds;
albumIds.push_back(albumId);
// We need both Album and Photo Data.
@ -497,9 +496,10 @@ bool PhotoAddDialog::loadPhotoData(const uint32_t &token)
bool moreData = true;
while(moreData)
{
PhotoResult res;
RsPhotoPhoto photo;
if (rsPhoto->getPhoto(token, photo))
if (rsPhotoV2->getPhoto(token, res))
{
std::cerr << "PhotoDialog::addAddPhoto() AlbumId: " << photo.mMeta.mGroupId;
std::cerr << " PhotoId: " << photo.mMeta.mMsgId;
@ -525,8 +525,9 @@ bool PhotoAddDialog::loadAlbumData(const uint32_t &token)
bool moreData = true;
while(moreData)
{
std::vector<RsPhotoAlbum> albums;
RsPhotoAlbum album;
if (rsPhoto->getAlbum(token, album))
if (rsPhotoV2->getAlbum(token, albums))
{
std::cerr << " PhotoAddDialog::loadAlbumData() AlbumId: " << album.mMeta.mGroupId << std::endl;
updateAlbumDetails(album);
@ -536,7 +537,9 @@ bool PhotoAddDialog::loadAlbumData(const uint32_t &token)
uint32_t token;
std::list<std::string> albumIds;
albumIds.push_back(album.mMeta.mGroupId);
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, albumIds, 0);
GxsMsgReq req;
req[album.mMeta.mGroupId] = std::vector<RsGxsMessageId>();
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, req, 0);
}
else
{
@ -552,7 +555,7 @@ bool PhotoAddDialog::loadCreatedAlbum(const uint32_t &token)
std::cerr << std::endl;
std::list<RsGroupMetaData> groupInfo;
if (!rsPhoto->getGroupSummary(token, groupInfo))
if (!rsPhotoV2->getGroupSummary(token, groupInfo))
{
std::cerr << "PhotoAddDialog::loadCreatedAlbum() ERROR Getting MetaData";
std::cerr << std::endl;
@ -575,7 +578,7 @@ bool PhotoAddDialog::loadCreatedAlbum(const uint32_t &token)
}
void PhotoAddDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
void PhotoAddDialog::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req)
{
std::cerr << "PhotoDialog::loadRequest()";
std::cerr << std::endl;

View file

@ -26,12 +26,12 @@
#include "ui_PhotoAddDialog.h"
#include <retroshare/rsphoto.h>
#include "util/TokenQueue.h"
#include <retroshare/rsphotoV2.h>
#include "util/TokenQueueV2.h"
class PhotoDetailsDialog;
class PhotoAddDialog : public QWidget, public TokenResponse
class PhotoAddDialog : public QWidget, public TokenResponseV2
{
Q_OBJECT
@ -39,7 +39,7 @@ public:
PhotoAddDialog(QWidget *parent = 0);
void loadAlbum(const std::string &albumId);
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
virtual void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req);
void clearDialog();
@ -67,7 +67,7 @@ private:
bool loadAlbumData(const uint32_t &token);
bool loadCreatedAlbum(const uint32_t &token);
TokenQueue *mPhotoQueue;
TokenQueueV2 *mPhotoQueue;
protected:
bool mAlbumEdit; // Editing or New.

View file

@ -24,7 +24,7 @@
#include "PhotoDialog.h"
#include <retroshare/rspeers.h>
#include <retroshare/rsphoto.h>
#include <retroshare/rsphotoV2.h>
#include <iostream>
#include <sstream>
@ -79,7 +79,7 @@ PhotoDialog::PhotoDialog(QWidget *parent)
/* setup TokenQueue */
mPhotoQueue = new TokenQueue(rsPhoto, this);
mPhotoQueue = new TokenQueueV2(rsPhotoV2->getTokenService(), this);
}
@ -139,10 +139,10 @@ void PhotoDialog::notifyPhotoSelection(PhotoItem *item)
void PhotoDialog::checkUpdate()
{
/* update */
if (!rsPhoto)
if (!rsPhotoV2)
return;
if (rsPhoto->updated())
if (rsPhotoV2->updated())
{
//insertAlbums();
requestAlbumList();
@ -443,7 +443,7 @@ void PhotoDialog::loadAlbumList(const uint32_t &token)
std::cerr << std::endl;
std::list<std::string> albumIds;
rsPhoto->getGroupList(token, albumIds);
rsPhotoV2->getGroupList(token, albumIds);
requestAlbumData(albumIds);
@ -458,11 +458,11 @@ void PhotoDialog::loadAlbumList(const uint32_t &token)
}
void PhotoDialog::requestAlbumData(const std::list<std::string> &ids)
void PhotoDialog::requestAlbumData(std::list<std::string> &ids)
{
RsTokReqOptions opts;
uint32_t token;
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, ids, 0);
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, ids, 0);
}
@ -477,7 +477,8 @@ bool PhotoDialog::loadAlbumData(const uint32_t &token)
while(moreData)
{
RsPhotoAlbum album;
if (rsPhoto->getAlbum(token, album))
std::vector<RsPhotoAlbum> albums;
if (rsPhotoV2->getAlbum(token, albums))
{
std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl;
@ -499,11 +500,12 @@ void PhotoDialog::requestPhotoList(const std::string &albumId)
{
std::list<std::string> ids;
ids.push_back(albumId);
GxsMsgReq req;
req[albumId] = std::vector<RsGxsMessageId>();
RsTokReqOptions opts;
opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
uint32_t token;
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, ids, 0);
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, req, 0);
}
@ -515,18 +517,19 @@ void PhotoDialog::loadPhotoList(const uint32_t &token)
std::cerr << std::endl;
std::list<std::string> photoIds;
GxsMsgIdResult res;
GxsMsgReq req;
rsPhoto->getMsgList(token, photoIds);
requestPhotoData(photoIds);
rsPhotoV2->getMsgList(token, res);
requestPhotoData(req);
}
void PhotoDialog::requestPhotoData(const std::list<std::string> &photoIds)
void PhotoDialog::requestPhotoData(GxsMsgReq &photoIds)
{
RsTokReqOptions opts;
uint32_t token;
mPhotoQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, photoIds, 0);
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, photoIds, 0);
}
@ -539,8 +542,8 @@ void PhotoDialog::loadPhotoData(const uint32_t &token)
while(moreData)
{
RsPhotoPhoto photo;
if (rsPhoto->getPhoto(token, photo))
PhotoResult res;
if (rsPhotoV2->getPhoto(token, res))
{
std::cerr << "PhotoDialog::loadPhotoData() AlbumId: " << photo.mMeta.mGroupId;
@ -559,7 +562,7 @@ void PhotoDialog::loadPhotoData(const uint32_t &token)
/********************************/
void PhotoDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
void PhotoDialog::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req)
{
std::cerr << "PhotoDialog::loadRequest()";
std::cerr << std::endl;
@ -640,7 +643,7 @@ void PhotoDialog::insertAlbums()
std::list<std::string> filteredAlbumIds;
std::list<std::string>::iterator it;
rsPhoto->getAlbumList(albumIds);
rsPhotoV2->getGroupList(token, al);
/* Filter Albums */ /* Sort Albums */
#define MAX_ALBUMS 50

View file

@ -27,16 +27,16 @@
#include "retroshare-gui/mainpage.h"
#include "ui_PhotoDialog.h"
#include <retroshare/rsphoto.h>
#include <retroshare/rsphotoV2.h>
#include <map>
#include "gui/PhotoShare/PhotoItem.h"
#include "gui/PhotoShare/PhotoAddDialog.h"
#include "gui/PhotoShare/PhotoSlideShow.h"
#include "util/TokenQueue.h"
#include "util/TokenQueueV2.h"
class PhotoDialog : public MainPage, public PhotoHolder, public TokenResponse
class PhotoDialog : public MainPage, public PhotoHolder, public TokenResponseV2
{
Q_OBJECT
@ -59,16 +59,16 @@ private:
/* Request Response Functions for loading data */
void requestAlbumList();
void requestAlbumData(const std::list<std::string> &ids);
void requestAlbumData(std::list<std::string> &ids);
void requestPhotoList(const std::string &albumId);
void requestPhotoData(const std::list<std::string> &photoIds);
void requestPhotoData(GxsMsgReq &photoIds);
void loadAlbumList(const uint32_t &token);
bool loadAlbumData(const uint32_t &token);
void loadPhotoList(const uint32_t &token);
void loadPhotoData(const uint32_t &token);
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req);
/* TODO: These functions must be filled in for proper filtering to work
@ -101,7 +101,7 @@ private:
PhotoItem *mAlbumSelected;
PhotoItem *mPhotoSelected;
TokenQueue *mPhotoQueue;
TokenQueueV2 *mPhotoQueue;
/* UI - from Designer */
Ui::PhotoDialog ui;

View file

@ -29,7 +29,7 @@
#include "PhotoItem.h"
#include <retroshare/rsphoto.h>
#include <retroshare/rsphotoV2.h>
#include <algorithm>
#include <iostream>

View file

@ -26,7 +26,7 @@
#include "ui_PhotoItem.h"
#include <retroshare/rsphoto.h>
#include <retroshare/rsphotoV2.h>
class PhotoItem;

View file

@ -38,7 +38,7 @@ PhotoSlideShow::PhotoSlideShow(QWidget *parent)
connect(ui.pushButton_StartStop, SIGNAL( clicked( void ) ), this, SLOT( StartStop( void ) ) );
connect(ui.pushButton_Close, SIGNAL( clicked( void ) ), this, SLOT( closeShow( void ) ) );
mPhotoQueue = new TokenQueue(rsPhoto, this);
mPhotoQueue = new TokenQueueV2(rsPhotoV2->getTokenService(), this);
mRunning = true;
mShotActive = true;
@ -49,6 +49,9 @@ PhotoSlideShow::PhotoSlideShow(QWidget *parent)
//QTimer::singleShot(5000, this, SLOT(timerEvent()));
}
PhotoSlideShow::~PhotoSlideShow(){
}
void PhotoSlideShow::showPhotoDetails()
{
@ -262,8 +265,9 @@ bool PhotoSlideShow::loadPhotoData(const uint32_t &token)
while(moreData)
{
RsPhotoPhoto photo;
PhotoResult res;
if (rsPhoto->getPhoto(token, photo))
if (rsPhotoV2->getPhoto(token, res))
{
RsPhotoPhoto *ptr = new RsPhotoPhoto;
*ptr = photo;
@ -299,7 +303,8 @@ bool PhotoSlideShow::loadAlbumData(const uint32_t &token)
while(moreData)
{
RsPhotoAlbum album;
if (rsPhoto->getAlbum(token, album))
std::vector<RsPhotoAlbum> res;
if (rsPhotoV2->getAlbum(token, res))
{
std::cerr << " PhotoSlideShow::loadAlbumData() AlbumId: " << album.mMeta.mGroupId << std::endl;
//updateAlbumDetails(album);
@ -309,7 +314,9 @@ bool PhotoSlideShow::loadAlbumData(const uint32_t &token)
uint32_t token;
std::list<std::string> albumIds;
albumIds.push_back(album.mMeta.mGroupId);
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, albumIds, 0);
GxsMsgReq req;
req[album.mMeta.mGroupId] = std::vector<RsGxsMessageId>();
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, req, 0);
}
else
{
@ -319,8 +326,7 @@ bool PhotoSlideShow::loadAlbumData(const uint32_t &token)
return true;
}
void PhotoSlideShow::loadRequest(const TokenQueue *queue, const TokenRequest &req)
void PhotoSlideShow::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req)
{
std::cerr << "PhotoSlideShow::loadRequest()";
std::cerr << std::endl;

View file

@ -26,18 +26,19 @@
#include "ui_PhotoSlideShow.h"
#include <retroshare/rsphoto.h>
#include "util/TokenQueue.h"
#include <retroshare/rsphotoV2.h>
#include "util/TokenQueueV2.h"
class PhotoSlideShow : public QWidget, public TokenResponse
class PhotoSlideShow : public QWidget, public TokenResponseV2
{
Q_OBJECT
public:
PhotoSlideShow(QWidget *parent = 0);
virtual ~PhotoSlideShow();
void loadAlbum(const std::string &albumId);
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
virtual void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req);
void clearDialog();
@ -67,7 +68,7 @@ private:
int mImageIdx;
bool mShotActive;
TokenQueue *mPhotoQueue;
TokenQueueV2 *mPhotoQueue;
Ui::PhotoSlideShow ui;
};

View file

@ -32,7 +32,7 @@
#include <retroshare/rsiface.h>
#include "gui/PhotoShare/PhotoDialog.h"
//#include "gui/PhotoShare/PhotoDialog.h"
#include "gui/WikiPoos/WikiDialog.h"
#include "gui/TheWire/WireDialog.h"
#include "gui/Identity/IdDialog.h"
@ -97,9 +97,9 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
ui.stackPages->add(idDialog = new IdDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_LIBRARY), tr("Identities"), grp));
PhotoDialog *photoDialog = NULL;
ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages),
createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), grp));
//PhotoDialog *photoDialog = NULL;
//ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages),
// createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), grp));
WikiDialog *wikiDialog = NULL;
ui.stackPages->add(wikiDialog = new WikiDialog(ui.stackPages),