mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 23:55:35 -04:00
about 70% done with PhotoDialog
- can add album (with thumbnail!) - add photo (with photo!) - can subscribe, but not added to ui yet need to try some dummy msgs and bring up gxs_net git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5549 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
088e7d61fc
commit
9f20c75f83
33 changed files with 1493 additions and 311 deletions
|
@ -1,14 +1,90 @@
|
|||
#include <QPixmap>
|
||||
|
||||
#include "AlbumDialog.h"
|
||||
#include "ui_AlbumDialog.h"
|
||||
|
||||
AlbumDialog::AlbumDialog(QWidget *parent) :
|
||||
AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueueV2* photoQueue, RsPhotoV2* rs_Photo, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::AlbumDialog)
|
||||
ui(new Ui::AlbumDialog), mPhotoQueue(photoQueue), mRsPhoto(rs_Photo), mAlbum(album), mPhotoSelected(NULL)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
connect(ui->pushButton_PublishPhotos, SIGNAL(clicked()), this, SLOT(updateAlbumPhotos()));
|
||||
connect(ui->pushButton_DeletePhoto, SIGNAL(clicked()), this, SLOT(deletePhoto()));
|
||||
|
||||
mPhotoDrop = ui->scrollAreaWidgetContents;
|
||||
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));
|
||||
|
||||
QPixmap qtn;
|
||||
qtn.loadFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size, mAlbum.mThumbnail.type.c_str());
|
||||
ui->label_thumbNail->setPixmap(qtn);
|
||||
}
|
||||
|
||||
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