Initial refreshing and refactoring of photoshare

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5544 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2012-09-12 21:43:41 +00:00
parent b52f8dd2b1
commit 088e7d61fc
25 changed files with 755 additions and 3583 deletions

View File

@ -0,0 +1,48 @@
#include "AlbumCreateDialog.h"
#include "ui_AlbumCreateDialog.h"
#include "util/misc.h"
AlbumCreateDialog::AlbumCreateDialog(TokenQueueV2 *photoQueue, RsPhotoV2 *rs_photo, QWidget *parent):
QDialog(parent),
ui(new Ui::AlbumCreateDialog), mPhotoQueue(photoQueue), mRsPhoto(rs_photo)
{
ui->setupUi(this);
connect(ui->publishButton, SIGNAL(clicked()), this, SLOT(publishAlbum()));
}
AlbumCreateDialog::~AlbumCreateDialog()
{
delete ui;
}
void AlbumCreateDialog::publishAlbum()
{
// get fields for album to publish, publish and then exit dialog
RsPhotoAlbum album;
album.mCaption = ui->lineEdit_Caption_2->text().toStdString();
album.mPhotographer = ui->lineEdit_Photographer->text().toStdString();
album.mMeta.mGroupName = ui->lineEdit_Title_2->text().toStdString();
album.mDescription = ui->textEdit_Description->toPlainText().toStdString();
album.mWhere = ui->lineEdit_Where->text().toStdString();
uint32_t token;
mRsPhoto->submitAlbumDetails(token, album);
mPhotoQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
close();
}
void AlbumCreateDialog::addAlbumThumbnail()
{
QPixmap img = misc::getOpenThumbnailedPicture(this, tr("Load Album Thumbnail"), 64, 64);
if (img.isNull())
return;
mThumbNail = img;
// to show the selected
ui->AlbumThumbNail->setIcon(mThumbNail);
}

View File

@ -0,0 +1,35 @@
#ifndef ALBUMCREATEDIALOG_H
#define ALBUMCREATEDIALOG_H
#include <QDialog>
#include "util/TokenQueueV2.h"
#include "retroshare/rsphotoV2.h"
namespace Ui {
class AlbumCreateDialog;
}
class AlbumCreateDialog : public QDialog
{
Q_OBJECT
public:
explicit AlbumCreateDialog(TokenQueueV2* photoQueue, RsPhotoV2* rs_photo, QWidget *parent = 0);
~AlbumCreateDialog();
private slots:
void publishAlbum();
void addAlbumThumbnail();
private:
Ui::AlbumCreateDialog *ui;
TokenQueueV2* mPhotoQueue;
RsPhotoV2* mRsPhoto;
QPixmap mThumbNail;
};
#endif // ALBUMCREATEDIALOG_H

View File

@ -0,0 +1,304 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AlbumCreateDialog</class>
<widget class="QDialog" name="AlbumCreateDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>465</width>
<height>347</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_Headline">
<property name="font">
<font>
<pointsize>18</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Album Details</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Album Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_Title_2"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Category:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_Category_2">
<item>
<property name="text">
<string>Travel</string>
</property>
</item>
<item>
<property name="text">
<string>Holiday</string>
</property>
</item>
<item>
<property name="text">
<string>Friends</string>
</property>
</item>
<item>
<property name="text">
<string>Family</string>
</property>
</item>
<item>
<property name="text">
<string>Work</string>
</property>
</item>
<item>
<property name="text">
<string>Random</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QToolButton" name="AlbumThumbNail">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">
border: 2px solid white;
border-radius: 10px;
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/channels.png</normaloff>:/images/channels.png</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="captionLabel">
<property name="text">
<string>Caption:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Caption_2"/>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Photographer:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="lineEdit_Photographer"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2">
<widget class="QTextEdit" name="textEdit_Description"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Where:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="lineEdit_Where"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Share Options</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="comboBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Public</string>
</property>
</item>
<item>
<property name="text">
<string>All Friends</string>
</property>
</item>
<item>
<property name="text">
<string>Restricted</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="comboBox_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Resize Images (&lt; 1Mb)</string>
</property>
</item>
<item>
<property name="text">
<string>Resize Images (&lt; 10Mb)</string>
</property>
</item>
<item>
<property name="text">
<string>Send Original Images</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QComboBox" name="comboBox_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>No Comments Allowed</string>
</property>
</item>
<item>
<property name="text">
<string>Authenticated Comments</string>
</property>
</item>
<item>
<property name="text">
<string>Any Comments Allowed</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Publish with Identity</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>598</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="publishButton">
<property name="text">
<string>Publish Album</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,14 @@
#include "AlbumDialog.h"
#include "ui_AlbumDialog.h"
AlbumDialog::AlbumDialog(QWidget *parent) :
QWidget(parent),
ui(new Ui::AlbumDialog)
{
ui->setupUi(this);
}
AlbumDialog::~AlbumDialog()
{
delete ui;
}

View File

@ -0,0 +1,22 @@
#ifndef ALBUMDIALOG_H
#define ALBUMDIALOG_H
#include <QWidget>
namespace Ui {
class AlbumDialog;
}
class AlbumDialog : public QWidget
{
Q_OBJECT
public:
explicit AlbumDialog(QWidget *parent = 0);
~AlbumDialog();
private:
Ui::AlbumDialog *ui;
};
#endif // ALBUMDIALOG_H

View File

@ -0,0 +1,21 @@
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>AlbumDialog</class>
<widget class="QWidget" name="AlbumDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<pixmapfunction/>
<connections/>
</ui>

View File

@ -0,0 +1,29 @@
#include "AlbumItem.h"
#include "ui_AlbumItem.h"
AlbumItem::AlbumItem(const RsPhotoAlbum& album, QWidget *parent) :
QWidget(parent),
ui(new Ui::AlbumItem), mAlbum(album)
{
ui->setupUi(this);
setUp();
}
AlbumItem::~AlbumItem()
{
delete ui;
}
void AlbumItem::setUp()
{
ui->label_AlbumTitle->setText(QString::fromStdString(mAlbum.mMeta.mGroupName));
ui->label_Photographer->setText(QString::fromStdString(mAlbum.mPhotographer));
QPixmap qtn;
qtn.loadFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size, mAlbum.mThumbnail.type.c_str());
ui->label_Thumbnail->setPixmap(qtn);
}
RsPhotoAlbum AlbumItem::getAlbum()
{
return mAlbum;
}

View File

@ -0,0 +1,29 @@
#ifndef ALBUMITEM_H
#define ALBUMITEM_H
#include <QWidget>
#include "string.h"
#include "retroshare/rsphotoV2.h"
namespace Ui {
class AlbumItem;
}
class AlbumItem : public QWidget
{
Q_OBJECT
public:
explicit AlbumItem(const RsPhotoAlbum& album, QWidget *parent = 0);
~AlbumItem();
RsPhotoAlbum getAlbum();
private:
void setUp();
private:
Ui::AlbumItem *ui;
RsPhotoAlbum mAlbum;
};
#endif // ALBUMITEM_H

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AlbumItem</class>
<widget class="QWidget" name="AlbumItem">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>221</width>
<height>224</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_Thumbnail">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="AlbumTitle">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Album Title:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Photographer:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_AlbumTitle">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Photographer">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,663 +0,0 @@
/*
* Retroshare Photo Plugin.
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "gui/PhotoShare/PhotoAddDialog.h"
#include "gui/PhotoShare/PhotoDetailsDialog.h"
#include "gui/PhotoShare/PhotoDrop.h"
#include <iostream>
/** Constructor */
PhotoAddDialog::PhotoAddDialog(TokenQueueV2 *parentQueue, QWidget *parent)
: QWidget(parent), mParentQueue(parentQueue)
{
ui.setupUi(this);
connect(ui.scrollAreaWidgetContents, SIGNAL( buttonStatus( uint32_t ) ), this, SLOT( updateMoveButtons( uint32_t ) ) );
connect(ui.pushButton_ShiftLeft, SIGNAL( clicked( void ) ), ui.scrollAreaWidgetContents, SLOT( moveLeft( void ) ) );
connect(ui.pushButton_ShiftRight, SIGNAL( clicked( void ) ), ui.scrollAreaWidgetContents, SLOT( moveRight( void ) ) );
connect(ui.pushButton_EditPhotoDetails, SIGNAL( clicked( void ) ), this, SLOT( showPhotoDetails( void ) ) );
connect(ui.pushButton_EditAlbumDetails, SIGNAL( clicked( void ) ), this, SLOT( showAlbumDetails( void ) ) );
connect(ui.pushButton_DeleteAlbum, SIGNAL( clicked( void ) ), this, SLOT( deleteAlbum( void ) ) );
connect(ui.pushButton_DeletePhoto, SIGNAL( clicked( void ) ), this, SLOT( deletePhoto( void ) ) );
connect(ui.pushButton_Publish, SIGNAL( clicked( void ) ), this, SLOT( publishAlbum( void ) ) );
mPhotoDetails = NULL;
mPhotoQueue = new TokenQueueV2(rsPhotoV2->getTokenService(), this);
ui.AlbumDrop->setSingleImage();
connect(ui.AlbumDrop, SIGNAL( photosChanged( void ) ), this, SLOT( albumImageChanged( void ) ) );
connect(ui.scrollAreaWidgetContents, SIGNAL( photosChanged( void ) ), this, SLOT( photoImageChanged( void ) ) );
}
void PhotoAddDialog::updateMoveButtons(uint32_t status)
{
std::cerr << "PhotoAddDialog::updateMoveButtons(" << status << ")";
std::cerr << std::endl;
switch(status)
{
case PHOTO_SHIFT_NO_BUTTONS:
ui.pushButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(false);
break;
case PHOTO_SHIFT_LEFT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(false);
break;
case PHOTO_SHIFT_RIGHT_ONLY:
ui.pushButton_ShiftLeft->setEnabled(false);
ui.pushButton_ShiftRight->setEnabled(true);
break;
case PHOTO_SHIFT_BOTH:
ui.pushButton_ShiftLeft->setEnabled(true);
ui.pushButton_ShiftRight->setEnabled(true);
break;
}
}
bool PhotoAddDialog::updateAlbumDetails(const RsPhotoAlbum &album)
{
std::cerr << "PhotoAddDialog::updateAlbumDetails()";
std::cerr << " (Copy data to mAlbumData + Add PhotoItem)";
std::cerr << std::endl;
// cleanup old image first.
mAlbumData.mThumbnail.deleteImage();
mAlbumData = album;
// copy photo too.
mAlbumData.mThumbnail.data = 0;
mAlbumData.mThumbnail.copyFrom(album.mThumbnail);
/* show iterate through all the photos and update them too - except normally they haven't arrived yet */
ui.lineEdit_Title->setText(QString::fromUtf8(album.mMeta.mGroupName.c_str()));
ui.lineEdit_Caption->setText(QString::fromUtf8(album.mCaption.c_str()));
ui.lineEdit_Where->setText(QString::fromUtf8(album.mWhere.c_str()));
ui.lineEdit_When->setText(QString::fromUtf8(album.mWhen.c_str()));
PhotoItem *item = new PhotoItem(NULL, mAlbumData);
ui.AlbumDrop->addPhotoItem(item);
// called via callback AlbumChanged.
//setAlbumDataToPhotos();
return true;
}
bool PhotoAddDialog::setAlbumDataToPhotos()
{
std::cerr << "PhotoAddDialog::setAlbumDataToPhotos()";
std::cerr << std::endl;
int photoCount = ui.scrollAreaWidgetContents->getPhotoCount();
for(int i = 0; i < photoCount; i++)
{
PhotoItem *item = ui.scrollAreaWidgetContents->getPhotoIdx(i);
item->updateAlbumText(mAlbumData);
}
return true;
}
void PhotoAddDialog::showPhotoDetails()
{
std::cerr << "PhotoAddDialog::showPhotoDetails()";
std::cerr << std::endl;
PhotoItem *item = ui.scrollAreaWidgetContents->getSelectedPhotoItem();
if (item)
{
if (!mPhotoDetails)
{
mPhotoDetails = new PhotoDetailsDialog(NULL);
connect(mPhotoDetails, SIGNAL( editingDone( void ) ), this, SLOT( editingStageDone( void ) ) );
}
mPhotoDetails->setPhotoItem(item);
mPhotoDetails->show();
mEditingModeAlbum = false;
}
}
void PhotoAddDialog::showAlbumDetails()
{
std::cerr << "PhotoAddDialog::showAlbumDetails()";
std::cerr << std::endl;
/* grab the image from the AlbumDrop */
PhotoItem *item = NULL;
if (ui.AlbumDrop->getPhotoCount() > 0)
{
item = ui.AlbumDrop->getPhotoIdx(0);
}
if (item)
{
if (!mPhotoDetails)
{
mPhotoDetails = new PhotoDetailsDialog(NULL);
connect(mPhotoDetails, SIGNAL( editingDone( void ) ), this, SLOT( editingStageDone( void ) ) );
}
mPhotoDetails->setPhotoItem(item);
mPhotoDetails->show();
mEditingModeAlbum = true;
}
else
{
std::cerr << "PhotoAddDialog::showAlbumDetails() PhotoItem Invalid";
std::cerr << std::endl;
}
}
/* Callback when AlbumDrop gets new image */
void PhotoAddDialog::albumImageChanged()
{
std::cerr << "PhotoAddDialog::albumImageChanged()";
std::cerr << std::endl;
/* must update the data from the reference stuff */
PhotoItem *item = NULL;
if (ui.AlbumDrop->getPhotoCount() > 0)
{
item = ui.AlbumDrop->getPhotoIdx(0);
}
if (!item)
{
std::cerr << "PhotoAddDialog::albumImageChanged() ERROR no Album PhotoItem";
std::cerr << std::endl;
return;
}
std::cerr << "PhotoAddDialog::albumImageChanged() PRE: AlbumDrop: " << item->mAlbumDetails;
std::cerr << std::endl;
std::cerr << "PhotoAddDialog::albumImageChanged() PRE: mAlbumData: " << mAlbumData;
std::cerr << std::endl;
item->mIsPhoto = false; // Force to Album mode.
/* now AlbumDrop has the image, but AlbumData has the other stuff */
item->getPhotoThumbnail(mAlbumData.mThumbnail);
item->updateAlbumText(mAlbumData);
/* if we are in editing mode -> update it */
if ((mEditingModeAlbum) && (mPhotoDetails))
{
std::cerr << "PhotoAddDialog::albumImageChanged() Updating PhotoDetails -> PhotoItem";
std::cerr << std::endl;
mPhotoDetails->setPhotoItem(item);
}
std::cerr << "PhotoAddDialog::albumImageChanged() POST: AlbumDrop: " << item->mAlbumDetails;
std::cerr << std::endl;
std::cerr << "PhotoAddDialog::albumImageChanged() POST: mAlbumData: " << mAlbumData;
std::cerr << std::endl;
}
/* This is called back once PhotoDetailsDialog Finishes */
void PhotoAddDialog::editingStageDone()
{
std::cerr << "PhotoAddDialog::editingStageDone()";
std::cerr << std::endl;
if (mEditingModeAlbum)
{
/* need to resolve Album Data, repopulate entries
*/
/* grab the image from the AlbumDrop (This is where PhotoDetailsDialog stores the data) */
PhotoItem *item = NULL;
if (ui.AlbumDrop->getPhotoCount() > 0)
{
item = ui.AlbumDrop->getPhotoIdx(0);
}
if (!item)
{
std::cerr << "PhotoAddDialog::editingStageDone() ERROR no Album PhotoItem";
std::cerr << std::endl;
}
/* Total Hack here Copy from AlbumDrop to Reference Data */
// cleanup old image first.
mAlbumData.mThumbnail.deleteImage();
mAlbumData = item->mAlbumDetails;
item->getPhotoThumbnail(mAlbumData.mThumbnail);
// Push Back data -> to trigger Text Update.
item->updateAlbumText(mAlbumData);
mEditingModeAlbum = false;
// Update GUI too.
ui.lineEdit_Title->setText(QString::fromUtf8(mAlbumData.mMeta.mGroupName.c_str()));
ui.lineEdit_Caption->setText(QString::fromUtf8(mAlbumData.mCaption.c_str()));
ui.lineEdit_Where->setText(QString::fromUtf8(mAlbumData.mWhere.c_str()));
ui.lineEdit_When->setText(QString::fromUtf8(mAlbumData.mWhen.c_str()));
}
else
{
std::cerr << "PhotoAddDialog::editingStageDone() ERROR not EditingModeAlbum";
std::cerr << std::endl;
}
// This forces item update -> though the AlbumUpdate is only needed if we edited Album.
setAlbumDataToPhotos();
}
/* Callback when PhotoDrop gets new image */
void PhotoAddDialog::photoImageChanged()
{
setAlbumDataToPhotos();
}
void PhotoAddDialog::publishAlbum()
{
std::cerr << "PhotoAddDialog::publishAlbum()";
std::cerr << std::endl;
/* we need to iterate through each photoItem, and extract the details */
RsPhotoAlbum album = mAlbumData;
album.mThumbnail.data = 0;
album.mShareOptions.mShareType = 0;
album.mShareOptions.mShareGroupId = "unknown";
album.mShareOptions.mPublishKey = "unknown";
album.mShareOptions.mCommentMode = 0;
album.mShareOptions.mResizeMode = 0;
album.mMeta.mGroupName = ui.lineEdit_Title->text().toStdString();
album.mCategory = "Unknown";
album.mCaption = ui.lineEdit_Caption->text().toStdString();
album.mWhere = ui.lineEdit_Where->text().toStdString();
album.mWhen = ui.lineEdit_When->text().toStdString();
/* grab the image from the AlbumDrop */
if (ui.AlbumDrop->getPhotoCount() > 0)
{
PhotoItem *item = ui.AlbumDrop->getPhotoIdx(0);
item->getPhotoThumbnail(album.mThumbnail);
}
// For the moment, only submit albums Once.
if (mAlbumEdit)
{
std::cerr << "PhotoAddDialog::publishAlbum() AlbumEdit Mode";
std::cerr << std::endl;
/* call publishPhotos directly */
publishPhotos(album.mMeta.mGroupId);
return;
}
std::cerr << "PhotoAddDialog::publishAlbum() New Album Mode Submitting.....";
std::cerr << std::endl;
uint32_t token;
rsPhotoV2->submitAlbumDetails(token, album);
mPhotoQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
}
void PhotoAddDialog::publishPhotos(std::string albumId)
{
/* now have path and album id */
int photoCount = ui.scrollAreaWidgetContents->getPhotoCount();
for(int i = 0; i < photoCount; i++)
{
RsPhotoPhoto photo;
PhotoItem *item = ui.scrollAreaWidgetContents->getPhotoIdx(i);
if (!item->mIsPhoto)
{
std::cerr << "PhotoAddDialog::publishAlbum() MAJOR ERROR!";
std::cerr << std::endl;
}
photo = item->mPhotoDetails;
photo.mThumbnail.data = 0; // do proper data copy.
item->getPhotoThumbnail(photo.mThumbnail);
bool isNewPhoto = false;
bool isModifiedPhoto = false;
if (mAlbumEdit)
{
// can have modFlags and be New... so the order is important.
if (photo.mMeta.mGroupId.length() < 1)
{
/* new photo - flag in mods */
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_PHOTO;
photo.mMeta.mGroupId = albumId;
isNewPhoto = true;
}
else if (photo.mModFlags)
{
isModifiedPhoto = true;
}
}
else
{
/* new album - update GroupId, all photos are new */
photo.mMeta.mGroupId = albumId;
isNewPhoto = true;
}
photo.mOrder = i;
std::cerr << "PhotoAddDialog::publishAlbum() Photo(" << i << ")";
std::cerr << " mSetFlags: " << photo.mSetFlags;
std::cerr << " mModFlags: " << photo.mModFlags;
std::cerr << std::endl;
#if 0
/* scale photo if needed */
if (album.mShareOptions.mResizeMode)
{
/* */
}
#endif
/* save image to album path */
photo.path = "unknown";
uint32_t token;
std::cerr << "PhotoAddDialog::publishAlbum() Photo(" << i << ") ";
std::cerr << "Is Updated";
rsPhotoV2->submitPhoto(token, photo);
mPhotoQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
std::cerr << std::endl;
}
clearDialog();
hide();
}
void PhotoAddDialog::deleteAlbum()
{
std::cerr << "PhotoAddDialog::deleteAlbum() Not Implemented Yet";
std::cerr << std::endl;
}
void PhotoAddDialog::deletePhoto()
{
std::cerr << "PhotoAddDialog::deletePhoto() Not Implemented Yet";
std::cerr << std::endl;
}
void PhotoAddDialog::clearDialog()
{
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;
}
void PhotoAddDialog::loadAlbum(const std::string &albumId)
{
/* much like main load fns */
clearDialog();
mAlbumEdit = true;
RsTokReqOptionsV2 opts;
uint32_t token;
std::list<RsGxsGroupId> albumIds;
albumIds.push_back(albumId);
// We need both Album and Photo Data.
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
mPhotoQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, albumIds, 0);
}
bool PhotoAddDialog::loadPhotoData(const uint32_t &token)
{
std::cerr << "PhotoAddDialog::loadPhotoData()";
std::cerr << std::endl;
PhotoResult res;
rsPhotoV2->getPhoto(token, res);
PhotoResult::iterator mit = res.begin();
for(; mit != res.end(); mit++)
{
std::vector<RsPhotoPhoto>& photoV = mit->second;
std::vector<RsPhotoPhoto>::iterator vit = photoV.begin();
for(; vit != photoV.end(); vit++)
{
RsPhotoPhoto& photo = *vit;
PhotoItem *item = new PhotoItem(NULL, photo, mAlbumData);
ui.scrollAreaWidgetContents->addPhotoItem(item);
std::cerr << "PhotoAddDialog::loadPhotoData() AlbumId: " << photo.mMeta.mGroupId;
std::cerr << " PhotoId: " << photo.mMeta.mMsgId;
std::cerr << std::endl;
}
}
return true;
}
bool PhotoAddDialog::loadAlbumData(const uint32_t &token)
{
std::cerr << "PhotoAddDialog::loadAlbumData()";
std::cerr << std::endl;
std::vector<RsPhotoAlbum> albums;
rsPhotoV2->getAlbum(token, albums);
std::vector<RsPhotoAlbum>::iterator vit = albums.begin();
GxsMsgReq req;
for(; vit != albums.end(); vit++)
{
RsPhotoAlbum& album = *vit;
std::cerr << "PhotoAddDialog::loadAlbumData() AlbumId: " << album.mMeta.mGroupId << std::endl;
updateAlbumDetails(album);
uint32_t token;
std::list<std::string> albumIds;
albumIds.push_back(album.mMeta.mGroupId);
req[album.mMeta.mGroupId] = std::vector<RsGxsMessageId>();
}
RsTokReqOptionsV2 opts;
opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
uint32_t t;
mPhotoQueue->requestMsgInfo(t, RS_TOKREQ_ANSTYPE_DATA, opts, req, 0);
return true;
}
bool PhotoAddDialog::loadCreatedAlbum(const uint32_t &token)
{
std::cerr << "PhotoAddDialog::loadCreatedAlbum()";
std::cerr << std::endl;
std::list<RsGroupMetaData> groupInfo;
if (!rsPhotoV2->getGroupSummary(token, groupInfo))
{
std::cerr << "PhotoAddDialog::loadCreatedAlbum() ERROR Getting MetaData";
std::cerr << std::endl;
return false;
}
if (groupInfo.size() != 1)
{
std::cerr << "PhotoAddDialog::loadCreatedAlbum() ERROR Too much Info";
std::cerr << std::endl;
return false;
}
std::cerr << "PhotoAddDialog::loadCreatedAlbum() publishing Photos";
std::cerr << std::endl;
publishPhotos(groupInfo.front().mGroupId);
return true;
}
void PhotoAddDialog::acknowledgeGroup(const uint32_t &token)
{
RsGxsGroupId grpId;
rsPhotoV2->acknowledgeGrp(token, grpId);
if(!grpId.empty())
{
std::list<RsGxsGroupId> grpIds;
grpIds.push_back(grpId);
RsTokReqOptionsV2 opts;
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
uint32_t reqToken;
// request for self
mPhotoQueue->requestGroupInfo(reqToken, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, 0);
// also request for parent
mParentQueue->requestGroupInfo(reqToken, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, 0);
}
}
void PhotoAddDialog::acknowledgeMessage(const uint32_t &token)
{
std::pair<RsGxsGroupId, RsGxsMessageId> p;
rsPhotoV2->acknowledgeMsg(token, p);
if(!p.first.empty())
{
GxsMsgReq req;
std::vector<RsGxsMessageId> v;
v.push_back(p.second);
req[p.first] = v;
RsTokReqOptionsV2 opts;
opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
uint32_t reqToken;
mPhotoQueue->requestMsgInfo(reqToken, RS_TOKREQ_ANSTYPE_DATA, opts, req, 0);
mParentQueue->requestMsgInfo(reqToken, RS_TOKREQ_ANSTYPE_DATA, opts, req, 0);
}
}
void PhotoAddDialog::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &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_DATA:
loadAlbumData(req.mToken);
break;
case RS_TOKREQ_ANSTYPE_SUMMARY:
loadCreatedAlbum(req.mToken);
break;
case RS_TOKREQ_ANSTYPE_ACK:
acknowledgeGroup(req.mToken);
break;
default:
std::cerr << "PhotoAddDialog::loadRequest() ERROR: GROUP: INVALID ANS TYPE";
std::cerr << std::endl;
}
break;
case TOKENREQ_MSGINFO:
switch(req.mAnsType)
{
case RS_TOKREQ_ANSTYPE_DATA:
loadPhotoData(req.mToken);
break;
case RS_TOKREQ_ANSTYPE_ACK:
acknowledgeMessage(req.mToken);
break;
default:
std::cerr << "PhotoAddDialog::loadRequest() ERROR: MESSAGE: INVALID ANS TYPE";
std::cerr << std::endl;
}
break;
default:
std::cerr << "PhotoAddDialog::loadRequest() ERROR: INVALID TYPE";
std::cerr << std::endl;
break;
}
}
}

View File

@ -1,83 +0,0 @@
/*
* Retroshare Photo Plugin.
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef MRK_PHOTO_ADD_DIALOG_H
#define MRK_PHOTO_ADD_DIALOG_H
#include "ui_PhotoAddDialog.h"
#include <retroshare/rsphotoV2.h>
#include "util/TokenQueueV2.h"
class PhotoDetailsDialog;
class PhotoAddDialog : public QWidget, public TokenResponseV2
{
Q_OBJECT
public:
PhotoAddDialog(TokenQueueV2 *parentQueue, QWidget *parent = 0);
void loadAlbum(const std::string &albumId);
virtual void loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req);
void clearDialog();
private slots:
void showPhotoDetails();
void showAlbumDetails();
void editingStageDone();
// From PhotoDrops...
void albumImageChanged();
void photoImageChanged();
void updateMoveButtons(uint32_t status);
void publishAlbum();
void deleteAlbum();
void deletePhoto();
private:
void publishPhotos(std::string albumId);
bool updateAlbumDetails(const RsPhotoAlbum &album);
bool setAlbumDataToPhotos();
bool loadPhotoData(const uint32_t &token);
bool loadAlbumData(const uint32_t &token);
bool loadCreatedAlbum(const uint32_t &token);
void acknowledgeGroup(const uint32_t &token);
void acknowledgeMessage(const uint32_t &token);
TokenQueueV2 *mPhotoQueue;
protected:
bool mAlbumEdit; // Editing or New.
bool mEditingModeAlbum; // Changing Album or Photo Details.
RsPhotoAlbum mAlbumData;
PhotoDetailsDialog *mPhotoDetails;
Ui::PhotoAddDialog ui;
TokenQueueV2* mParentQueue;
};
#endif

View File

@ -1,493 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PhotoAddDialog</class>
<widget class="QWidget" name="PhotoAddDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>852</width>
<height>383</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Share Options</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="comboBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Public</string>
</property>
</item>
<item>
<property name="text">
<string>All Friends</string>
</property>
</item>
<item>
<property name="text">
<string>Restricted</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>N/A</string>
</property>
</item>
<item>
<property name="text">
<string>University Friends</string>
</property>
</item>
<item>
<property name="text">
<string>Family</string>
</property>
</item>
<item>
<property name="text">
<string>This List Contains</string>
</property>
</item>
<item>
<property name="text">
<string>All your Groups</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="comboBox_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Resize Images (&lt; 1Mb)</string>
</property>
</item>
<item>
<property name="text">
<string>Resize Images (&lt; 10Mb)</string>
</property>
</item>
<item>
<property name="text">
<string>Send Original Images</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QComboBox" name="comboBox_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>No Comments Allowed</string>
</property>
</item>
<item>
<property name="text">
<string>Authenticated Comments</string>
</property>
</item>
<item>
<property name="text">
<string>Any Comments Allowed</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Publish with XXX Key</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="2">
<widget class="QGroupBox" name="albumGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Album Thumbnail</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="PhotoDrop" name="AlbumDrop" native="true">
<layout class="QGridLayout" name="gridLayout_5"/>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="3" rowspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>10</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Summary</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Title">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Category:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_Category">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Travel</string>
</property>
</item>
<item>
<property name="text">
<string>Holiday</string>
</property>
</item>
<item>
<property name="text">
<string>Friends</string>
</property>
</item>
<item>
<property name="text">
<string>Family</string>
</property>
</item>
<item>
<property name="text">
<string>Work</string>
</property>
</item>
<item>
<property name="text">
<string>Random</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Caption</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_Caption">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Where:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_Where">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_When">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Album Title:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>When</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_DeleteAlbum">
<property name="text">
<string>Delete Album</string>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>78</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_EditAlbumDetails">
<property name="text">
<string>Edit Album Details</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,10">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>HELP: Drag &amp; Drop to insert, and re-order pictures. Click on a picture to edit details below.</string>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="scrollAreaPhotos">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>10</verstretch>
</sizepolicy>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<widget class="PhotoDrop" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>830</width>
<height>83</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
</property>
<layout class="QGridLayout" name="gridLayout_2"/>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_DeletePhoto">
<property name="text">
<string>Delete Photo</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_EditPhotoDetails">
<property name="text">
<string>Edit Photo Details</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>68</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_ShiftLeft">
<property name="text">
<string>&lt;&lt;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_ShiftRight">
<property name="text">
<string>&gt;&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>68</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_Publish">
<property name="text">
<string>Publish Album</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PhotoDrop</class>
<extends>QWidget</extends>
<header>gui/PhotoShare/PhotoDrop.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,521 +0,0 @@
/*
* Retroshare Photo Plugin.
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "gui/PhotoShare/PhotoDetailsDialog.h"
#include "gui/PhotoShare/PhotoItem.h"
#include <iostream>
/** Constructor */
PhotoDetailsDialog::PhotoDetailsDialog(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
connect( ui.pushButton_Update, SIGNAL( clicked() ), this, SLOT( updateDetails () ) );
}
void PhotoDetailsDialog::setPhotoItem(PhotoItem *item)
{
if (mPhotoItem == item)
{
return;
}
mPhotoItem = item;
/* update fields from the edit fields */
refreshDetails();
}
void PhotoDetailsDialog::refreshDetails()
{
blankDetails();
if (!mPhotoItem)
{
return;
}
ui.label_Headline->setText(QString("Photo Description"));
//ui.comboBox_Category= mPhotoItem->mDetails.mCaption;
if (mPhotoItem->mIsPhoto)
{
// THIS is tedious!
RsPhotoPhoto &photo = mPhotoItem->mPhotoDetails;
RsPhotoAlbum &album = mPhotoItem->mAlbumDetails;
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_TITLE)
{
ui.lineEdit_Title->setText(QString::fromUtf8(photo.mMeta.mMsgName.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_TITLE)
{
ui.lineEdit_Title->setText(QString::fromUtf8(album.mMeta.mGroupName.c_str()));
}
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_CAPTION)
{
ui.lineEdit_Caption->setText(QString::fromUtf8(photo.mCaption.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_CAPTION)
{
ui.lineEdit_Caption->setText(QString::fromUtf8(album.mCaption.c_str()));
}
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_DESC)
{
ui.textEdit_Description->setText(QString::fromUtf8(photo.mDescription.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_DESC)
{
ui.textEdit_Description->setText(QString::fromUtf8(album.mDescription.c_str()));
}
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER)
{
ui.lineEdit_Photographer->setText(QString::fromUtf8(photo.mPhotographer.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER)
{
ui.lineEdit_Photographer->setText(QString::fromUtf8(album.mPhotographer.c_str()));
}
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHERE)
{
ui.lineEdit_Where->setText(QString::fromUtf8(photo.mWhere.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHERE)
{
ui.lineEdit_Where->setText(QString::fromUtf8(album.mWhere.c_str()));
}
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHEN)
{
ui.lineEdit_When->setText(QString::fromUtf8(photo.mWhen.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHEN)
{
ui.lineEdit_When->setText(QString::fromUtf8(album.mWhen.c_str()));
}
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_OTHER)
{
ui.lineEdit_Other->setText(QString::fromUtf8(photo.mOther.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_OTHER)
{
ui.lineEdit_Other->setText(QString::fromUtf8(album.mOther.c_str()));
}
if (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_HASHTAGS)
{
ui.lineEdit_HashTags->setText(QString::fromUtf8(photo.mHashTags.c_str()));
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_HASHTAGS)
{
ui.lineEdit_HashTags->setText(QString::fromUtf8(album.mHashTags.c_str()));
}
}
else
{
RsPhotoAlbum &album = mPhotoItem->mAlbumDetails;
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_TITLE)
{
ui.lineEdit_Title->setText(QString::fromUtf8(album.mMeta.mGroupName.c_str()));
}
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_CAPTION)
{
ui.lineEdit_Caption->setText(QString::fromUtf8(album.mCaption.c_str()));
}
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_DESC)
{
ui.textEdit_Description->setText(QString::fromUtf8(album.mDescription.c_str()));
}
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER)
{
ui.lineEdit_Photographer->setText(QString::fromUtf8(album.mPhotographer.c_str()));
}
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHERE)
{
ui.lineEdit_Where->setText(QString::fromUtf8(album.mWhere.c_str()));
}
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHEN)
{
ui.lineEdit_When->setText(QString::fromUtf8(album.mWhen.c_str()));
}
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_OTHER)
{
ui.lineEdit_Other->setText(QString::fromUtf8(album.mOther.c_str()));
}
if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_HASHTAGS)
{
ui.lineEdit_HashTags->setText(QString::fromUtf8(album.mHashTags.c_str()));
}
}
const QPixmap *qtn = mPhotoItem->getPixmap();
QPixmap cpy(*qtn);
ui.label_Photo->setPixmap(cpy);
}
void PhotoDetailsDialog::blankDetails()
{
ui.label_Headline->setText(QString("Nothing"));
//ui.comboBox_Category= mPhotoItem->mDetails.mCaption;
ui.lineEdit_Title->setText(QString(""));
ui.lineEdit_Caption->setText(QString(""));
ui.textEdit_Description->setText(QString(""));
ui.lineEdit_Photographer->setText(QString(""));
ui.lineEdit_Where->setText(QString(""));
ui.lineEdit_When->setText(QString(""));
ui.lineEdit_Other->setText(QString(""));
ui.lineEdit_HashTags->setText(QString(""));
//QPixmap qtn = mPhotoItem->getPixmap();
//ui.label_Photo->setPixmap(qtn);
}
void PhotoDetailsDialog::updateDetails()
{
saveDetails();
// Notify Listeners.
editingDone();
hide();
}
void PhotoDetailsDialog::saveDetails()
{
if(!mPhotoItem)
{
return;
}
RsPhotoPhoto &photo = mPhotoItem->mPhotoDetails;
RsPhotoAlbum &album = mPhotoItem->mAlbumDetails;
std::string txt = ui.lineEdit_Title->text().toUtf8().constData();
bool setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_TITLE))
{
if (txt != photo.mMeta.mMsgName)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_TITLE)
{
if (txt != album.mMeta.mGroupName)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_TITLE;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_TITLE;
photo.mMeta.mMsgName = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_TITLE;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_TITLE;
album.mMeta.mGroupName = txt;
}
}
txt = ui.lineEdit_Caption->text().toUtf8().constData();
setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_CAPTION))
{
if (txt != photo.mCaption)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_CAPTION)
{
if (txt != album.mCaption)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_CAPTION;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_CAPTION;
photo.mCaption = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_CAPTION;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_CAPTION;
album.mCaption = txt;
}
}
txt = ui.textEdit_Description->toPlainText().toUtf8().constData();
setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_DESC))
{
if (txt != photo.mDescription)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_DESC)
{
if (txt != album.mDescription)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_DESC;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_DESC;
photo.mDescription = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_DESC;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_DESC;
album.mDescription = txt;
}
}
txt = ui.lineEdit_Photographer->text().toUtf8().constData();
setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER))
{
if (txt != photo.mPhotographer)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER)
{
if (txt != album.mPhotographer)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER;
photo.mPhotographer = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_PHOTOGRAPHER;
album.mPhotographer = txt;
}
}
txt = ui.lineEdit_Where->text().toUtf8().constData();
setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHERE))
{
if (txt != photo.mWhere)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHERE)
{
if (txt != album.mWhere)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_WHERE;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_WHERE;
photo.mWhere = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_WHERE;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_WHERE;
album.mWhere = txt;
}
}
txt = ui.lineEdit_When->text().toUtf8().constData();
setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHEN))
{
if (txt != photo.mWhen)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_WHEN)
{
if (txt != album.mWhen)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_WHEN;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_WHEN;
photo.mWhen = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_WHEN;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_WHEN;
album.mWhen = txt;
}
}
txt = ui.lineEdit_HashTags->text().toUtf8().constData();
setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_HASHTAGS))
{
if (txt != photo.mHashTags)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_HASHTAGS)
{
if (txt != album.mHashTags)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_HASHTAGS;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_HASHTAGS;
photo.mHashTags = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_HASHTAGS;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_HASHTAGS;
album.mHashTags = txt;
}
}
txt = ui.lineEdit_Other->text().toUtf8().constData();
setName = false;
if ((mPhotoItem->mIsPhoto) && (photo.mSetFlags & RSPHOTO_FLAGS_ATTRIB_OTHER))
{
if (txt != photo.mOther)
setName = true;
}
else if (album.mSetFlags & RSPHOTO_FLAGS_ATTRIB_OTHER)
{
if (txt != album.mOther)
setName = true;
}
else if (txt.length() != 0)
{
setName = true;
}
if (setName)
{
if (mPhotoItem->mIsPhoto)
{
photo.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_OTHER;
photo.mModFlags |= RSPHOTO_FLAGS_ATTRIB_OTHER;
photo.mOther = txt;
}
else
{
album.mSetFlags |= RSPHOTO_FLAGS_ATTRIB_OTHER;
album.mModFlags |= RSPHOTO_FLAGS_ATTRIB_OTHER;
album.mOther = txt;
}
}
std::cerr << "PhotoDetailsDialog::saveDetails() ";
if (mPhotoItem->mIsPhoto)
{
std::cerr << " photo.mSetFlags: " << mPhotoItem->mPhotoDetails.mSetFlags;
std::cerr << " photo.mModFlags: " << mPhotoItem->mPhotoDetails.mModFlags;
}
std::cerr << " album.mSetFlags: " << mPhotoItem->mAlbumDetails.mSetFlags;
std::cerr << " album.mModFlags: " << mPhotoItem->mAlbumDetails.mModFlags;
std::cerr << std::endl;
//QPixmap qtn = mPhotoItem->getPixmap();
//ui.label_Photo->setPixmap(qtn);
}

View File

@ -1,59 +0,0 @@
/*
* Retroshare Photo Plugin.
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef MRK_PHOTO_DETAILS_DIALOG_H
#define MRK_PHOTO_DETAILS_DIALOG_H
#include "ui_PhotoDetailsDialog.h"
class PhotoItem;
class PhotoDetailsDialog : public QWidget
{
Q_OBJECT
public:
PhotoDetailsDialog(QWidget *parent = 0);
void setPhotoItem(PhotoItem *item);
signals:
void editingDone();
private:
void saveDetails();
void refreshDetails();
private slots:
void updateDetails();
void blankDetails();
private:
PhotoItem *mPhotoItem;
Ui::PhotoDetailsDialog ui;
};
#endif

View File

@ -1,221 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PhotoDetailsDialog</class>
<widget class="QWidget" name="PhotoDetailsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>683</width>
<height>415</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_Headline">
<property name="font">
<font>
<pointsize>18</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Album Description</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Album Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_Title"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Category:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_Category">
<item>
<property name="text">
<string>Travel</string>
</property>
</item>
<item>
<property name="text">
<string>Holiday</string>
</property>
</item>
<item>
<property name="text">
<string>Friends</string>
</property>
</item>
<item>
<property name="text">
<string>Family</string>
</property>
</item>
<item>
<property name="text">
<string>Work</string>
</property>
</item>
<item>
<property name="text">
<string>Random</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_Photo">
<property name="text">
<string>Thumbnail
Here
Dummy
Text
1
2
3
...................................</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Caption:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Caption"/>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Photographer:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="lineEdit_Photographer"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="3">
<widget class="QTextEdit" name="textEdit_Description"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Where:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="lineEdit_Where"/>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>When</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLineEdit" name="lineEdit_When"/>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Other 1:</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLineEdit" name="lineEdit_Other"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>HashTags:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_HashTags"/>
</item>
<item row="4" column="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>598</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_Update">
<property name="text">
<string>Update Details</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -32,6 +32,9 @@
#include <QTimer> #include <QTimer>
#include <QMessageBox> #include <QMessageBox>
#include "AlbumCreateDialog.h"
#include "AlbumItem.h"
/****** /******
* #define PHOTO_DEBUG 1 * #define PHOTO_DEBUG 1
*****/ *****/
@ -64,13 +67,12 @@ PhotoDialog::PhotoDialog(QWidget *parent)
{ {
ui.setupUi(this); ui.setupUi(this);
mAddDialog = NULL; mAlbumSelected = NULL;
mAlbumSelected = NULL; mPhotoSelected = NULL;
mPhotoSelected = NULL; mSlideShow = NULL;
mSlideShow = NULL;
connect( ui.toolButton_NewAlbum, SIGNAL(clicked()), this, SLOT(OpenOrShowPhotoAddDialog())); connect( ui.toolButton_NewAlbum, SIGNAL(clicked()), this, SLOT(OpenOrShowPhotoAddDialog()));
connect( ui.toolButton_EditAlbum, SIGNAL(clicked()), this, SLOT(OpenPhotoEditDialog())); connect( ui.toolButton_ViewAlbum, SIGNAL(clicked()), this, SLOT(OpenPhotoEditDialog()));
connect( ui.toolButton_SlideShow, SIGNAL(clicked()), this, SLOT(OpenSlideShow())); connect( ui.toolButton_SlideShow, SIGNAL(clicked()), this, SLOT(OpenSlideShow()));
QTimer *timer = new QTimer(this); QTimer *timer = new QTimer(this);
@ -84,57 +86,6 @@ PhotoDialog::PhotoDialog(QWidget *parent)
} }
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() void PhotoDialog::checkUpdate()
{ {
@ -176,14 +127,7 @@ void PhotoDialog::OpenSlideShow()
return; return;
} }
if (mAlbumSelected->mIsPhoto) std::string albumId = mAlbumSelected->getAlbum().mMeta.mGroupId;
{
std::cerr << "PhotoDialog::OpenPhotoEditDialog() MAJOR ERROR!";
std::cerr << std::endl;
return;
}
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
if (mSlideShow) if (mSlideShow)
{ {
@ -201,63 +145,19 @@ void PhotoDialog::OpenSlideShow()
/*************** New Photo Dialog ***************/ /*************** New Photo Dialog ***************/
void PhotoDialog::OpenOrShowPhotoAddDialog() void PhotoDialog::createAlbum()
{ {
if (mAddDialog) AlbumCreateDialog albumCreate(mPhotoQueue, rsPhotoV2, this);
{ albumCreate.exec();
mAddDialog->show();
}
else
{
mAddDialog = new PhotoAddDialog(mPhotoQueue, NULL);
mAddDialog->show();
}
mAddDialog->clearDialog();
} }
/*************** Edit Photo Dialog ***************/
void PhotoDialog::OpenPhotoEditDialog() 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);
} }
/*************** Edit Photo Dialog ***************/
bool PhotoDialog::matchesAlbumFilter(const RsPhotoAlbum &album) bool PhotoDialog::matchesAlbumFilter(const RsPhotoAlbum &album)
{ {
@ -292,13 +192,7 @@ void PhotoDialog::insertPhotosForSelectedAlbum()
//std::list<std::string> albumIds; //std::list<std::string> albumIds;
if (mAlbumSelected) if (mAlbumSelected)
{ {
if (mAlbumSelected->mIsPhoto) std::string albumId = mAlbumSelected->getAlbum().mMeta.mGroupId;
{
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() MAJOR ERROR!";
std::cerr << std::endl;
}
std::string albumId = mAlbumSelected->mAlbumDetails.mMeta.mGroupId;
//albumIds.push_back(albumId); //albumIds.push_back(albumId);
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() AlbumId: " << albumId; std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() AlbumId: " << albumId;
@ -311,45 +205,9 @@ void PhotoDialog::insertPhotosForSelectedAlbum()
void PhotoDialog::clearAlbums() void PhotoDialog::clearAlbums()
{ {
std::cerr << "PhotoDialog::clearAlbums()" << std::endl;
std::list<PhotoItem *> photoItems; std::cerr << "PhotoDialog::clearAlbums()" << std::endl;
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;
} }
@ -357,43 +215,7 @@ void PhotoDialog::clearPhotos()
{ {
std::cerr << "PhotoDialog::clearPhotos()" << std::endl; 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; mPhotoSelected = NULL;
@ -403,7 +225,7 @@ void PhotoDialog::addAlbum(const RsPhotoAlbum &album)
{ {
std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl; std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl;
PhotoItem *item = new PhotoItem(this, album); AlbumItem *item = new AlbumItem(album, this);
QLayout *alayout = ui.scrollAreaWidgetContents->layout(); QLayout *alayout = ui.scrollAreaWidgetContents->layout();
alayout->addWidget(item); alayout->addWidget(item);
} }
@ -415,23 +237,8 @@ void PhotoDialog::addPhoto(const RsPhotoPhoto &photo)
std::cerr << " PhotoId: " << photo.mMeta.mMsgId; std::cerr << " PhotoId: " << photo.mMeta.mMsgId;
std::cerr << std::endl; 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 ************************/ /**************************** Request / Response Filling of Data ************************/
@ -484,37 +291,38 @@ void PhotoDialog::requestAlbumData(std::list<std::string> &ids)
bool PhotoDialog::loadAlbumData(const uint32_t &token) bool PhotoDialog::loadAlbumData(const uint32_t &token)
{ {
std::cerr << "PhotoDialog::loadAlbumData()"; std::cerr << "PhotoDialog::loadAlbumData()";
std::cerr << std::endl; std::cerr << std::endl;
std::vector<RsPhotoAlbum> albums; std::vector<RsPhotoAlbum> albums;
rsPhotoV2->getAlbum(token, albums); rsPhotoV2->getAlbum(token, albums);
std::vector<RsPhotoAlbum>::iterator vit = albums.begin(); std::vector<RsPhotoAlbum>::iterator vit = albums.begin();
for(; vit != albums.end(); vit++) for(; vit != albums.end(); vit++)
{ {
RsPhotoAlbum& album = *vit; RsPhotoAlbum& album = *vit;
std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl; std::cerr << " PhotoDialog::addAlbum() AlbumId: " << album.mMeta.mGroupId << std::endl;
PhotoItem *item = new PhotoItem(this, album); AlbumItem *item = new AlbumItem(album, this);
QLayout *alayout = ui.scrollAreaWidgetContents->layout(); QLayout *alayout = ui.scrollAreaWidgetContents->layout();
alayout->addWidget(item); alayout->addWidget(item);
} }
return true; return true;
} }
void PhotoDialog::requestPhotoList(const std::string &albumId) void PhotoDialog::requestPhotoList(const std::string &albumId)
{ {
GxsMsgReq req; std::list<RsGxsGroupId> grpIds;
req[albumId] = std::vector<RsGxsMessageId>(); grpIds.push_back(albumId);
RsTokReqOptionsV2 opts; RsTokReqOptionsV2 opts;
opts.mOptions = RS_TOKREQOPT_MSG_LATEST; opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS;
uint32_t token; opts.mOptions = RS_TOKREQOPT_MSG_LATEST;
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, req, 0); uint32_t token;
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_LIST, opts, grpIds, 0);
} }
@ -560,16 +368,16 @@ void PhotoDialog::loadPhotoList(const uint32_t &token)
std::cerr << std::endl; std::cerr << std::endl;
GxsMsgIdResult res; GxsMsgIdResult res;
GxsMsgReq req;
rsPhotoV2->getMsgList(token, res); rsPhotoV2->getMsgList(token, res);
requestPhotoData(req); requestPhotoData(res);
} }
void PhotoDialog::requestPhotoData(GxsMsgReq &photoIds) void PhotoDialog::requestPhotoData(GxsMsgReq &photoIds)
{ {
RsTokReqOptionsV2 opts; RsTokReqOptionsV2 opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
uint32_t token; uint32_t token;
mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, photoIds, 0); mPhotoQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, photoIds, 0);
} }
@ -602,7 +410,7 @@ void PhotoDialog::loadPhotoData(const uint32_t &token)
} }
/********************************/ /**************************** Request / Response Filling of Data ************************/
void PhotoDialog::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req) void PhotoDialog::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &req)
{ {
@ -673,145 +481,3 @@ void PhotoDialog::loadRequest(const TokenQueueV2 *queue, const TokenRequestV2 &r
/**************************** Request / Response Filling of Data ************************/ /**************************** Request / Response Filling of Data ************************/
// OLD STUFF THAT CANNOT BE USED WITH NEW REQ/RESP
#if 0
void PhotoDialog::insertAlbums()
{
/* clear it all */
clearAlbums();
//ui.albumLayout->clear();
/* create a list of albums */
std::list<std::string> albumIds;
std::list<std::string> filteredAlbumIds;
std::list<std::string>::iterator it;
rsPhotoV2->getGroupList(token, al);
/* Filter Albums */ /* Sort Albums */
#define MAX_ALBUMS 50
int count = MAX_ALBUMS;
FilterNSortAlbums(albumIds, filteredAlbumIds, count);
for(it = filteredAlbumIds.begin(); it != filteredAlbumIds.end(); it++)
{
addAlbum(*it);
}
insertPhotosForAlbum(filteredAlbumIds);
}
void PhotoDialog::insertPhotosForAlbum(const std::list<std::string> &albumIds)
{
/* clear it all */
clearPhotos();
//ui.photoLayout->clear();
/* create a list of albums */
std::list<std::string> ids;
std::list<std::string> photoIds;
std::list<std::string> filteredPhotoIds;
std::list<std::string>::const_iterator it;
for(it = albumIds.begin(); it != albumIds.end(); it++)
{
rsPhoto->getPhotoList(*it, photoIds);
}
/* Filter Albums */ /* Sort Albums */
#define MAX_PHOTOS 50
int count = MAX_PHOTOS;
FilterNSortPhotos(photoIds, filteredPhotoIds, MAX_PHOTOS);
for(it = filteredPhotoIds.begin(); it != filteredPhotoIds.end(); it++)
{
addPhoto(*it);
}
}
void PhotoDialog::insertPhotosForSelectedAlbum()
{
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum()";
std::cerr << std::endl;
clearPhotos();
std::list<std::string> albumIds;
if (mAlbumSelected)
{
albumIds.push_back(mAlbumSelected->mDetails.mAlbumId);
std::cerr << "PhotoDialog::insertPhotosForSelectedAlbum() AlbumId: " << mAlbumSelected->mDetails.mAlbumId;
std::cerr << std::endl;
}
insertPhotosForAlbum(albumIds);
}
bool PhotoDialog::FilterNSortAlbums(const std::list<std::string> &albumIds, std::list<std::string> &filteredAlbumIds, int count)
{
std::multimap<double, std::string> sortedAlbums;
std::multimap<double, std::string>::iterator sit;
std::list<std::string>::const_iterator it;
for(it = albumIds.begin(); it != albumIds.end(); it++)
{
RsPhotoAlbum album;
rsPhoto->getAlbum(*it, album);
if (matchesAlbumFilter(album))
{
double score = AlbumScore(album);
sortedAlbums.insert(std::make_pair(score, *it));
}
}
int i;
for (sit = sortedAlbums.begin(), i = 0; (sit != sortedAlbums.end()) && (i < count); sit++, i++)
{
filteredAlbumIds.push_back(sit->second);
}
return true;
}
bool PhotoDialog::FilterNSortPhotos(const std::list<std::string> &photoIds, std::list<std::string> &filteredPhotoIds, int count)
{
std::multimap<double, std::string> sortedPhotos;
std::multimap<double, std::string>::iterator sit;
std::list<std::string>::const_iterator it;
int i = 0;
for(it = photoIds.begin(); it != photoIds.end(); it++, i++)
{
RsPhotoPhoto photo;
rsPhoto->getPhoto(*it, photo);
if (matchesPhotoFilter(photo))
{
double score = i; //PhotoScore(album);
sortedPhotos.insert(std::make_pair(score, *it));
}
}
for (sit = sortedPhotos.begin(), i = 0; (sit != sortedPhotos.end()) && (i < count); sit++, i++)
{
filteredPhotoIds.push_back(sit->second);
}
return true;
}
#endif

View File

@ -26,33 +26,29 @@
#include "retroshare-gui/mainpage.h" #include "retroshare-gui/mainpage.h"
#include "ui_PhotoDialog.h" #include "ui_PhotoDialog.h"
#include "AlbumCreateDialog.h"
#include "AlbumDialog.h"
#include "AlbumItem.h"
#include "PhotoItem.h"
#include "PhotoSlideShow.h"
#include <retroshare/rsphotoV2.h> #include <retroshare/rsphotoV2.h>
#include <map> #include <map>
#include "gui/PhotoShare/PhotoItem.h"
#include "gui/PhotoShare/PhotoAddDialog.h"
#include "gui/PhotoShare/PhotoSlideShow.h"
#include "util/TokenQueueV2.h" #include "util/TokenQueueV2.h"
class PhotoDialog : public MainPage, public PhotoHolder, public TokenResponseV2 class PhotoDialog : public MainPage, public TokenResponseV2
{ {
Q_OBJECT Q_OBJECT
public: public:
PhotoDialog(QWidget *parent = 0); PhotoDialog(QWidget *parent = 0);
virtual void deletePhotoItem(PhotoItem *, uint32_t type);
virtual void notifySelection(PhotoItem *item, int ptype);
void notifyAlbumSelection(PhotoItem *item);
void notifyPhotoSelection(PhotoItem *item);
private slots: private slots:
void checkUpdate(); void checkUpdate();
void OpenOrShowPhotoAddDialog(); void createAlbum();
void OpenPhotoEditDialog(); void OpenPhotoEditDialog();
void OpenSlideShow(); void OpenSlideShow();
private: private:
@ -84,11 +80,6 @@ private:
/* Grunt work of setting up the GUI */ /* Grunt work of setting up the GUI */
//bool FilterNSortAlbums(const std::list<std::string> &albumIds, std::list<std::string> &filteredAlbumIds, int count);
//bool FilterNSortPhotos(const std::list<std::string> &photoIds, std::list<std::string> &filteredPhotoIds, int count);
//void insertAlbums();
//void insertPhotosForAlbum(const std::list<std::string> &albumIds);
void insertPhotosForSelectedAlbum(); void insertPhotosForSelectedAlbum();
void addAlbum(const RsPhotoAlbum &album); void addAlbum(const RsPhotoAlbum &album);
@ -97,11 +88,12 @@ private:
void clearAlbums(); void clearAlbums();
void clearPhotos(); void clearPhotos();
PhotoAddDialog *mAddDialog; private:
PhotoSlideShow *mSlideShow;
PhotoItem *mAlbumSelected;
PhotoItem *mPhotoSelected; AlbumItem* mAlbumSelected;
PhotoItem* mPhotoSelected;
PhotoSlideShow* mSlideShow;
TokenQueueV2 *mPhotoQueue; TokenQueueV2 *mPhotoQueue;

View File

@ -11,97 +11,31 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string/> <string>Photo Share</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item row="0" column="0"> <item>
<widget class="QLabel" name="label_4"> <widget class="QToolButton" name="toolButton_SlideShow">
<property name="text"> <property name="text">
<string>Filter</string> <string>Slide Show</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QToolButton" name="toolButton_ViewAlbum">
<item> <property name="text">
<widget class="QComboBox" name="comboBox"> <string>View Album / Add Photos</string>
<item> </property>
<property name="text"> </widget>
<string>Source</string>
</property>
</item>
<item>
<property name="text">
<string>Category</string>
</property>
</item>
<item>
<property name="text">
<string>Rating</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item>
<widget class="QToolButton" name="toolButton">
<property name="text">
<string>[ - ]</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="text">
<string>[ + ]</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item row="1" column="1"> <item>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <widget class="QToolButton" name="toolButton_NewAlbum">
<item> <property name="text">
<widget class="QComboBox" name="comboBox_2"> <string>Create Album</string>
<item> </property>
<property name="text"> </widget>
<string>Source</string>
</property>
</item>
<item>
<property name="text">
<string>Category</string>
</property>
</item>
<item>
<property name="text">
<string>Rating</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item>
<widget class="QToolButton" name="toolButton_3">
<property name="text">
<string>[ - ]</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_4">
<property name="text">
<string>[ + ]</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
@ -123,7 +57,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>754</width> <width>754</width>
<height>234</height> <height>277</height>
</rect> </rect>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -166,7 +100,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>754</width> <width>754</width>
<height>233</height> <height>277</height>
</rect> </rect>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -191,35 +125,8 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QToolButton" name="toolButton_SlideShow">
<property name="text">
<string>Slide Show</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_EditAlbum">
<property name="text">
<string>Edit Album</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_NewAlbum">
<property name="text">
<string>New Album</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources/>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -1,273 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PhotoDialog</class>
<widget class="QWidget" name="PhotoDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>774</width>
<height>608</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Filter</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>Source</string>
</property>
</item>
<item>
<property name="text">
<string>Category</string>
</property>
</item>
<item>
<property name="text">
<string>Rating</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item>
<widget class="QToolButton" name="toolButton">
<property name="text">
<string>[ - ]</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="text">
<string>[ + ]</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QComboBox" name="comboBox_2">
<item>
<property name="text">
<string>Source</string>
</property>
</item>
<item>
<property name="text">
<string>Category</string>
</property>
</item>
<item>
<property name="text">
<string>Rating</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item>
<widget class="QToolButton" name="toolButton_3">
<property name="text">
<string>[ - ]</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_4">
<property name="text">
<string>[ + ]</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>227</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QHBoxLayout" name="albumLayout"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Album 1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Album 2</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Album 3</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Album 4 </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>139</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QScrollArea" name="scrollArea_2">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>746</width>
<height>227</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QHBoxLayout" name="photoLayout"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>PICTURE 1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>426</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QToolButton" name="toolButton_RemovePicture">
<property name="text">
<string>Remove Picture</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_SlideShow">
<property name="text">
<string>Slide Show</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_EditAlbum">
<property name="text">
<string>Edit Album</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_EditPictureDetails">
<property name="text">
<string>Edit Picture Details</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_NewAlbum">
<property name="text">
<string>New Album</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -64,23 +64,6 @@ PhotoDrop::PhotoDrop(QWidget *parent)
reorderPhotos(); reorderPhotos();
} }
void PhotoDrop::notifySelection(PhotoItem *item, int ptype)
{
std::cerr << "PhotoDrop::notifySelection() from : " << ptype << " " << item;
std::cerr << std::endl;
if (mSelected)
{
std::cerr << "PhotoDrop::notifySelection() unselecting old one : " << mSelected;
std::cerr << std::endl;
mSelected->setSelected(false);
}
mSelected = item;
checkMoveButtons();
}
void PhotoDrop::clear() void PhotoDrop::clear()
{ {
@ -98,11 +81,6 @@ PhotoItem *PhotoDrop::getSelectedPhotoItem()
} }
void PhotoDrop::deletePhotoItem(PhotoItem *, uint32_t type)
{
return;
}
void PhotoDrop::resizeEvent ( QResizeEvent * event ) void PhotoDrop::resizeEvent ( QResizeEvent * event )
{ {
@ -637,9 +615,7 @@ void PhotoDrop::dropEvent(QDropEvent *event)
std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl; std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
std::cerr << "or As Local File: " << localpath.toStdString() << std::endl; std::cerr << "or As Local File: " << localpath.toStdString() << std::endl;
PhotoItem *item = new PhotoItem(this, localpath.toStdString());
addPhotoItem(item);
//mPhotos.push_back(item); //mPhotos.push_back(item);
//layout()->addWidget(item); //layout()->addWidget(item);
} }
@ -683,7 +659,6 @@ void PhotoDrop::addPhotoItem(PhotoItem *item)
clearPhotos(); clearPhotos();
} }
item->updateParent(this);
layout()->addWidget(item); layout()->addWidget(item);
//checkMoveButtons(); //checkMoveButtons();

View File

@ -43,7 +43,7 @@ QT_END_NAMESPACE
#define PHOTO_SHIFT_BOTH 3 #define PHOTO_SHIFT_BOTH 3
class PhotoDrop : public QWidget, public PhotoHolder class PhotoDrop : public QWidget
{ {
Q_OBJECT Q_OBJECT
@ -52,9 +52,6 @@ public:
void clear(); void clear();
void setSingleImage(); void setSingleImage();
virtual void deletePhotoItem(PhotoItem *, uint32_t type);
virtual void notifySelection(PhotoItem *item, int ptype);
PhotoItem *getSelectedPhotoItem(); PhotoItem *getSelectedPhotoItem();
int getPhotoCount(); int getPhotoCount();
PhotoItem *getPhotoIdx(int idx); PhotoItem *getPhotoIdx(int idx);

View File

@ -1,282 +1,14 @@
/* #include "PhotoItem.h"
* Retroshare Photo Plugin. #include "ui_PhotoItem.h"
*
* Copyright 2012-2012 by Robert Fernie. PhotoItem::PhotoItem(QWidget *parent) :
* QWidget(parent),
* This library is free software; you can redistribute it and/or ui(new Ui::PhotoItem)
* modify it under the terms of the GNU Library General Public {
* License Version 2.1 as published by the Free Software Foundation. ui->setupUi(this);
* }
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of PhotoItem::~PhotoItem()
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU {
* Library General Public License for more details. delete ui;
* }
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include <QDateTime>
#include <QMessageBox>
#include <QMouseEvent>
#include <QBuffer>
#include "PhotoItem.h"
#include <retroshare/rsphotoV2.h>
#include <algorithm>
#include <iostream>
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
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.mPhotographer));
}
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();
}

View File

@ -1,92 +1,22 @@
/* #ifndef PHOTOITEM_H
* Retroshare Photo Plugin. #define PHOTOITEM_H
*
* Copyright 2012-2012 by Robert Fernie. #include <QWidget>
*
* This library is free software; you can redistribute it and/or namespace Ui {
* modify it under the terms of the GNU Library General Public class PhotoItem;
* License Version 2.1 as published by the Free Software Foundation. }
*
* This library is distributed in the hope that it will be useful, class PhotoItem : public QWidget
* but WITHOUT ANY WARRANTY; without even the implied warranty of {
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Q_OBJECT
* Library General Public License for more details.
* public:
* You should have received a copy of the GNU Library General Public explicit PhotoItem(QWidget *parent = 0);
* License along with this library; if not, write to the Free Software ~PhotoItem();
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA. private:
* Ui::PhotoItem *ui;
* Please report all bugs and problems to "retroshare@lunamutt.com". };
*
*/ #endif // PHOTOITEM_H
#ifndef MRK_PHOTO_PHOTO_ITEM_H
#define MRK_PHOTO_PHOTO_ITEM_H
#include "ui_PhotoItem.h"
#include <retroshare/rsphotoV2.h>
class PhotoItem;
class PhotoHolder
{
public:
virtual void deletePhotoItem(PhotoItem *, uint32_t ptype) = 0;
virtual void notifySelection(PhotoItem *item, int ptype) = 0;
};
#define PHOTO_ITEM_TYPE_ALBUM 0x0001
#define PHOTO_ITEM_TYPE_PHOTO 0x0002
#define PHOTO_ITEM_TYPE_NEW 0x0003
class PhotoItem : public QWidget, private Ui::PhotoItem
{
Q_OBJECT
public:
PhotoItem(PhotoHolder *parent, const RsPhotoAlbum &album);
PhotoItem(PhotoHolder *parent, const RsPhotoPhoto &photo, const RsPhotoAlbum &album);
PhotoItem(PhotoHolder *parent, std::string url); // for new photos.
void setDummyText();
void updateParent(PhotoHolder *parent); // for external construction.
void updateAlbumText(const RsPhotoAlbum &album);
void updatePhotoText(const RsPhotoPhoto &photo);
void updateText();
bool getPhotoThumbnail(RsPhotoThumbnail &nail);
void removeItem();
void setSelected(bool on);
bool isSelected();
const QPixmap *getPixmap();
// details are public - so that can be easily edited.
bool mIsPhoto;
bool mWasModified;
RsPhotoPhoto mPhotoDetails;
RsPhotoAlbum mAlbumDetails;
//private slots:
protected:
void mousePressEvent(QMouseEvent *event);
private:
void updateImage(const RsPhotoThumbnail &thumbnail);
PhotoHolder *mParent;
uint32_t mType;
bool mSelected;
};
#endif

View File

@ -6,242 +6,75 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>166</width> <width>253</width>
<height>216</height> <height>222</height>
</rect> </rect>
</property> </property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string notr="true"/> <string>Form</string>
</property> </property>
<layout class="QGridLayout"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin"> <item>
<number>6</number> <widget class="QLabel" name="label_Thumbnail">
</property> <property name="text">
<item row="1" column="0"> <string>TextLabel</string>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="styleSheet">
<string notr="true">QFrame#frame{border: 2px solid #CCCCCC;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="imgLabel">
<property name="minimumSize">
<size>
<width>150</width>
<height>150</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>150</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QLabel#label{border: 2px solid black;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/images/konversation.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="titleLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Album:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="_3">
<item>
<widget class="QLabel" name="fromBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>From</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fromLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string notr="true">Signed by</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="_2">
<item>
<widget class="QLabel" name="statusBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Status</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="statusLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string notr="true">You eyes only</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="_4">
<item>
<widget class="QLabel" name="dateBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Date</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string notr="true">You eyes only</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="PhotoTitle">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Photo Title:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Photographer:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_PhotoTitle">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Photographer">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources/>
<include location="../../retroshare-gui/src/gui/images.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PhotoSlideDetails</class>
<widget class="QWidget" name="PhotoSlideDetails">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>667</width>
<height>707</height>
</rect>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Caption:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_Caption"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Photographer:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="lineEdit_Photographer"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="3">
<widget class="QTextEdit" name="textEdit_Description"/>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Where:</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLineEdit" name="lineEdit_Where"/>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>When</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLineEdit" name="lineEdit_When"/>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Other 1:</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLineEdit" name="lineEdit_Other"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>HashTags:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_HashTags"/>
</item>
<item row="5" column="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Image #</string>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLineEdit" name="lineEdit_ImageNo"/>
</item>
<item row="0" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QTreeView" name="treeView"/>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../LinksCloud/images.qrc"/>
</resources>
<connections/>
</ui>