mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 19:26:31 -04:00
Removed references to postedVEG from GxsGroupDialog and associated classes and PostedDialog (GUI does not work now but does not crash)
Removed V2 references: TokenQueueV2 and RsTokReqOptionsV2 are now TokenQueue and RsTokReqOptions and renamed file Added initialisation of Posted back end service successfully Added new msg status flags GXS_SERV::MSG_STATUS_UNPROCESSED and ::MSG_STATUS_UNREAD git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5707 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dcb64f6631
commit
c518bd2f19
44 changed files with 2379 additions and 3761 deletions
|
@ -125,12 +125,12 @@ win32 {
|
|||
|
||||
OBJECTS_DIR = temp/obj
|
||||
|
||||
PRE_TARGETDEPS += ../../libretroshare/src/lib/libretroshare.a
|
||||
#PRE_TARGETDEPS += ../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
#PRE_TARGETDEPS += ../../libretroshare/src/lib/libretroshare.a
|
||||
PRE_TARGETDEPS += ../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
LIBS += ../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a
|
||||
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += ../../openpgpsdk/src/lib/libops.a
|
||||
LIBS += ../../../sqlite-autoconf-3070900/.libs/libsqlite3.a
|
||||
LIBS += C:\Development\Rs\v0.5-gxs-b1\openpgpsdk\openpgpsdk-build-desktop\lib\libops.a
|
||||
LIBS += C:\Development\Libraries\sqlite\sqlite-autoconf-3070900\.libs\libsqlite3.a
|
||||
LIBS += -L"../../../lib"
|
||||
LIBS += -lssl -lcrypto -lpthreadGC2d -lminiupnpc -lz -lbz2
|
||||
# added after bitdht
|
||||
|
@ -194,15 +194,15 @@ freebsd-* {
|
|||
# ###########################################
|
||||
|
||||
bitdht {
|
||||
LIBS += ../../libbitdht/src/lib/libbitdht.a
|
||||
PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
|
||||
#LIBS += ../../libbitdht/src/lib/libbitdht.a
|
||||
#PRE_TARGETDEPS *= ../../libbitdht/src/lib/libbitdht.a
|
||||
|
||||
#LIBS += C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a
|
||||
#PRE_TARGETDEPS *= C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a
|
||||
|
||||
# Chris version.
|
||||
#LIBS += ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
#PRE_TARGETDEPS *= ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
LIBS += ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
PRE_TARGETDEPS *= ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a
|
||||
}
|
||||
|
||||
win32 {
|
||||
|
@ -871,7 +871,7 @@ photoshare {
|
|||
gui/PhotoShare/AlbumItem.h \
|
||||
gui/PhotoShare/AlbumDialog.h \
|
||||
gui/PhotoShare/AlbumCreateDialog.h \
|
||||
util/TokenQueueV2.h \
|
||||
util/TokenQueue.h \
|
||||
gui/PhotoShare/PhotoItem.h \
|
||||
gui/PhotoShare/PhotoShareItemHolder.h \
|
||||
gui/PhotoShare/PhotoShare.h \
|
||||
|
@ -898,7 +898,7 @@ photoshare {
|
|||
gui/PhotoShare/AlbumItem.cpp \
|
||||
gui/PhotoShare/AlbumDialog.cpp \
|
||||
gui/PhotoShare/AlbumCreateDialog.cpp \
|
||||
util/TokenQueueV2.cpp \
|
||||
util/TokenQueue.cpp \
|
||||
gui/PhotoShare/PhotoShareItemHolder.cpp \
|
||||
gui/PhotoShare/PhotoShare.cpp \
|
||||
gui/PhotoShare/PhotoSlideShow.cpp \
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "util/misc.h"
|
||||
|
||||
AlbumCreateDialog::AlbumCreateDialog(TokenQueueV2 *photoQueue, RsPhotoV2 *rs_photo, QWidget *parent):
|
||||
AlbumCreateDialog::AlbumCreateDialog(TokenQueue *photoQueue, RsPhotoV2 *rs_photo, QWidget *parent):
|
||||
QDialog(parent),
|
||||
ui(new Ui::AlbumCreateDialog), mPhotoQueue(photoQueue), mRsPhoto(rs_photo)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define ALBUMCREATEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "util/TokenQueueV2.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
|
||||
namespace Ui {
|
||||
|
@ -15,7 +15,7 @@ class AlbumCreateDialog : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AlbumCreateDialog(TokenQueueV2* photoQueue, RsPhotoV2* rs_photo, QWidget *parent = 0);
|
||||
explicit AlbumCreateDialog(TokenQueue* photoQueue, RsPhotoV2* rs_photo, QWidget *parent = 0);
|
||||
~AlbumCreateDialog();
|
||||
|
||||
private slots:
|
||||
|
@ -28,7 +28,7 @@ private:
|
|||
private:
|
||||
Ui::AlbumCreateDialog *ui;
|
||||
|
||||
TokenQueueV2* mPhotoQueue;
|
||||
TokenQueue* mPhotoQueue;
|
||||
RsPhotoV2* mRsPhoto;
|
||||
QPixmap mThumbNail;
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "AlbumDialog.h"
|
||||
#include "ui_AlbumDialog.h"
|
||||
|
||||
AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueueV2* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent) :
|
||||
AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::AlbumDialog), mPhotoQueue(photoQueue), mRsPhoto(rs_Photo), mAlbum(album), mPhotoSelected(NULL)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <QWidget>
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "util/TokenQueueV2.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "PhotoShareItemHolder.h"
|
||||
#include "PhotoItem.h"
|
||||
#include "PhotoDrop.h"
|
||||
|
@ -17,7 +17,7 @@ class AlbumDialog : public QWidget, public PhotoShareItemHolder
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AlbumDialog(const RsPhotoAlbum& album, TokenQueueV2* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent = 0);
|
||||
explicit AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent = 0);
|
||||
~AlbumDialog();
|
||||
|
||||
void notifySelection(PhotoShareItem* selection);
|
||||
|
@ -34,7 +34,7 @@ private slots:
|
|||
private:
|
||||
Ui::AlbumDialog *ui;
|
||||
RsPhotoV2* mRsPhoto;
|
||||
TokenQueueV2* mPhotoQueue;
|
||||
TokenQueue* mPhotoQueue;
|
||||
RsPhotoAlbum mAlbum;
|
||||
PhotoDrop* mPhotoDrop;
|
||||
PhotoItem* mPhotoSelected;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
PhotoDialog::PhotoDialog(RsPhotoV2 *rs_photo, const RsPhotoPhoto &photo, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::PhotoDialog), mRsPhoto(rs_photo), mPhotoQueue(new TokenQueueV2(mRsPhoto->getTokenService(), this)),
|
||||
ui(new Ui::PhotoDialog), mRsPhoto(rs_photo), mPhotoQueue(new TokenQueue(mRsPhoto->getTokenService(), this)),
|
||||
mPhotoDetails(photo), mCommentDialog(NULL)
|
||||
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ void PhotoDialog::resetComments()
|
|||
|
||||
void PhotoDialog::requestComments()
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mMsgFlagMask = RsPhotoV2::FLAG_MSG_TYPE_MASK;
|
||||
opts.mMsgFlagFilter = RsPhotoV2::FLAG_MSG_TYPE_PHOTO_COMMENT;
|
||||
|
||||
|
@ -107,7 +107,7 @@ void PhotoDialog::createComment()
|
|||
|
||||
/*************** message loading **********************/
|
||||
|
||||
void PhotoDialog::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req)
|
||||
void PhotoDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "PhotoShare::loadRequest()";
|
||||
std::cerr << std::endl;
|
||||
|
@ -177,7 +177,7 @@ void PhotoDialog::loadList(uint32_t token)
|
|||
{
|
||||
GxsMsgReq msgIds;
|
||||
mRsPhoto->getMsgList(token, msgIds);
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
|
||||
// just use data as no need to worry about getting comments
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <QDialog>
|
||||
#include <QSet>
|
||||
#include "retroshare/rsphotoV2.h"
|
||||
#include "util/TokenQueueV2.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "PhotoCommentItem.h"
|
||||
#include "AddCommentDialog.h"
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace Ui {
|
|||
class PhotoDialog;
|
||||
}
|
||||
|
||||
class PhotoDialog : public QDialog, public TokenResponseV2
|
||||
class PhotoDialog : public QDialog, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -26,7 +26,7 @@ private slots:
|
|||
void createComment();
|
||||
|
||||
public:
|
||||
void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req);
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
private:
|
||||
void setUp();
|
||||
|
||||
|
@ -54,7 +54,7 @@ private:
|
|||
Ui::PhotoDialog *ui;
|
||||
|
||||
RsPhotoV2* mRsPhoto;
|
||||
TokenQueueV2* mPhotoQueue;
|
||||
TokenQueue* mPhotoQueue;
|
||||
RsPhotoPhoto mPhotoDetails;
|
||||
QSet<PhotoCommentItem*> mComments;
|
||||
AddCommentDialog* mCommentDialog;
|
||||
|
|
|
@ -96,7 +96,7 @@ PhotoShare::PhotoShare(QWidget *parent)
|
|||
timer->start(1000);
|
||||
|
||||
/* setup TokenQueue */
|
||||
mPhotoQueue = new TokenQueueV2(rsPhotoV2->getTokenService(), this);
|
||||
mPhotoQueue = new TokenQueue(rsPhotoV2->getTokenService(), this);
|
||||
requestAlbumData();
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ void PhotoShare::checkUpdate()
|
|||
rsPhotoV2->groupsChanged(grpIds);
|
||||
if(!grpIds.empty())
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, 0);
|
||||
|
@ -490,7 +490,7 @@ void PhotoShare::updatePhotos()
|
|||
|
||||
void PhotoShare::requestAlbumList(std::list<std::string>& ids)
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_IDS;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, ids, 0);
|
||||
|
@ -498,7 +498,7 @@ void PhotoShare::requestAlbumList(std::list<std::string>& ids)
|
|||
|
||||
void PhotoShare::requestPhotoList(GxsMsgReq& req)
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, req, 0);
|
||||
|
@ -526,7 +526,7 @@ void PhotoShare::loadAlbumList(const uint32_t &token)
|
|||
|
||||
void PhotoShare::requestAlbumData(std::list<RsGxsGroupId> &ids)
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, ids, 0);
|
||||
|
@ -534,7 +534,7 @@ void PhotoShare::requestAlbumData(std::list<RsGxsGroupId> &ids)
|
|||
|
||||
void PhotoShare::requestAlbumData()
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, 0);
|
||||
|
@ -569,7 +569,7 @@ void PhotoShare::requestPhotoList(const std::string &albumId)
|
|||
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
grpIds.push_back(albumId);
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS;
|
||||
opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
|
||||
uint32_t token;
|
||||
|
@ -587,7 +587,7 @@ void PhotoShare::acknowledgeGroup(const uint32_t &token)
|
|||
std::list<RsGxsGroupId> grpIds;
|
||||
grpIds.push_back(grpId);
|
||||
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
uint32_t reqToken;
|
||||
mPhotoQueue->requestGroupInfo(reqToken, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, 0);
|
||||
|
@ -630,7 +630,7 @@ void PhotoShare::loadPhotoList(const uint32_t &token)
|
|||
|
||||
void PhotoShare::requestPhotoData(GxsMsgReq &photoIds)
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, photoIds, 0);
|
||||
|
@ -638,7 +638,7 @@ void PhotoShare::requestPhotoData(GxsMsgReq &photoIds)
|
|||
|
||||
void PhotoShare::requestPhotoData(const std::list<RsGxsGroupId>& grpIds)
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, 0);
|
||||
|
@ -677,7 +677,7 @@ void PhotoShare::loadPhotoData(const uint32_t &token)
|
|||
|
||||
/**************************** Request / Response Filling of Data ************************/
|
||||
|
||||
void PhotoShare::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req)
|
||||
void PhotoShare::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "PhotoShare::loadRequest()";
|
||||
std::cerr << std::endl;
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
#include "PhotoItem.h"
|
||||
#include "PhotoSlideShow.h"
|
||||
|
||||
#include "util/TokenQueueV2.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "PhotoShareItemHolder.h"
|
||||
|
||||
namespace Ui {
|
||||
class PhotoShare;
|
||||
}
|
||||
|
||||
class PhotoShare : public MainPage, public TokenResponseV2, public PhotoShareItemHolder
|
||||
class PhotoShare : public MainPage, public TokenResponse, public PhotoShareItemHolder
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -64,7 +64,7 @@ private:
|
|||
void loadPhotoList(const uint32_t &token);
|
||||
void loadPhotoData(const uint32_t &token);
|
||||
|
||||
void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req);
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
void acknowledgeGroup(const uint32_t &token);
|
||||
void acknowledgeMessage(const uint32_t &token);
|
||||
|
@ -91,7 +91,7 @@ private:
|
|||
AlbumDialog* mAlbumDialog;
|
||||
PhotoDialog* mPhotoDialog;
|
||||
|
||||
TokenQueueV2 *mPhotoQueue;
|
||||
TokenQueue *mPhotoQueue;
|
||||
|
||||
/* UI - from Designer */
|
||||
Ui::PhotoShare ui;
|
||||
|
|
|
@ -38,7 +38,7 @@ PhotoSlideShow::PhotoSlideShow(const RsPhotoAlbum& album, 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 TokenQueueV2(rsPhotoV2->getTokenService(), this);
|
||||
mPhotoQueue = new TokenQueue(rsPhotoV2->getTokenService(), this);
|
||||
|
||||
mRunning = true;
|
||||
mShotActive = true;
|
||||
|
@ -215,37 +215,9 @@ void PhotoSlideShow::updateMoveButtons(uint32_t status)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void PhotoSlideShow::clearDialog()
|
||||
{
|
||||
#if 0
|
||||
ui.lineEdit_Title->setText(QString("title"));
|
||||
ui.lineEdit_Caption->setText(QString("Caption"));
|
||||
ui.lineEdit_Where->setText(QString("Where"));
|
||||
ui.lineEdit_When->setText(QString("When"));
|
||||
|
||||
ui.scrollAreaWidgetContents->clearPhotos();
|
||||
ui.AlbumDrop->clearPhotos();
|
||||
|
||||
/* clean up album image */
|
||||
mAlbumData.mThumbnail.deleteImage();
|
||||
|
||||
RsPhotoAlbum emptyAlbum;
|
||||
mAlbumData = emptyAlbum;
|
||||
|
||||
/* add empty image */
|
||||
PhotoItem *item = new PhotoItem(NULL, mAlbumData);
|
||||
ui.AlbumDrop->addPhotoItem(item);
|
||||
|
||||
mAlbumEdit = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void PhotoSlideShow::requestPhotos()
|
||||
{
|
||||
RsTokReqOptionsV2 opts;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
uint32_t token;
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
|
@ -294,7 +266,7 @@ bool PhotoSlideShow::loadPhotoData(const uint32_t &token)
|
|||
return true;
|
||||
}
|
||||
|
||||
void PhotoSlideShow::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req)
|
||||
void PhotoSlideShow::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "PhotoSlideShow::loadRequest()";
|
||||
std::cerr << std::endl;
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
#include "ui_PhotoSlideShow.h"
|
||||
|
||||
#include <retroshare/rsphotoV2.h>
|
||||
#include "util/TokenQueueV2.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "AlbumItem.h"
|
||||
|
||||
class PhotoSlideShow : public QWidget, public TokenResponseV2
|
||||
class PhotoSlideShow : public QWidget, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -38,9 +38,7 @@ public:
|
|||
PhotoSlideShow(const RsPhotoAlbum& mAlbum, QWidget *parent = 0);
|
||||
virtual ~PhotoSlideShow();
|
||||
|
||||
void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req);
|
||||
|
||||
void clearDialog();
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
private slots:
|
||||
void showPhotoDetails();
|
||||
|
@ -70,7 +68,7 @@ private:
|
|||
|
||||
RsPhotoAlbum mAlbum;
|
||||
|
||||
TokenQueueV2 *mPhotoQueue;
|
||||
TokenQueue *mPhotoQueue;
|
||||
|
||||
Ui::PhotoSlideShow ui;
|
||||
};
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
#include "PostedComments.h"
|
||||
|
||||
//#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
@ -64,26 +63,10 @@ PostedComments::PostedComments(QWidget *parent)
|
|||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
#if 0
|
||||
mAddDialog = NULL;
|
||||
mAlbumSelected = NULL;
|
||||
mPhotoSelected = NULL;
|
||||
mSlideShow = NULL;
|
||||
|
||||
connect( ui.toolButton_NewAlbum, SIGNAL(clicked()), this, SLOT(OpenOrShowPhotoAddDialog()));
|
||||
connect( ui.toolButton_EditAlbum, SIGNAL(clicked()), this, SLOT(OpenPhotoEditDialog()));
|
||||
connect( ui.toolButton_SlideShow, SIGNAL(clicked()), this, SLOT(OpenSlideShow()));
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
|
||||
timer->start(1000);
|
||||
|
||||
#endif
|
||||
|
||||
/* setup TokenQueue */
|
||||
//mPhotoQueue = new TokenQueue(rsPhoto, this);
|
||||
|
||||
ui.treeWidget->setup(rsPostedVEG);
|
||||
ui.treeWidget->setup(rsPosted->getTokenService());
|
||||
|
||||
}
|
||||
|
||||
|
@ -96,543 +79,3 @@ void PostedComments::loadComments( std::string threadId )
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
void PhotoDialog::notifySelection(PhotoItem *item, int ptype)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifySelection() from : " << ptype << " " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
switch(ptype)
|
||||
{
|
||||
default:
|
||||
case PHOTO_ITEM_TYPE_ALBUM:
|
||||
notifyAlbumSelection(item);
|
||||
break;
|
||||
case PHOTO_ITEM_TYPE_PHOTO:
|
||||
notifyPhotoSelection(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PhotoDialog::notifyAlbumSelection(PhotoItem *item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyAlbumSelection() from : " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (mAlbumSelected)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyAlbumSelection() unselecting old one : " << mAlbumSelected;
|
||||
std::cerr << std::endl;
|
||||
|
||||
mAlbumSelected->setSelected(false);
|
||||
}
|
||||
|
||||
mAlbumSelected = item;
|
||||
insertPhotosForSelectedAlbum();
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::notifyPhotoSelection(PhotoItem *item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyPhotoSelection() from : " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (mPhotoSelected)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyPhotoSelection() unselecting old one : " << mPhotoSelected;
|
||||
std::cerr << std::endl;
|
||||
|
||||
mPhotoSelected->setSelected(false);
|
||||
}
|
||||
|
||||
mPhotoSelected = item;
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::checkUpdate()
|
||||
{
|
||||
/* update */
|
||||
if (!rsPhoto)
|
||||
return;
|
||||
|
||||
if (rsPhoto->updated())
|
||||
{
|
||||
//insertAlbums();
|
||||
requestAlbumList();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*************** New Photo Dialog ***************/
|
||||
|
||||
void PhotoDialog::OpenSlideShow()
|
||||
{
|
||||
|
||||
// TODO.
|
||||
if (!mAlbumSelected)
|
||||
{
|
||||
// ALERT.
|
||||
int ret = QMessageBox::information(this, tr("PhotoShare"),
|
||||
tr("Please select an album before\n"
|
||||
"requesting to edit it!"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mAlbumSelected->mIsPhoto)
|
||||
{
|
||||
std::cerr << "PhotoDialog::OpenPhotoEditDialog() MAJOR ERROR!";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
|
||||
|
||||
if (mSlideShow)
|
||||
{
|
||||
mSlideShow->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
mSlideShow = new PhotoSlideShow(NULL);
|
||||
mSlideShow->show();
|
||||
}
|
||||
mSlideShow->loadAlbum(albumId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*************** New Photo Dialog ***************/
|
||||
|
||||
void PhotoDialog::OpenOrShowPhotoAddDialog()
|
||||
{
|
||||
if (mAddDialog)
|
||||
{
|
||||
mAddDialog->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
mAddDialog = new PhotoAddDialog(NULL);
|
||||
mAddDialog->show();
|
||||
}
|
||||
mAddDialog->clearDialog();
|
||||
}
|
||||
|
||||
|
||||
/*************** Edit Photo Dialog ***************/
|
||||
|
||||
void PhotoDialog::OpenPhotoEditDialog()
|
||||
{
|
||||
/* check if we have an album selected */
|
||||
// THE TWO MessageBoxes - should be handled by disabling the Button!.
|
||||
// TODO.
|
||||
if (!mAlbumSelected)
|
||||
{
|
||||
// ALERT.
|
||||
int ret = QMessageBox::information(this, tr("PhotoShare"),
|
||||
tr("Please select an album before\n"
|
||||
"requesting to edit it!"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mAlbumSelected->mIsPhoto)
|
||||
{
|
||||
std::cerr << "PhotoDialog::OpenPhotoEditDialog() MAJOR ERROR!";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
|
||||
#if 0
|
||||
uint32_t flags = mAlbumSelected->mAlbumDetails.mMeta.mGroupFlags;
|
||||
|
||||
if (!(flags & OWN))
|
||||
{
|
||||
// ALERT.
|
||||
int ret = QMessageBox::information(this, tr("PhotoShare"),
|
||||
tr("Cannot Edit Someone Else's Album"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
OpenOrShowPhotoAddDialog();
|
||||
mAddDialog->loadAlbum(albumId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool PhotoDialog::matchesAlbumFilter(const RsPhotoAlbum &album)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
double PhotoDialog::AlbumScore(const RsPhotoAlbum &album)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
bool PhotoDialog::matchesPhotoFilter(const RsPhotoPhoto &photo)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
double PhotoDialog::PhotoScore(const RsPhotoPhoto &photo)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void PhotoDialog::insertPhotosForSelectedAlbum()
|
||||
{
|
||||
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
clearPhotos();
|
||||
|
||||
//std::list<std::string> albumIds;
|
||||
if (mAlbumSelected)
|
||||
{
|
||||
if (mAlbumSelected->mIsPhoto)
|
||||
{
|
||||
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() MAJOR ERROR!";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
|
||||
//albumIds.push_back(albumId);
|
||||
|
||||
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() AlbumId: " << albumId;
|
||||
std::cerr << std::endl;
|
||||
requestPhotoList(albumId);
|
||||
}
|
||||
//requestPhotoList(albumIds);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::clearAlbums()
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums()" << std::endl;
|
||||
|
||||
std::list<PhotoItem *> photoItems;
|
||||
std::list<PhotoItem *>::iterator pit;
|
||||
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
int count = alayout->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
QLayoutItem *litem = alayout->itemAt(i);
|
||||
if (!litem)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums() missing litem";
|
||||
std::cerr << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
PhotoItem *item = dynamic_cast<PhotoItem *>(litem->widget());
|
||||
if (item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums() item: " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
photoItems.push_back(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums() Found Child, which is not a PhotoItem???";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
{
|
||||
PhotoItem *item = *pit;
|
||||
alayout->removeWidget(item);
|
||||
delete item;
|
||||
}
|
||||
mAlbumSelected = NULL;
|
||||
|
||||
}
|
||||
|
||||
void PhotoDialog::clearPhotos()
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos()" << std::endl;
|
||||
|
||||
std::list<PhotoItem *> photoItems;
|
||||
std::list<PhotoItem *>::iterator pit;
|
||||
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
|
||||
int count = alayout->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
QLayoutItem *litem = alayout->itemAt(i);
|
||||
if (!litem)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos() missing litem";
|
||||
std::cerr << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
PhotoItem *item = dynamic_cast<PhotoItem *>(litem->widget());
|
||||
if (item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos() item: " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
photoItems.push_back(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos() Found Child, which is not a PhotoItem???";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
{
|
||||
PhotoItem *item = *pit;
|
||||
alayout->removeWidget(item);
|
||||
delete item;
|
||||
}
|
||||
|
||||
mPhotoSelected = NULL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void PhotoDialog::addAlbum(const RsPhotoAlbum &album)
|
||||
{
|
||||
std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl;
|
||||
|
||||
PhotoItem *item = new PhotoItem(this, album);
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
alayout->addWidget(item);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::addPhoto(const RsPhotoPhoto &photo)
|
||||
{
|
||||
std::cerr << "PhotoDialog::addPhoto() AlbumId: " << photo.mMeta.mGroupId;
|
||||
std::cerr << " PhotoId: " << photo.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsPhotoAlbum dummyAlbum;
|
||||
dummyAlbum.mSetFlags = 0;
|
||||
|
||||
PhotoItem *item = new PhotoItem(this, photo, dummyAlbum);
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
|
||||
alayout->addWidget(item);
|
||||
|
||||
}
|
||||
|
||||
void PhotoDialog::deletePhotoItem(PhotoItem *item, uint32_t type)
|
||||
{
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**************************** Request / Response Filling of Data ************************/
|
||||
|
||||
|
||||
void PhotoDialog::requestAlbumList()
|
||||
{
|
||||
|
||||
std::list<std::string> ids;
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, ids, 0);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::loadAlbumList(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadAlbumList()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::list<std::string> albumIds;
|
||||
rsPhoto->getGroupList(token, albumIds);
|
||||
|
||||
requestAlbumData(albumIds);
|
||||
|
||||
clearPhotos();
|
||||
|
||||
std::list<std::string>::iterator it;
|
||||
for(it = albumIds.begin(); it != albumIds.end(); it++)
|
||||
{
|
||||
requestPhotoList(*it);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::requestAlbumData(const std::list<std::string> &ids)
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, ids, 0);
|
||||
}
|
||||
|
||||
|
||||
bool PhotoDialog::loadAlbumData(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadAlbumData()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
clearAlbums();
|
||||
|
||||
bool moreData = true;
|
||||
while(moreData)
|
||||
{
|
||||
RsPhotoAlbum album;
|
||||
if (rsPhoto->getAlbum(token, album))
|
||||
{
|
||||
std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl;
|
||||
|
||||
PhotoItem *item = new PhotoItem(this, album);
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
alayout->addWidget(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
moreData = false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::requestPhotoList(const std::string &albumId)
|
||||
{
|
||||
|
||||
std::list<std::string> ids;
|
||||
ids.push_back(albumId);
|
||||
RsTokReqOptions opts;
|
||||
opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, ids, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void PhotoDialog::loadPhotoList(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadPhotoList()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
||||
std::list<std::string> photoIds;
|
||||
|
||||
rsPhoto->getMsgList(token, photoIds);
|
||||
requestPhotoData(photoIds);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::requestPhotoData(const std::list<std::string> &photoIds)
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, photoIds, 0);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::loadPhotoData(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadPhotoData()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
bool moreData = true;
|
||||
while(moreData)
|
||||
{
|
||||
RsPhotoPhoto photo;
|
||||
|
||||
if (rsPhoto->getPhoto(token, photo))
|
||||
{
|
||||
|
||||
std::cerr << "PhotoDialog::loadPhotoData() AlbumId: " << photo.mMeta.mGroupId;
|
||||
std::cerr << " PhotoId: " << photo.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
addPhoto(photo);
|
||||
}
|
||||
else
|
||||
{
|
||||
moreData = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/********************************/
|
||||
|
||||
void PhotoDialog::loadRequest(const TokenQueue *queue, const TokenRequestVEG &req)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadRequest()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (queue == mPhotoQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mType)
|
||||
{
|
||||
case TOKENREQ_GROUPINFO:
|
||||
switch(req.mAnsType)
|
||||
{
|
||||
case RS_TOKREQ_ANSTYPE_LIST:
|
||||
loadAlbumList(req.mToken);
|
||||
break;
|
||||
case RS_TOKREQ_ANSTYPE_DATA:
|
||||
loadAlbumData(req.mToken);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: GROUP: INVALID ANS TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case TOKENREQ_MSGINFO:
|
||||
switch(req.mAnsType)
|
||||
{
|
||||
case RS_TOKREQ_ANSTYPE_LIST:
|
||||
loadPhotoList(req.mToken);
|
||||
break;
|
||||
//case RS_TOKREQ_ANSTYPE_DATA:
|
||||
// loadPhotoData(req.mToken);
|
||||
// break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: MSG: INVALID ANS TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case TOKENREQ_MSGRELATEDINFO:
|
||||
switch(req.mAnsType)
|
||||
{
|
||||
case RS_TOKREQ_ANSTYPE_DATA:
|
||||
loadPhotoData(req.mToken);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: MSG: INVALID ANS TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: INVALID TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
//#include "gui/mainpage.h"
|
||||
#include "ui_PostedComments.h"
|
||||
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "PostedListDialog.h"
|
||||
#include "PostedComments.h"
|
||||
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
@ -40,21 +40,8 @@
|
|||
|
||||
|
||||
/****************************************************************
|
||||
* New Photo Display Widget.
|
||||
* Posted Dialog
|
||||
*
|
||||
* This has two 'lists'.
|
||||
* Top list shows Albums.
|
||||
* Lower list is photos from the selected Album.
|
||||
*
|
||||
* Notes:
|
||||
* Each Item will be an AlbumItem, which contains a thumbnail & random details.
|
||||
* We will limit Items to < 100. With a 'Filter to see more message.
|
||||
*
|
||||
* Thumbnails will come from Service.
|
||||
* Option to Share albums / pictures onward (if permissions allow).
|
||||
* Option to Download the albums to a specified directory. (is this required if sharing an album?)
|
||||
*
|
||||
* Will introduce a FullScreen SlideShow later... first get basics happening.
|
||||
*/
|
||||
|
||||
PostedDialog::PostedDialog(QWidget *parent)
|
||||
|
@ -74,587 +61,6 @@ PostedDialog::PostedDialog(QWidget *parent)
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
|
||||
|
||||
/** Constructor */
|
||||
PhotoDialog::PhotoDialog(QWidget *parent)
|
||||
: MainPage(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
mAddDialog = NULL;
|
||||
mAlbumSelected = NULL;
|
||||
mPhotoSelected = NULL;
|
||||
mSlideShow = NULL;
|
||||
|
||||
connect( ui.toolButton_NewAlbum, SIGNAL(clicked()), this, SLOT(OpenOrShowPhotoAddDialog()));
|
||||
connect( ui.toolButton_EditAlbum, SIGNAL(clicked()), this, SLOT(OpenPhotoEditDialog()));
|
||||
connect( ui.toolButton_SlideShow, SIGNAL(clicked()), this, SLOT(OpenSlideShow()));
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
|
||||
timer->start(1000);
|
||||
|
||||
|
||||
/* setup TokenQueue */
|
||||
mPhotoQueue = new TokenQueue(rsPhoto, this);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::notifySelection(PhotoItem *item, int ptype)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifySelection() from : " << ptype << " " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
switch(ptype)
|
||||
{
|
||||
default:
|
||||
case PHOTO_ITEM_TYPE_ALBUM:
|
||||
notifyAlbumSelection(item);
|
||||
break;
|
||||
case PHOTO_ITEM_TYPE_PHOTO:
|
||||
notifyPhotoSelection(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PhotoDialog::notifyAlbumSelection(PhotoItem *item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyAlbumSelection() from : " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (mAlbumSelected)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyAlbumSelection() unselecting old one : " << mAlbumSelected;
|
||||
std::cerr << std::endl;
|
||||
|
||||
mAlbumSelected->setSelected(false);
|
||||
}
|
||||
|
||||
mAlbumSelected = item;
|
||||
insertPhotosForSelectedAlbum();
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::notifyPhotoSelection(PhotoItem *item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyPhotoSelection() from : " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (mPhotoSelected)
|
||||
{
|
||||
std::cerr << "PhotoDialog::notifyPhotoSelection() unselecting old one : " << mPhotoSelected;
|
||||
std::cerr << std::endl;
|
||||
|
||||
mPhotoSelected->setSelected(false);
|
||||
}
|
||||
|
||||
mPhotoSelected = item;
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::checkUpdate()
|
||||
{
|
||||
/* update */
|
||||
if (!rsPhoto)
|
||||
return;
|
||||
|
||||
if (rsPhoto->updated())
|
||||
{
|
||||
//insertAlbums();
|
||||
requestAlbumList();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*************** New Photo Dialog ***************/
|
||||
|
||||
void PhotoDialog::OpenSlideShow()
|
||||
{
|
||||
|
||||
// TODO.
|
||||
if (!mAlbumSelected)
|
||||
{
|
||||
// ALERT.
|
||||
int ret = QMessageBox::information(this, tr("PhotoShare"),
|
||||
tr("Please select an album before\n"
|
||||
"requesting to edit it!"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mAlbumSelected->mIsPhoto)
|
||||
{
|
||||
std::cerr << "PhotoDialog::OpenPhotoEditDialog() MAJOR ERROR!";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
|
||||
|
||||
if (mSlideShow)
|
||||
{
|
||||
mSlideShow->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
mSlideShow = new PhotoSlideShow(NULL);
|
||||
mSlideShow->show();
|
||||
}
|
||||
mSlideShow->loadAlbum(albumId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*************** New Photo Dialog ***************/
|
||||
|
||||
void PhotoDialog::OpenOrShowPhotoAddDialog()
|
||||
{
|
||||
if (mAddDialog)
|
||||
{
|
||||
mAddDialog->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
mAddDialog = new PhotoAddDialog(NULL);
|
||||
mAddDialog->show();
|
||||
}
|
||||
mAddDialog->clearDialog();
|
||||
}
|
||||
|
||||
|
||||
/*************** Edit Photo Dialog ***************/
|
||||
|
||||
void PhotoDialog::OpenPhotoEditDialog()
|
||||
{
|
||||
/* check if we have an album selected */
|
||||
// THE TWO MessageBoxes - should be handled by disabling the Button!.
|
||||
// TODO.
|
||||
if (!mAlbumSelected)
|
||||
{
|
||||
// ALERT.
|
||||
int ret = QMessageBox::information(this, tr("PhotoShare"),
|
||||
tr("Please select an album before\n"
|
||||
"requesting to edit it!"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mAlbumSelected->mIsPhoto)
|
||||
{
|
||||
std::cerr << "PhotoDialog::OpenPhotoEditDialog() MAJOR ERROR!";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
|
||||
#if 0
|
||||
uint32_t flags = mAlbumSelected->mAlbumDetails.mMeta.mGroupFlags;
|
||||
|
||||
if (!(flags & OWN))
|
||||
{
|
||||
// ALERT.
|
||||
int ret = QMessageBox::information(this, tr("PhotoShare"),
|
||||
tr("Cannot Edit Someone Else's Album"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
OpenOrShowPhotoAddDialog();
|
||||
mAddDialog->loadAlbum(albumId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool PhotoDialog::matchesAlbumFilter(const RsPhotoAlbum &album)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
double PhotoDialog::AlbumScore(const RsPhotoAlbum &album)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
bool PhotoDialog::matchesPhotoFilter(const RsPhotoPhoto &photo)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
double PhotoDialog::PhotoScore(const RsPhotoPhoto &photo)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void PhotoDialog::insertPhotosForSelectedAlbum()
|
||||
{
|
||||
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
clearPhotos();
|
||||
|
||||
//std::list<std::string> albumIds;
|
||||
if (mAlbumSelected)
|
||||
{
|
||||
if (mAlbumSelected->mIsPhoto)
|
||||
{
|
||||
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() MAJOR ERROR!";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
|
||||
//albumIds.push_back(albumId);
|
||||
|
||||
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() AlbumId: " << albumId;
|
||||
std::cerr << std::endl;
|
||||
requestPhotoList(albumId);
|
||||
}
|
||||
//requestPhotoList(albumIds);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::clearAlbums()
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums()" << std::endl;
|
||||
|
||||
std::list<PhotoItem *> photoItems;
|
||||
std::list<PhotoItem *>::iterator pit;
|
||||
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
int count = alayout->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
QLayoutItem *litem = alayout->itemAt(i);
|
||||
if (!litem)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums() missing litem";
|
||||
std::cerr << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
PhotoItem *item = dynamic_cast<PhotoItem *>(litem->widget());
|
||||
if (item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums() item: " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
photoItems.push_back(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearAlbums() Found Child, which is not a PhotoItem???";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
{
|
||||
PhotoItem *item = *pit;
|
||||
alayout->removeWidget(item);
|
||||
delete item;
|
||||
}
|
||||
mAlbumSelected = NULL;
|
||||
|
||||
}
|
||||
|
||||
void PhotoDialog::clearPhotos()
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos()" << std::endl;
|
||||
|
||||
std::list<PhotoItem *> photoItems;
|
||||
std::list<PhotoItem *>::iterator pit;
|
||||
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
|
||||
int count = alayout->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
QLayoutItem *litem = alayout->itemAt(i);
|
||||
if (!litem)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos() missing litem";
|
||||
std::cerr << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
PhotoItem *item = dynamic_cast<PhotoItem *>(litem->widget());
|
||||
if (item)
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos() item: " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
photoItems.push_back(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "PhotoDialog::clearPhotos() Found Child, which is not a PhotoItem???";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
{
|
||||
PhotoItem *item = *pit;
|
||||
alayout->removeWidget(item);
|
||||
delete item;
|
||||
}
|
||||
|
||||
mPhotoSelected = NULL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void PhotoDialog::addAlbum(const RsPhotoAlbum &album)
|
||||
{
|
||||
std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl;
|
||||
|
||||
PhotoItem *item = new PhotoItem(this, album);
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
alayout->addWidget(item);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::addPhoto(const RsPhotoPhoto &photo)
|
||||
{
|
||||
std::cerr << "PhotoDialog::addPhoto() AlbumId: " << photo.mMeta.mGroupId;
|
||||
std::cerr << " PhotoId: " << photo.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsPhotoAlbum dummyAlbum;
|
||||
dummyAlbum.mSetFlags = 0;
|
||||
|
||||
PhotoItem *item = new PhotoItem(this, photo, dummyAlbum);
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
|
||||
alayout->addWidget(item);
|
||||
|
||||
}
|
||||
|
||||
void PhotoDialog::deletePhotoItem(PhotoItem *item, uint32_t type)
|
||||
{
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**************************** Request / Response Filling of Data ************************/
|
||||
|
||||
|
||||
void PhotoDialog::requestAlbumList()
|
||||
{
|
||||
|
||||
std::list<std::string> ids;
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, ids, 0);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::loadAlbumList(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadAlbumList()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::list<std::string> albumIds;
|
||||
rsPhoto->getGroupList(token, albumIds);
|
||||
|
||||
requestAlbumData(albumIds);
|
||||
|
||||
clearPhotos();
|
||||
|
||||
std::list<std::string>::iterator it;
|
||||
for(it = albumIds.begin(); it != albumIds.end(); it++)
|
||||
{
|
||||
requestPhotoList(*it);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::requestAlbumData(const std::list<std::string> &ids)
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, ids, 0);
|
||||
}
|
||||
|
||||
|
||||
bool PhotoDialog::loadAlbumData(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadAlbumData()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
clearAlbums();
|
||||
|
||||
bool moreData = true;
|
||||
while(moreData)
|
||||
{
|
||||
RsPhotoAlbum album;
|
||||
if (rsPhoto->getAlbum(token, album))
|
||||
{
|
||||
std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl;
|
||||
|
||||
PhotoItem *item = new PhotoItem(this, album);
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
alayout->addWidget(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
moreData = false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::requestPhotoList(const std::string &albumId)
|
||||
{
|
||||
|
||||
std::list<std::string> ids;
|
||||
ids.push_back(albumId);
|
||||
RsTokReqOptions opts;
|
||||
opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, ids, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void PhotoDialog::loadPhotoList(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadPhotoList()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
||||
std::list<std::string> photoIds;
|
||||
|
||||
rsPhoto->getMsgList(token, photoIds);
|
||||
requestPhotoData(photoIds);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::requestPhotoData(const std::list<std::string> &photoIds)
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
mPhotoQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, photoIds, 0);
|
||||
}
|
||||
|
||||
|
||||
void PhotoDialog::loadPhotoData(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadPhotoData()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
bool moreData = true;
|
||||
while(moreData)
|
||||
{
|
||||
RsPhotoPhoto photo;
|
||||
|
||||
if (rsPhoto->getPhoto(token, photo))
|
||||
{
|
||||
|
||||
std::cerr << "PhotoDialog::loadPhotoData() AlbumId: " << photo.mMeta.mGroupId;
|
||||
std::cerr << " PhotoId: " << photo.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
addPhoto(photo);
|
||||
}
|
||||
else
|
||||
{
|
||||
moreData = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/********************************/
|
||||
|
||||
void PhotoDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "PhotoDialog::loadRequest()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (queue == mPhotoQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mType)
|
||||
{
|
||||
case TOKENREQ_GROUPINFO:
|
||||
switch(req.mAnsType)
|
||||
{
|
||||
case RS_TOKREQ_ANSTYPE_LIST:
|
||||
loadAlbumList(req.mToken);
|
||||
break;
|
||||
case RS_TOKREQ_ANSTYPE_DATA:
|
||||
loadAlbumData(req.mToken);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: GROUP: INVALID ANS TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case TOKENREQ_MSGINFO:
|
||||
switch(req.mAnsType)
|
||||
{
|
||||
case RS_TOKREQ_ANSTYPE_LIST:
|
||||
loadPhotoList(req.mToken);
|
||||
break;
|
||||
//case RS_TOKREQ_ANSTYPE_DATA:
|
||||
// loadPhotoData(req.mToken);
|
||||
// break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: MSG: INVALID ANS TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case TOKENREQ_MSGRELATEDINFO:
|
||||
switch(req.mAnsType)
|
||||
{
|
||||
case RS_TOKREQ_ANSTYPE_DATA:
|
||||
loadPhotoData(req.mToken);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: MSG: INVALID ANS TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
std::cerr << "PhotoDialog::loadRequest() ERROR: INVALID TYPE";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************************** Request / Response Filling of Data ************************/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "retroshare-gui/mainpage.h"
|
||||
#include "ui_PostedDialog.h"
|
||||
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "PostedItem.h"
|
||||
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
@ -53,7 +53,7 @@ PostedItem::PostedItem(PostedHolder *parent, const RsPostedPost &post)
|
|||
//scoreLabel->setText(QString("1140"));
|
||||
|
||||
// exposed for testing...
|
||||
float score = rsPostedVEG->calcPostScore(post.mMeta);
|
||||
float score = 0;
|
||||
time_t now = time(NULL);
|
||||
|
||||
QString fromLabelTxt = QString(" Age: ") + QString::number(now - post.mMeta.mPublishTs);
|
||||
|
@ -62,7 +62,7 @@ PostedItem::PostedItem(PostedHolder *parent, const RsPostedPost &post)
|
|||
|
||||
uint32_t votes = 0;
|
||||
uint32_t comments = 0;
|
||||
rsPostedVEG->extractPostedCache(post.mMeta.mServiceString, votes, comments);
|
||||
//rsPosted->extractPostedCache(post.mMeta.mServiceString, votes, comments);
|
||||
scoreLabel->setText(QString::number(votes));
|
||||
QString commentLabel = QString("Comments: ") + QString::number(comments);
|
||||
commentLabel += QString(" Votes: ") + QString::number(votes);
|
||||
|
@ -87,247 +87,3 @@ void PostedItem::loadComments()
|
|||
std::cerr << std::endl;
|
||||
mParent->requestComments(mThreadId);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
PhotoItem::PhotoItem(PhotoHolder *parent, const RsPhotoAlbum &album)
|
||||
:QWidget(NULL), mParent(parent), mType(PHOTO_ITEM_TYPE_ALBUM)
|
||||
{
|
||||
setupUi(this);
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
mIsPhoto = false;
|
||||
setDummyText();
|
||||
updateAlbumText(album); // saves: mAlbumDetails = album;
|
||||
updateImage(album.mThumbnail);
|
||||
|
||||
setSelected(false);
|
||||
}
|
||||
|
||||
|
||||
PhotoItem::PhotoItem(PhotoHolder *parent, const RsPhotoPhoto &photo, const RsPhotoAlbum &album)
|
||||
:QWidget(NULL), mParent(parent), mType(PHOTO_ITEM_TYPE_PHOTO)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
mIsPhoto = true;
|
||||
|
||||
setDummyText();
|
||||
updatePhotoText(photo); // saves: mPhotoDetails = photo;
|
||||
updateAlbumText(album); // saves: mAlbumDetails = album;
|
||||
|
||||
updateImage(photo.mThumbnail);
|
||||
|
||||
setSelected(false);
|
||||
}
|
||||
|
||||
|
||||
PhotoItem::PhotoItem(PhotoHolder *parent, std::string path) // for new photos.
|
||||
:QWidget(NULL), mParent(parent), mType(PHOTO_ITEM_TYPE_NEW)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
setDummyText();
|
||||
mIsPhoto = true;
|
||||
|
||||
int width = 120;
|
||||
int height = 120;
|
||||
|
||||
//QPixmap qtn = QPixmap(QString::fromStdString(path)).scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
QPixmap qtn = QPixmap(QString::fromStdString(path)).scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
imgLabel->setPixmap(qtn);
|
||||
setSelected(false);
|
||||
}
|
||||
|
||||
void PhotoItem::updateParent(PhotoHolder *parent) // for external construction.
|
||||
{
|
||||
mParent = parent;
|
||||
}
|
||||
|
||||
|
||||
void PhotoItem::setDummyText()
|
||||
{
|
||||
titleLabel->setText(QString("Unknown"));
|
||||
fromBoldLabel->setText(QString("By:"));
|
||||
fromLabel->setText(QString("Unknown"));
|
||||
statusBoldLabel->setText(QString("Where:"));
|
||||
statusLabel->setText(QString("Unknown"));
|
||||
dateBoldLabel->setText(QString("When:"));
|
||||
dateLabel->setText(QString("Unknown"));
|
||||
}
|
||||
|
||||
|
||||
void PhotoItem::updateAlbumText(const RsPhotoAlbum &album)
|
||||
{
|
||||
mAlbumDetails = album;
|
||||
mAlbumDetails.mThumbnail.data = 0;
|
||||
updateText();
|
||||
}
|
||||
|
||||
void PhotoItem::updatePhotoText(const RsPhotoPhoto &photo)
|
||||
{
|
||||
// Save new Photo details.
|
||||
mPhotoDetails = photo;
|
||||
mPhotoDetails.mThumbnail.data = 0;
|
||||
updateText();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PhotoItem::updateText()
|
||||
{
|
||||
// SET Album Values first -> then overwrite with Photo Values.
|
||||
if (mAlbumDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_TITLE)
|
||||
{
|
||||
titleLabel->setText(QString::fromUtf8(mAlbumDetails.mMeta.mGroupName.c_str()));
|
||||
}
|
||||
|
||||
// This needs to be fixed!! TODO
|
||||
fromLabel->setText(QString::fromStdString(mAlbumDetails.mMeta.mGroupId));
|
||||
if (mAlbumDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_AUTHOR)
|
||||
{
|
||||
// This needs to be fixed!! TODO
|
||||
fromLabel->setText(QString::fromStdString(mAlbumDetails.mMeta.mGroupId));
|
||||
}
|
||||
|
||||
if (mAlbumDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHERE)
|
||||
{
|
||||
statusLabel->setText(QString::fromUtf8(mAlbumDetails.mWhere.c_str()));
|
||||
}
|
||||
|
||||
if (mAlbumDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHEN)
|
||||
{
|
||||
dateLabel->setText(QString::fromUtf8(mAlbumDetails.mWhen.c_str()));
|
||||
}
|
||||
|
||||
// NOW Photo Bits.
|
||||
if (mIsPhoto)
|
||||
{
|
||||
if (mPhotoDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_TITLE)
|
||||
{
|
||||
titleLabel->setText(QString::fromUtf8(mPhotoDetails.mMeta.mMsgName.c_str()));
|
||||
}
|
||||
|
||||
if (mPhotoDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_AUTHOR)
|
||||
{
|
||||
// This needs to be fixed!! TODO
|
||||
fromLabel->setText(QString::fromStdString(mPhotoDetails.mMeta.mAuthorId));
|
||||
}
|
||||
|
||||
if (mPhotoDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHERE)
|
||||
{
|
||||
statusLabel->setText(QString::fromUtf8(mPhotoDetails.mWhere.c_str()));
|
||||
}
|
||||
|
||||
if (mPhotoDetails.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHEN)
|
||||
{
|
||||
dateLabel->setText(QString::fromUtf8(mPhotoDetails.mWhen.c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PhotoItem::updateImage(const RsPhotoThumbnail &thumbnail)
|
||||
{
|
||||
if (thumbnail.data != NULL)
|
||||
{
|
||||
QPixmap qtn;
|
||||
qtn.loadFromData(thumbnail.data, thumbnail.size, thumbnail.type.c_str());
|
||||
imgLabel->setPixmap(qtn);
|
||||
}
|
||||
}
|
||||
|
||||
bool PhotoItem::getPhotoThumbnail(RsPhotoThumbnail &nail)
|
||||
{
|
||||
const QPixmap *tmppix = imgLabel->pixmap();
|
||||
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
if(!tmppix->isNull())
|
||||
{
|
||||
// send chan image
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
tmppix->save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
|
||||
RsPhotoThumbnail tmpnail;
|
||||
tmpnail.data = (uint8_t *) ba.data();
|
||||
tmpnail.size = ba.size();
|
||||
|
||||
nail.copyFrom(tmpnail);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
nail.data = NULL;
|
||||
nail.size = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void PhotoItem::removeItem()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "PhotoItem::removeItem()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
hide();
|
||||
if (mParent)
|
||||
{
|
||||
mParent->deletePhotoItem(this, mType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PhotoItem::setSelected(bool on)
|
||||
{
|
||||
mSelected = on;
|
||||
if (mSelected)
|
||||
{
|
||||
mParent->notifySelection(this, mType);
|
||||
frame->setStyleSheet("QFrame#frame{border: 2px solid #55CC55;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #55EE55, stop: 1 #CCCCCC);\nborder-radius: 10px}");
|
||||
}
|
||||
else
|
||||
{
|
||||
frame->setStyleSheet("QFrame#frame{border: 2px solid #CCCCCC;\nbackground: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EEEEEE, stop: 1 #CCCCCC);\nborder-radius: 10px}");
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
bool PhotoItem::isSelected()
|
||||
{
|
||||
return mSelected;
|
||||
}
|
||||
|
||||
|
||||
void PhotoItem::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
/* We can be very cunning here?
|
||||
* grab out position.
|
||||
* flag ourselves as selected.
|
||||
* then pass the mousePressEvent up for handling by the parent
|
||||
*/
|
||||
|
||||
QPoint pos = event->pos();
|
||||
|
||||
std::cerr << "PhotoItem::mousePressEvent(" << pos.x() << ", " << pos.y() << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
setSelected(true);
|
||||
|
||||
QWidget::mousePressEvent(event);
|
||||
}
|
||||
|
||||
|
||||
const QPixmap *PhotoItem::getPixmap()
|
||||
{
|
||||
return imgLabel->pixmap();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "ui_PostedItem.h"
|
||||
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
class RsPostedPost;
|
||||
class PostedItem;
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
|
||||
#include "gui/gxs/PostedGroupDialog.h"
|
||||
|
||||
//#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
@ -69,7 +68,7 @@ PostedListDialog::PostedListDialog(QWidget *parent)
|
|||
ui.setupUi(this);
|
||||
|
||||
/* Setup Queue */
|
||||
mPostedQueue = new TokenQueueVEG(rsPostedVEG, this);
|
||||
mPostedQueue = new TokenQueue(rsPosted->getTokenService(), this);
|
||||
|
||||
connect( ui.groupTreeWidget, SIGNAL( treeCustomContextMenuRequested( QPoint ) ), this, SLOT( groupListCustomPopupMenu( QPoint ) ) );
|
||||
|
||||
|
@ -144,12 +143,6 @@ void PostedListDialog::groupListCustomPopupMenu( QPoint /*point*/ )
|
|||
action = contextMnu.addAction(QIcon(":/images/message-mail.png"), tr("Mark all as unread"), this, SLOT(markMsgAsUnreadAll()));
|
||||
//action->setEnabled (!mCurrTopicId.empty () && IS_FORUM_SUBSCRIBED(subscribeFlags));
|
||||
|
||||
#ifdef DEBUG_FORUMS
|
||||
contextMnu.addSeparator();
|
||||
action = contextMnu.addAction("Generate mass data", this, SLOT(generateMassData()));
|
||||
action->setEnabled (!mCurrTopicId.empty() && IS_FORUM_SUBSCRIBED(subscribeFlags));
|
||||
#endif
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
|
@ -157,12 +150,12 @@ void PostedListDialog::updateDisplay()
|
|||
{
|
||||
std::list<std::string> groupIds;
|
||||
std::list<std::string>::iterator it;
|
||||
if (!rsPostedVEG)
|
||||
if (!rsPosted)
|
||||
return;
|
||||
|
||||
// TODO groupsChanged... HACK XXX.
|
||||
#if 0
|
||||
if ((rsPostedVEG->groupsChanged(groupIds)) || (rsPostedVEG->updated()))
|
||||
if ((rsPosted->groupsChanged(groupIds)) || (rsPosted->updated()))
|
||||
{
|
||||
/* update Forums List */
|
||||
insertGroups();
|
||||
|
@ -176,7 +169,7 @@ void PostedListDialog::updateDisplay()
|
|||
}
|
||||
#endif
|
||||
|
||||
if (rsPostedVEG->updated())
|
||||
if (rsPosted->updated())
|
||||
{
|
||||
/* update Forums List */
|
||||
insertGroups();
|
||||
|
@ -244,8 +237,6 @@ void PostedListDialog::sortButtonClicked( QAbstractButton *button )
|
|||
} else if (button == ui.topSortButton) {
|
||||
sortMode = RSPOSTED_VIEWMODE_TOP;
|
||||
}
|
||||
|
||||
rsPostedVEG->setViewMode(sortMode);
|
||||
}
|
||||
|
||||
|
||||
|
@ -275,7 +266,6 @@ void PostedListDialog::periodChanged( int index )
|
|||
periodMode = RSPOSTED_PERIOD_YEAR;
|
||||
break;
|
||||
}
|
||||
rsPostedVEG->setViewPeriod(periodMode);
|
||||
}
|
||||
|
||||
|
||||
|
@ -342,7 +332,7 @@ void PostedListDialog::requestGroupSummary()
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::list<std::string> ids;
|
||||
RsTokReqOptionsVEG opts;
|
||||
RsTokReqOptions opts;
|
||||
uint32_t token;
|
||||
mPostedQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, ids, POSTEDDIALOG_LISTING);
|
||||
}
|
||||
|
@ -353,7 +343,7 @@ void PostedListDialog::loadGroupSummary(const uint32_t &token)
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGroupMetaData> groupInfo;
|
||||
rsPostedVEG->getGroupSummary(token, groupInfo);
|
||||
rsPosted->getGroupSummary(token, groupInfo);
|
||||
|
||||
if (groupInfo.size() > 0)
|
||||
{
|
||||
|
@ -373,7 +363,7 @@ void PostedListDialog::loadGroupSummary(const uint32_t &token)
|
|||
|
||||
void PostedListDialog::requestGroupSummary_CurrentForum(const std::string &forumId)
|
||||
{
|
||||
RsTokReqOptionsVEG opts;
|
||||
RsTokReqOptions opts;
|
||||
|
||||
std::list<std::string> grpIds;
|
||||
grpIds.push_back(forumId);
|
||||
|
@ -391,7 +381,7 @@ void PostedListDialog::loadGroupSummary_CurrentForum(const uint32_t &token)
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGroupMetaData> groupInfo;
|
||||
rsPostedVEG->getGroupSummary(token, groupInfo);
|
||||
rsPosted->getGroupSummary(token, groupInfo);
|
||||
|
||||
if (groupInfo.size() == 1)
|
||||
{
|
||||
|
@ -452,7 +442,7 @@ void PostedListDialog::loadCurrentForumThreads(const std::string &forumId)
|
|||
|
||||
void PostedListDialog::requestGroupThreadData_InsertThreads(const std::string &groupId)
|
||||
{
|
||||
RsTokReqOptionsVEG opts;
|
||||
RsTokReqOptions opts;
|
||||
|
||||
opts.mOptions = RS_TOKREQOPT_MSG_THREAD | RS_TOKREQOPT_MSG_LATEST;
|
||||
|
||||
|
@ -466,7 +456,7 @@ void PostedListDialog::requestGroupThreadData_InsertThreads(const std::string &g
|
|||
//mPostedQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, POSTEDDIALOG_INSERTTHREADS);
|
||||
|
||||
// Do specific Posted Request....
|
||||
if (rsPostedVEG->requestRanking(token, groupId))
|
||||
if (rsPosted->requestRanking(token, groupId))
|
||||
{
|
||||
// get the Queue to handle response.
|
||||
mPostedQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_DATA, POSTEDDIALOG_INSERTTHREADS);
|
||||
|
@ -484,9 +474,9 @@ void PostedListDialog::loadGroupThreadData_InsertThreads(const uint32_t &token)
|
|||
{
|
||||
RsPostedPost post;
|
||||
// Old Format.
|
||||
//if (rsPostedVEG->getPost(token, post))
|
||||
//if ()
|
||||
|
||||
if (rsPostedVEG->getRankedPost(token, post))
|
||||
if (/*rsPosted->getPost(token, post)*/false)
|
||||
{
|
||||
std::cerr << "PostedListDialog::loadGroupThreadData_InsertThreads() MsgId: " << post.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
|
@ -559,7 +549,7 @@ void PostedListDialog::clearPosts()
|
|||
/*********************** **** **** **** ***********************/
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
||||
void PostedListDialog::loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req)
|
||||
void PostedListDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "PostedListDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
|
@ -600,78 +590,11 @@ void PostedListDialog::loadRequest(const TokenQueueVEG *queue, const TokenReques
|
|||
void PostedListDialog::groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo)
|
||||
{
|
||||
|
||||
groupItemInfo.id = QString::fromStdString(groupInfo.mGroupId);
|
||||
groupItemInfo.name = QString::fromUtf8(groupInfo.mGroupName.c_str());
|
||||
//groupItemInfo.description = QString::fromUtf8(groupInfo.forumDesc);
|
||||
groupItemInfo.popularity = groupInfo.mPop;
|
||||
groupItemInfo.lastpost = QDateTime::fromTime_t(groupInfo.mLastPost);
|
||||
|
||||
if (groupInfo.mGroupFlags & RS_DISTRIB_AUTHEN_REQ) {
|
||||
groupItemInfo.name += " (" + tr("AUTHD") + ")";
|
||||
groupItemInfo.icon = QIcon(IMAGE_FORUMAUTHD);
|
||||
} else {
|
||||
groupItemInfo.icon = QIcon(IMAGE_FORUM);
|
||||
}
|
||||
}
|
||||
|
||||
void PostedListDialog::insertGroupData(const std::list<RsGroupMetaData> &groupList)
|
||||
{
|
||||
std::list<RsGroupMetaData>::const_iterator it;
|
||||
|
||||
QList<GroupItemInfo> adminList;
|
||||
QList<GroupItemInfo> subList;
|
||||
QList<GroupItemInfo> popList;
|
||||
QList<GroupItemInfo> otherList;
|
||||
std::multimap<uint32_t, GroupItemInfo> popMap;
|
||||
|
||||
for (it = groupList.begin(); it != groupList.end(); it++) {
|
||||
/* sort it into Publish (Own), Subscribed, Popular and Other */
|
||||
uint32_t flags = it->mSubscribeFlags;
|
||||
|
||||
GroupItemInfo groupItemInfo;
|
||||
groupInfoToGroupItemInfo(*it, groupItemInfo);
|
||||
|
||||
if (flags & RSGXS_GROUP_SUBSCRIBE_ADMIN) {
|
||||
adminList.push_back(groupItemInfo);
|
||||
} else if (flags & RSGXS_GROUP_SUBSCRIBE_SUBSCRIBED) {
|
||||
/* subscribed forum */
|
||||
subList.push_back(groupItemInfo);
|
||||
} else {
|
||||
/* rate the others by popularity */
|
||||
popMap.insert(std::make_pair(it->mPop, groupItemInfo));
|
||||
}
|
||||
}
|
||||
|
||||
/* iterate backwards through popMap - take the top 5 or 10% of list */
|
||||
uint32_t popCount = 5;
|
||||
if (popCount < popMap.size() / 10)
|
||||
{
|
||||
popCount = popMap.size() / 10;
|
||||
}
|
||||
|
||||
uint32_t i = 0;
|
||||
uint32_t popLimit = 0;
|
||||
std::multimap<uint32_t, GroupItemInfo>::reverse_iterator rit;
|
||||
for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); rit++, i++) ;
|
||||
if (rit != popMap.rend()) {
|
||||
popLimit = rit->first;
|
||||
}
|
||||
|
||||
for (rit = popMap.rbegin(); rit != popMap.rend(); rit++) {
|
||||
if (rit->second.popularity < (int) popLimit) {
|
||||
otherList.append(rit->second);
|
||||
} else {
|
||||
popList.append(rit->second);
|
||||
}
|
||||
}
|
||||
|
||||
/* now we can add them in as a tree! */
|
||||
ui.groupTreeWidget->fillGroupItems(yourTopics, adminList);
|
||||
ui.groupTreeWidget->fillGroupItems(subscribedTopics, subList);
|
||||
ui.groupTreeWidget->fillGroupItems(popularTopics, popList);
|
||||
ui.groupTreeWidget->fillGroupItems(otherTopics, otherList);
|
||||
|
||||
// updateMessageSummaryList("");
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
|
|
@ -27,18 +27,18 @@
|
|||
#include "retroshare-gui/mainpage.h"
|
||||
#include "ui_PostedListDialog.h"
|
||||
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "gui/Posted/PostedItem.h"
|
||||
#include "gui/common/GroupTreeWidget.h"
|
||||
|
||||
#include "util/TokenQueueVEG.h"
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
#include "retroshare-gui/RsAutoUpdatePage.h"
|
||||
|
||||
class PostedListDialog : public RsAutoUpdatePage, public PostedHolder, public TokenResponseVEG
|
||||
class PostedListDialog : public RsAutoUpdatePage, public PostedHolder, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -90,7 +90,7 @@ void loadGroupThreadData_InsertThreads(const uint32_t &token);
|
|||
void insertGroupData(const std::list<RsGroupMetaData> &groupList);
|
||||
void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo);
|
||||
|
||||
void loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req);
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
|
||||
QTreeWidgetItem *yourTopics;
|
||||
|
@ -103,7 +103,7 @@ void groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &
|
|||
bool mThreadLoading;
|
||||
std::string mCurrTopicId;
|
||||
|
||||
TokenQueueVEG *mPostedQueue;
|
||||
TokenQueue *mPostedQueue;
|
||||
|
||||
/* UI - from Designer */
|
||||
Ui::PostedListDialog ui;
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#define GXSCOMMENTS_LOADTHREAD 1
|
||||
|
||||
// Temporarily make this specific.
|
||||
#include "retroshare/rspostedVEG.h"
|
||||
#include "retroshare/rsposted.h"
|
||||
|
||||
|
||||
GxsCommentTreeWidget::GxsCommentTreeWidget(QWidget *parent)
|
||||
|
@ -46,10 +46,10 @@ GxsCommentTreeWidget::GxsCommentTreeWidget(QWidget *parent)
|
|||
return;
|
||||
}
|
||||
|
||||
void GxsCommentTreeWidget::setup(RsTokenServiceVEG *service)
|
||||
void GxsCommentTreeWidget::setup(RsTokenService *service)
|
||||
{
|
||||
mRsService = service;
|
||||
mTokenQueue = new TokenQueueVEG(service, this);
|
||||
mTokenQueue = new TokenQueue(service, this);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -72,11 +72,11 @@ void GxsCommentTreeWidget::service_requestComments(std::string threadId)
|
|||
std::cerr << "GxsCommentTreeWidget::service_requestComments(" << threadId << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsTokReqOptionsVEG opts;
|
||||
RsTokReqOptions opts;
|
||||
|
||||
opts.mOptions = RS_TOKREQOPT_MSG_THREAD | RS_TOKREQOPT_MSG_LATEST;
|
||||
opts.mFlagsFilter = RSPOSTED_MSGTYPE_COMMENT;
|
||||
opts.mFlagsMask = RSPOSTED_MSGTYPE_COMMENT;
|
||||
// opts.mFlagsFilter = RSPOSTED_MSGTYPE_COMMENT;
|
||||
// opts.mFlagsMask = RSPOSTED_MSGTYPE_COMMENT;
|
||||
|
||||
std::list<std::string> msgIds;
|
||||
msgIds.push_back(threadId);
|
||||
|
@ -84,7 +84,7 @@ void GxsCommentTreeWidget::service_requestComments(std::string threadId)
|
|||
mThreadId = threadId;
|
||||
|
||||
uint32_t token;
|
||||
mTokenQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, GXSCOMMENTS_LOADTHREAD);
|
||||
// mTokenQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, GXSCOMMENTS_LOADTHREAD);
|
||||
}
|
||||
|
||||
|
||||
|
@ -211,49 +211,49 @@ void GxsCommentTreeWidget::service_loadThread(const uint32_t &token)
|
|||
std::cerr << "GxsCommentTreeWidget::service_loadThread() ERROR must be overloaded!";
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsPostedComment comment;
|
||||
while(rsPostedVEG->getComment(token, comment))
|
||||
{
|
||||
/* convert to a QTreeWidgetItem */
|
||||
std::cerr << "GxsCommentTreeWidget::service_loadThread() Got Comment: " << comment;
|
||||
std::cerr << std::endl;
|
||||
// RsPostedComment comment;
|
||||
// while(rsPosted->getComment(token, comment))
|
||||
// {
|
||||
// /* convert to a QTreeWidgetItem */
|
||||
// std::cerr << "GxsCommentTreeWidget::service_loadThread() Got Comment: " << comment;
|
||||
// std::cerr << std::endl;
|
||||
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||
QString text;
|
||||
// QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||
// QString text;
|
||||
|
||||
{
|
||||
QDateTime qtime;
|
||||
qtime.setTime_t(comment.mMeta.mPublishTs);
|
||||
// {
|
||||
// QDateTime qtime;
|
||||
// qtime.setTime_t(comment.mMeta.mPublishTs);
|
||||
|
||||
text = qtime.toString("yyyy-MM-dd hh:mm:ss");
|
||||
item->setText(PCITEM_COLUMN_DATE, text);
|
||||
}
|
||||
// text = qtime.toString("yyyy-MM-dd hh:mm:ss");
|
||||
// item->setText(PCITEM_COLUMN_DATE, text);
|
||||
// }
|
||||
|
||||
text = QString::fromUtf8(comment.mComment.c_str());
|
||||
item->setText(PCITEM_COLUMN_COMMENT, text);
|
||||
// text = QString::fromUtf8(comment.mComment.c_str());
|
||||
// item->setText(PCITEM_COLUMN_COMMENT, text);
|
||||
|
||||
text = QString::fromUtf8(comment.mMeta.mAuthorId.c_str());
|
||||
if (text.isEmpty())
|
||||
{
|
||||
item->setText(PCITEM_COLUMN_AUTHOR, tr("Anonymous"));
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setText(PCITEM_COLUMN_AUTHOR, text);
|
||||
}
|
||||
// text = QString::fromUtf8(comment.mMeta.mAuthorId.c_str());
|
||||
// if (text.isEmpty())
|
||||
// {
|
||||
// item->setText(PCITEM_COLUMN_AUTHOR, tr("Anonymous"));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item->setText(PCITEM_COLUMN_AUTHOR, text);
|
||||
// }
|
||||
|
||||
|
||||
text = QString::fromUtf8(comment.mMeta.mMsgId.c_str());
|
||||
item->setText(PCITEM_COLUMN_MSGID, text);
|
||||
// text = QString::fromUtf8(comment.mMeta.mMsgId.c_str());
|
||||
// item->setText(PCITEM_COLUMN_MSGID, text);
|
||||
|
||||
text = QString::fromUtf8(comment.mMeta.mParentId.c_str());
|
||||
item->setText(PCITEM_COLUMN_PARENTID, text);
|
||||
// text = QString::fromUtf8(comment.mMeta.mParentId.c_str());
|
||||
// item->setText(PCITEM_COLUMN_PARENTID, text);
|
||||
|
||||
text = QString::fromUtf8(comment.mMeta.mServiceString.c_str());
|
||||
item->setText(PCITEM_COLUMN_SERVSTRING, text);
|
||||
// text = QString::fromUtf8(comment.mMeta.mServiceString.c_str());
|
||||
// item->setText(PCITEM_COLUMN_SERVSTRING, text);
|
||||
|
||||
addItem(comment.mMeta.mMsgId, comment.mMeta.mParentId, item);
|
||||
}
|
||||
// addItem(comment.mMeta.mMsgId, comment.mMeta.mParentId, item);
|
||||
// }
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ QTreeWidgetItem *GxsCommentTreeWidget::service_createMissingItem(std::string par
|
|||
}
|
||||
|
||||
|
||||
void GxsCommentTreeWidget::loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req)
|
||||
void GxsCommentTreeWidget::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "GxsCommentTreeWidget::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <QTreeWidget>
|
||||
|
||||
#include "util/TokenQueueVEG.h"
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
/* indicies for search results item columns SR_ = Search Result */
|
||||
#define SR_NAME_COL 0
|
||||
|
@ -39,17 +39,17 @@
|
|||
|
||||
#define SR_ROLE_LOCAL Qt::UserRole
|
||||
|
||||
class GxsCommentTreeWidget : public QTreeWidget, public TokenResponseVEG
|
||||
class GxsCommentTreeWidget : public QTreeWidget, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GxsCommentTreeWidget(QWidget *parent = 0);
|
||||
void setup(RsTokenServiceVEG *service);
|
||||
void setup(RsTokenService *service);
|
||||
|
||||
void requestComments(std::string threadId);
|
||||
|
||||
void loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req);
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -73,8 +73,8 @@ protected:
|
|||
std::map<std::string, QTreeWidgetItem *> mLoadingMap;
|
||||
std::multimap<std::string, QTreeWidgetItem *> mPendingInsertMap;
|
||||
|
||||
TokenQueueVEG *mTokenQueue;
|
||||
RsTokenServiceVEG *mRsService;
|
||||
TokenQueue *mTokenQueue;
|
||||
RsTokenService *mRsService;
|
||||
|
||||
protected:
|
||||
//virtual QMimeData * mimeData ( const QList<QTreeWidgetItem *> items ) const;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "util/misc.h"
|
||||
#include "GxsGroupDialog.h"
|
||||
#include "gui/common/PeerDefs.h"
|
||||
#include "gxs/rsgxsflags.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -31,17 +32,31 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
// Control of Publish Signatures.
|
||||
#define RSGXS_GROUP_SIGN_PUBLISH_MASK 0x000000ff
|
||||
#define RSGXS_GROUP_SIGN_PUBLISH_ENCRYPTED 0x00000001
|
||||
#define RSGXS_GROUP_SIGN_PUBLISH_ALLSIGNED 0x00000002
|
||||
#define RSGXS_GROUP_SIGN_PUBLISH_THREADHEAD 0x00000004
|
||||
#define RSGXS_GROUP_SIGN_PUBLISH_NONEREQ 0x00000008
|
||||
|
||||
// Author Signature.
|
||||
#define RSGXS_GROUP_SIGN_AUTHOR_MASK 0x0000ff00
|
||||
#define RSGXS_GROUP_SIGN_AUTHOR_GPG 0x00000100
|
||||
#define RSGXS_GROUP_SIGN_AUTHOR_REQUIRED 0x00000200
|
||||
#define RSGXS_GROUP_SIGN_AUTHOR_IFNOPUBSIGN 0x00000400
|
||||
#define RSGXS_GROUP_SIGN_AUTHOR_NONE 0x00000800
|
||||
|
||||
#define GXSGROUP_NEWGROUPID 1
|
||||
#define GXSGROUP_LOADGROUP 2
|
||||
|
||||
/** Constructor */
|
||||
GxsGroupDialog::GxsGroupDialog(RsTokenServiceVEG *service, QWidget *parent)
|
||||
GxsGroupDialog::GxsGroupDialog(RsTokenService *service, QWidget *parent)
|
||||
: QDialog(parent), mRsService(service)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
mTokenQueue = new TokenQueueVEG(service, this);
|
||||
mTokenQueue = new TokenQueue(service, this);
|
||||
|
||||
// connect up the buttons.
|
||||
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelDialog( ) ) );
|
||||
|
@ -289,7 +304,7 @@ void GxsGroupDialog::existingGroup(std::string groupId, uint32_t mode)
|
|||
|
||||
/* request data */
|
||||
{
|
||||
RsTokReqOptionsVEG opts;
|
||||
RsTokReqOptions opts;
|
||||
|
||||
std::list<std::string> grpIds;
|
||||
grpIds.push_back(groupId);
|
||||
|
@ -391,7 +406,7 @@ void GxsGroupDialog::createGroup()
|
|||
meta.mSignFlags = getGroupSignFlags();
|
||||
|
||||
// These ones shouldn't be needed here - but will be used, until we have fully functional backend.
|
||||
meta.mSubscribeFlags = RSGXS_GROUP_SUBSCRIBE_ADMIN;
|
||||
meta.mSubscribeFlags = GXS_SERV::GROUP_SUBSCRIBE_ADMIN;
|
||||
meta.mPublishTs = time(NULL);
|
||||
|
||||
if (service_CreateGroup(token, meta))
|
||||
|
@ -528,19 +543,7 @@ void GxsGroupDialog::addGroupLogo()
|
|||
|
||||
void GxsGroupDialog::sendShareList(std::string groupId)
|
||||
{
|
||||
if (!mRsService)
|
||||
{
|
||||
std::cerr << "GxsGroupDialog::sendShareList() GXS Service not active";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ui.pubKeyShare_cb->isChecked())
|
||||
{
|
||||
std::list<std::string> shareList;
|
||||
ui.keyShareList->selectedSslIds(shareList, false);
|
||||
mRsService->groupShareKeys(groupId, shareList);
|
||||
}
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
|
@ -566,7 +569,6 @@ void GxsGroupDialog::loadNewGroupId(const uint32_t &token)
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGroupMetaData> groupInfo;
|
||||
mRsService->getGroupSummary(token, groupInfo);
|
||||
|
||||
if (groupInfo.size() == 1)
|
||||
{
|
||||
|
@ -605,7 +607,7 @@ void GxsGroupDialog::service_loadExistingGroup(const uint32_t &token)
|
|||
}
|
||||
|
||||
|
||||
void GxsGroupDialog::loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req)
|
||||
void GxsGroupDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "GxsGroupDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ui_GxsGroupDialog.h"
|
||||
|
||||
#include "util/TokenQueueVEG.h"
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
|
||||
/********
|
||||
|
@ -90,12 +90,12 @@ public:
|
|||
#define GXS_GROUP_DIALOG_SHOW_MODE 2
|
||||
#define GXS_GROUP_DIALOG_EDIT_MODE 3
|
||||
|
||||
class GxsGroupDialog : public QDialog, public TokenResponseVEG
|
||||
class GxsGroupDialog : public QDialog, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GxsGroupDialog(RsTokenServiceVEG *service, QWidget *parent = 0);
|
||||
GxsGroupDialog(RsTokenService *service, QWidget *parent = 0);
|
||||
|
||||
void setFlags(uint32_t enabledFlags, uint32_t readonlyFlags, uint32_t defaultFlags);
|
||||
void setMode(uint32_t mode);
|
||||
|
@ -105,7 +105,7 @@ public:
|
|||
void existingGroup(std::string groupId, uint32_t mode);
|
||||
|
||||
// Callback for all Loads.
|
||||
virtual void loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req);
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
|
||||
// Functions that can be overloaded for specific stuff.
|
||||
|
@ -159,8 +159,8 @@ private:
|
|||
|
||||
QPixmap picture;
|
||||
|
||||
RsTokenServiceVEG *mRsService;
|
||||
TokenQueueVEG *mTokenQueue;
|
||||
RsTokenService *mRsService;
|
||||
TokenQueue *mTokenQueue;
|
||||
|
||||
uint32_t mMode;
|
||||
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
|
||||
#include "PostedGroupDialog.h"
|
||||
|
||||
#include <retroshare/rspostedVEG.h>
|
||||
#include <retroshare/rsposted.h>
|
||||
#include <iostream>
|
||||
|
||||
PostedGroupDialog::PostedGroupDialog(QWidget *parent)
|
||||
:GxsGroupDialog(rsPostedVEG, parent)
|
||||
:GxsGroupDialog(rsPosted->getTokenService(), parent)
|
||||
{
|
||||
|
||||
// To start with we only have open forums - with distribution controls.
|
||||
|
@ -70,7 +70,7 @@ bool PostedGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaDa
|
|||
grp.mMeta = meta;
|
||||
//grp.mDescription = std::string(desc.toUtf8());
|
||||
|
||||
rsPostedVEG->submitGroup(token, grp, true);
|
||||
rsPosted->submitGroup(token, grp);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ void PostedGroupDialog::service_loadExistingGroup(const uint32_t &token)
|
|||
std::cerr << std::endl;
|
||||
|
||||
RsPostedGroup group;
|
||||
if (!rsPostedVEG->getGroup(token, group))
|
||||
if (!rsPosted->getGroup(token, group))
|
||||
{
|
||||
std::cerr << "PostedGroupDialog::service_loadExistingGroup() ERROR Getting Group";
|
||||
std::cerr << std::endl;
|
||||
|
|
|
@ -86,10 +86,6 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WFlags flags)
|
|||
//ui.stackPages->add(statisticDialog = new StatisticDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp));
|
||||
|
||||
//PhotoDialog *photoDialog = NULL;
|
||||
//ui.stackPages->add(photoDialog = new PhotoDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_PHOTO), tr("Photo View"), grp));
|
||||
|
||||
//GamesDialog *gamesDialog = NULL;
|
||||
//ui.stackPages->add(gamesDialog = new GamesDialog(ui.stackPages),
|
||||
// createPageAction(QIcon(IMAGE_GAMES), tr("Games Launcher"), grp));
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "util/TokenQueueV2.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include <iostream>
|
||||
|
||||
#include <QTimer>
|
||||
|
@ -32,13 +32,13 @@
|
|||
*****/
|
||||
|
||||
/** Constructor */
|
||||
TokenQueueV2::TokenQueueV2(RsTokenService *service, TokenResponseV2 *resp)
|
||||
TokenQueue::TokenQueue(RsTokenService *service, TokenResponse *resp)
|
||||
:QWidget(NULL), mService(service), mResponder(resp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool TokenQueueV2::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts, std::list<RsGxsGroupId>& ids, uint32_t usertype)
|
||||
bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, std::list<RsGxsGroupId>& ids, uint32_t usertype)
|
||||
{
|
||||
uint32_t basictype = TOKENREQ_GROUPINFO;
|
||||
mService->requestGroupInfo(token, anstype, opts, ids);
|
||||
|
@ -48,7 +48,7 @@ bool TokenQueueV2::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsT
|
|||
}
|
||||
|
||||
|
||||
bool TokenQueueV2::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts, uint32_t usertype)
|
||||
bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, uint32_t usertype)
|
||||
{
|
||||
uint32_t basictype = TOKENREQ_GROUPINFO;
|
||||
mService->requestGroupInfo(token, anstype, opts);
|
||||
|
@ -57,7 +57,7 @@ bool TokenQueueV2::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsT
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TokenQueueV2::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts, const GxsMsgReq& ids, uint32_t usertype)
|
||||
bool TokenQueue::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, const GxsMsgReq& ids, uint32_t usertype)
|
||||
{
|
||||
uint32_t basictype = TOKENREQ_MSGINFO;
|
||||
mService->requestMsgInfo(token, anstype, opts, ids);
|
||||
|
@ -67,7 +67,7 @@ bool TokenQueueV2::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTok
|
|||
}
|
||||
|
||||
|
||||
bool TokenQueueV2::requestMsgRelatedInfo(uint32_t &token, const RsTokReqOptionsV2 &opts, const RsGxsGrpMsgIdPair &msgId, uint32_t usertype)
|
||||
bool TokenQueue::requestMsgRelatedInfo(uint32_t &token, const RsTokReqOptions &opts, const RsGxsGrpMsgIdPair &msgId, uint32_t usertype)
|
||||
{
|
||||
uint32_t basictype = TOKENREQ_MSGINFO;
|
||||
uint32_t anstype = RS_TOKREQ_ANSTYPE_LIST; // always a list answer
|
||||
|
@ -78,7 +78,7 @@ bool TokenQueueV2::requestMsgRelatedInfo(uint32_t &token, const RsTokReqOptionsV
|
|||
}
|
||||
|
||||
|
||||
bool TokenQueueV2::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts,
|
||||
bool TokenQueue::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
const std::list<RsGxsGroupId> &grpIds, uint32_t usertype)
|
||||
{
|
||||
uint32_t basictype = TOKENREQ_MSGINFO;
|
||||
|
@ -89,13 +89,13 @@ bool TokenQueueV2::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTok
|
|||
}
|
||||
|
||||
|
||||
void TokenQueueV2::queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype)
|
||||
void TokenQueue::queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype)
|
||||
{
|
||||
std::cerr << "TokenQueueV2::queueRequest() Token: " << token << " Type: " << basictype;
|
||||
std::cerr << "TokenQueue::queueRequest() Token: " << token << " Type: " << basictype;
|
||||
std::cerr << " AnsType: " << anstype << " UserType: " << usertype;
|
||||
std::cerr << std::endl;
|
||||
|
||||
TokenRequestV2 req;
|
||||
TokenRequest req;
|
||||
req.mToken = token;
|
||||
req.mType = basictype;
|
||||
req.mAnsType = anstype;
|
||||
|
@ -113,7 +113,7 @@ void TokenQueueV2::queueRequest(uint32_t token, uint32_t basictype, uint32_t ans
|
|||
}
|
||||
}
|
||||
|
||||
void TokenQueueV2::doPoll(float dt)
|
||||
void TokenQueue::doPoll(float dt)
|
||||
{
|
||||
/* single shot poll */
|
||||
//mTrigger->singlesshot(dt * 1000);
|
||||
|
@ -121,11 +121,11 @@ void TokenQueueV2::doPoll(float dt)
|
|||
}
|
||||
|
||||
|
||||
void TokenQueueV2::pollRequests()
|
||||
void TokenQueue::pollRequests()
|
||||
{
|
||||
double pollPeriod = 1.0; // max poll period.
|
||||
|
||||
TokenRequestV2 req;
|
||||
TokenRequest req;
|
||||
|
||||
if(mRequests.size() > 0){
|
||||
req = mRequests.front();
|
||||
|
@ -148,7 +148,7 @@ void TokenQueueV2::pollRequests()
|
|||
}
|
||||
|
||||
|
||||
bool TokenQueueV2::checkForRequest(uint32_t token)
|
||||
bool TokenQueue::checkForRequest(uint32_t token)
|
||||
{
|
||||
/* check token */
|
||||
uint32_t status = mService->requestStatus(token);
|
||||
|
@ -157,9 +157,9 @@ bool TokenQueueV2::checkForRequest(uint32_t token)
|
|||
}
|
||||
|
||||
|
||||
void TokenQueueV2::loadRequest(const TokenRequestV2 &req)
|
||||
void TokenQueue::loadRequest(const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "TokenQueueV2::loadRequest(): ";
|
||||
std::cerr << "TokenQueue::loadRequest(): ";
|
||||
std::cerr << "Token: " << req.mToken << " Type: " << req.mType;
|
||||
std::cerr << " AnsType: " << req.mAnsType << " UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
|
@ -170,12 +170,12 @@ void TokenQueueV2::loadRequest(const TokenRequestV2 &req)
|
|||
}
|
||||
|
||||
|
||||
bool TokenQueueV2::cancelRequest(const uint32_t token)
|
||||
bool TokenQueue::cancelRequest(const uint32_t token)
|
||||
{
|
||||
/* cancel at lower level first */
|
||||
mService->cancelRequest(token);
|
||||
|
||||
std::list<TokenRequestV2>::iterator it;
|
||||
std::list<TokenRequest>::iterator it;
|
||||
|
||||
for(it = mRequests.begin(); it != mRequests.end(); it++)
|
||||
{
|
||||
|
@ -183,14 +183,14 @@ bool TokenQueueV2::cancelRequest(const uint32_t token)
|
|||
{
|
||||
mRequests.erase(it);
|
||||
|
||||
std::cerr << "TokenQueueV2::cancelRequest() Cleared Request: " << token;
|
||||
std::cerr << "TokenQueue::cancelRequest() Cleared Request: " << token;
|
||||
std::cerr << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
std::cerr << "TokenQueueV2::cancelRequest() Failed to Find Request: " << token;
|
||||
std::cerr << "TokenQueue::cancelRequest() Failed to Find Request: " << token;
|
||||
std::cerr << std::endl;
|
||||
|
||||
return false;
|
|
@ -41,9 +41,9 @@
|
|||
#define TOKENREQ_MSGRELATEDINFO 3
|
||||
|
||||
|
||||
class TokenQueueV2;
|
||||
class TokenQueue;
|
||||
|
||||
class TokenRequestV2
|
||||
class TokenRequest
|
||||
{
|
||||
public:
|
||||
uint32_t mToken;
|
||||
|
@ -54,12 +54,12 @@ class TokenRequestV2
|
|||
struct timeval mPollTs;
|
||||
};
|
||||
|
||||
class TokenResponseV2
|
||||
class TokenResponse
|
||||
{
|
||||
public:
|
||||
//virtual ~TokenResponse() { return; }
|
||||
// These Functions are overloaded to get results out.
|
||||
virtual void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req) = 0;
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -67,12 +67,12 @@ class TokenResponseV2
|
|||
* An important thing to note is that all requests are stacked (so FIFO)
|
||||
* This is to prevent overlapped loads on GXS UIs
|
||||
*/
|
||||
class TokenQueueV2: public QWidget
|
||||
class TokenQueue: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TokenQueueV2(RsTokenService *service, TokenResponseV2 *resp);
|
||||
TokenQueue(RsTokenService *service, TokenResponse *resp);
|
||||
|
||||
/* generic handling of token / response update behaviour */
|
||||
|
||||
|
@ -81,25 +81,25 @@ public:
|
|||
* @token the token to be redeem is assigned here
|
||||
*
|
||||
*/
|
||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts,
|
||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
std::list<RsGxsGroupId>& ids, uint32_t usertype);
|
||||
|
||||
|
||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts, uint32_t usertype);
|
||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, uint32_t usertype);
|
||||
|
||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts,
|
||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
const std::list<RsGxsGroupId>& grpIds, uint32_t usertype);
|
||||
|
||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsV2 &opts,
|
||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
||||
const GxsMsgReq& grpIds, uint32_t usertype);
|
||||
|
||||
bool requestMsgRelatedInfo(uint32_t &token, const RsTokReqOptionsV2 &opts, const RsGxsGrpMsgIdPair& msgId, uint32_t usertype);
|
||||
bool requestMsgRelatedInfo(uint32_t &token, const RsTokReqOptions &opts, const RsGxsGrpMsgIdPair& msgId, uint32_t usertype);
|
||||
|
||||
bool cancelRequest(const uint32_t token);
|
||||
|
||||
void queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype);
|
||||
bool checkForRequest(uint32_t token);
|
||||
void loadRequest(const TokenRequestV2 &req);
|
||||
void loadRequest(const TokenRequest &req);
|
||||
|
||||
protected:
|
||||
void doPoll(float dt);
|
||||
|
@ -109,10 +109,10 @@ private slots:
|
|||
|
||||
private:
|
||||
/* Info for Data Requests */
|
||||
std::list<TokenRequestV2> mRequests;
|
||||
std::list<TokenRequest> mRequests;
|
||||
|
||||
RsTokenService *mService;
|
||||
TokenResponseV2 *mResponder;
|
||||
TokenResponse *mResponder;
|
||||
|
||||
QTimer *mTrigger;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue