mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 08:05:18 -04:00
Added cleanup code for GXS services in rsinit (services now based in GXS_phase1 folder in .retroshare/ folder
disabled msg synchronisation by default through compilation #define (use GXS_ENABLE_MSG_SYNC to enable message sync) Finally removed v2 suffix from all photo components and filenames (please edit your libretroshare.pro file accordingly) git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5883 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
da39d1de77
commit
744a78b140
20 changed files with 2202 additions and 2179 deletions
|
@ -1,112 +1,112 @@
|
|||
#include <QPixmap>
|
||||
|
||||
#include "AlbumDialog.h"
|
||||
#include "ui_AlbumDialog.h"
|
||||
#include "gxs/rsgxsflags.h"
|
||||
|
||||
AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent) :
|
||||
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint),
|
||||
ui(new Ui::AlbumDialog), mRsPhoto(rs_Photo), mPhotoQueue(photoQueue), mAlbum(album), mPhotoSelected(NULL)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->headerFrame->setHeaderImage(QPixmap(":/images/kview_64.png"));
|
||||
ui->headerFrame->setHeaderText(tr("Album"));
|
||||
|
||||
connect(ui->pushButton_PublishPhotos, SIGNAL(clicked()), this, SLOT(updateAlbumPhotos()));
|
||||
connect(ui->pushButton_DeletePhoto, SIGNAL(clicked()), this, SLOT(deletePhoto()));
|
||||
|
||||
mPhotoDrop = ui->scrollAreaWidgetContents;
|
||||
|
||||
if(!(mAlbum.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN))
|
||||
{
|
||||
ui->scrollAreaPhotos->setEnabled(false);
|
||||
ui->pushButton_DeletePhoto->setEnabled(false);
|
||||
}
|
||||
mPhotoDrop->setPhotoItemHolder(this);
|
||||
|
||||
setUp();
|
||||
}
|
||||
|
||||
|
||||
void AlbumDialog::setUp()
|
||||
{
|
||||
ui->lineEdit_Title->setText(QString::fromStdString(mAlbum.mMeta.mGroupName));
|
||||
ui->lineEdit_Caption->setText(QString::fromStdString(mAlbum.mCaption));
|
||||
ui->lineEdit_Category->setText(QString::fromStdString(mAlbum.mCategory));
|
||||
ui->lineEdit_Identity->setText(QString::fromStdString(mAlbum.mMeta.mAuthorId));
|
||||
ui->lineEdit_Where->setText(QString::fromStdString(mAlbum.mWhere));
|
||||
ui->textEdit_description->setText(QString::fromStdString(mAlbum.mDescription));
|
||||
|
||||
|
||||
QPixmap qtn;
|
||||
qtn.loadFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size, mAlbum.mThumbnail.type.c_str());
|
||||
|
||||
if(mAlbum.mThumbnail.size != 0)
|
||||
{
|
||||
ui->label_thumbNail->setPixmap(qtn);
|
||||
}
|
||||
else
|
||||
{
|
||||
// display a default Album icon when album has no Thumbnail
|
||||
ui->label_thumbNail->setPixmap(QPixmap(":/images/album_default_128.png"));
|
||||
}
|
||||
}
|
||||
|
||||
void AlbumDialog::updateAlbumPhotos(){
|
||||
|
||||
QSet<PhotoItem*> photos;
|
||||
|
||||
mPhotoDrop->getPhotos(photos);
|
||||
|
||||
QSetIterator<PhotoItem*> sit(photos);
|
||||
|
||||
while(sit.hasNext())
|
||||
{
|
||||
PhotoItem* item = sit.next();
|
||||
uint32_t token;
|
||||
RsPhotoPhoto photo = item->getPhotoDetails();
|
||||
photo.mMeta.mGroupId = mAlbum.mMeta.mGroupId;
|
||||
mRsPhoto->submitPhoto(token, photo);
|
||||
mPhotoQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
void AlbumDialog::deletePhoto(){
|
||||
|
||||
if(mPhotoSelected)
|
||||
{
|
||||
mPhotoSelected->setSelected(false);
|
||||
mPhotoDrop->deletePhoto(mPhotoSelected);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AlbumDialog::editPhoto()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AlbumDialog::~AlbumDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AlbumDialog::notifySelection(PhotoShareItem *selection)
|
||||
{
|
||||
|
||||
PhotoItem* pItem = dynamic_cast<PhotoItem*>(selection);
|
||||
|
||||
if(mPhotoSelected == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
mPhotoSelected->setSelected(false);
|
||||
mPhotoSelected = pItem;
|
||||
}
|
||||
|
||||
mPhotoSelected->setSelected(true);
|
||||
}
|
||||
#include <QPixmap>
|
||||
|
||||
#include "AlbumDialog.h"
|
||||
#include "ui_AlbumDialog.h"
|
||||
#include "gxs/rsgxsflags.h"
|
||||
|
||||
AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhoto* rs_Photo, QWidget *parent) :
|
||||
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint),
|
||||
ui(new Ui::AlbumDialog), mRsPhoto(rs_Photo), mPhotoQueue(photoQueue), mAlbum(album), mPhotoSelected(NULL)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->headerFrame->setHeaderImage(QPixmap(":/images/kview_64.png"));
|
||||
ui->headerFrame->setHeaderText(tr("Album"));
|
||||
|
||||
connect(ui->pushButton_PublishPhotos, SIGNAL(clicked()), this, SLOT(updateAlbumPhotos()));
|
||||
connect(ui->pushButton_DeletePhoto, SIGNAL(clicked()), this, SLOT(deletePhoto()));
|
||||
|
||||
mPhotoDrop = ui->scrollAreaWidgetContents;
|
||||
|
||||
if(!(mAlbum.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN))
|
||||
{
|
||||
ui->scrollAreaPhotos->setEnabled(false);
|
||||
ui->pushButton_DeletePhoto->setEnabled(false);
|
||||
}
|
||||
mPhotoDrop->setPhotoItemHolder(this);
|
||||
|
||||
setUp();
|
||||
}
|
||||
|
||||
|
||||
void AlbumDialog::setUp()
|
||||
{
|
||||
ui->lineEdit_Title->setText(QString::fromStdString(mAlbum.mMeta.mGroupName));
|
||||
ui->lineEdit_Caption->setText(QString::fromStdString(mAlbum.mCaption));
|
||||
ui->lineEdit_Category->setText(QString::fromStdString(mAlbum.mCategory));
|
||||
ui->lineEdit_Identity->setText(QString::fromStdString(mAlbum.mMeta.mAuthorId));
|
||||
ui->lineEdit_Where->setText(QString::fromStdString(mAlbum.mWhere));
|
||||
ui->textEdit_description->setText(QString::fromStdString(mAlbum.mDescription));
|
||||
|
||||
|
||||
QPixmap qtn;
|
||||
qtn.loadFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size, mAlbum.mThumbnail.type.c_str());
|
||||
|
||||
if(mAlbum.mThumbnail.size != 0)
|
||||
{
|
||||
ui->label_thumbNail->setPixmap(qtn);
|
||||
}
|
||||
else
|
||||
{
|
||||
// display a default Album icon when album has no Thumbnail
|
||||
ui->label_thumbNail->setPixmap(QPixmap(":/images/album_default_128.png"));
|
||||
}
|
||||
}
|
||||
|
||||
void AlbumDialog::updateAlbumPhotos(){
|
||||
|
||||
QSet<PhotoItem*> photos;
|
||||
|
||||
mPhotoDrop->getPhotos(photos);
|
||||
|
||||
QSetIterator<PhotoItem*> sit(photos);
|
||||
|
||||
while(sit.hasNext())
|
||||
{
|
||||
PhotoItem* item = sit.next();
|
||||
uint32_t token;
|
||||
RsPhotoPhoto photo = item->getPhotoDetails();
|
||||
photo.mMeta.mGroupId = mAlbum.mMeta.mGroupId;
|
||||
mRsPhoto->submitPhoto(token, photo);
|
||||
mPhotoQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
void AlbumDialog::deletePhoto(){
|
||||
|
||||
if(mPhotoSelected)
|
||||
{
|
||||
mPhotoSelected->setSelected(false);
|
||||
mPhotoDrop->deletePhoto(mPhotoSelected);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AlbumDialog::editPhoto()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AlbumDialog::~AlbumDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AlbumDialog::notifySelection(PhotoShareItem *selection)
|
||||
{
|
||||
|
||||
PhotoItem* pItem = dynamic_cast<PhotoItem*>(selection);
|
||||
|
||||
if(mPhotoSelected == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
mPhotoSelected->setSelected(false);
|
||||
mPhotoSelected = pItem;
|
||||
}
|
||||
|
||||
mPhotoSelected->setSelected(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue