From fe62dc13454306f9ff4b4cceef8a05400439aaf2 Mon Sep 17 00:00:00 2001 From: drbob Date: Sun, 16 Feb 2020 15:21:20 +1100 Subject: [PATCH] Switch PhotoService to use GxsComments WIP improvements to PhotoService: - switch p3photoservice to use gxcommentservice - clean out old RsPhotoComment classes - redesign PhotoDialog to use standard GxsCommentService classes - remove unneeded old Comment classes from GUI - fix indenting for PhotoDialog and p3photoservice.h - fix layout issue in Extra Widgets for GxsGroupDialog --- libretroshare/src/retroshare/rsphoto.h | 55 +- libretroshare/src/rsitems/rsphotoitems.cc | 14 +- libretroshare/src/rsitems/rsphotoitems.h | 19 +- libretroshare/src/services/p3photoservice.cc | 82 +-- libretroshare/src/services/p3photoservice.h | 182 +++--- .../src/gui/PhotoShare/AddCommentDialog.cpp | 39 -- .../src/gui/PhotoShare/AddCommentDialog.h | 43 -- .../src/gui/PhotoShare/AddCommentDialog.ui | 67 --- .../src/gui/PhotoShare/PhotoCommentItem.cpp | 52 -- .../src/gui/PhotoShare/PhotoCommentItem.h | 49 -- .../src/gui/PhotoShare/PhotoCommentItem.ui | 200 ------- .../src/gui/PhotoShare/PhotoDialog.cpp | 301 ++++------ .../src/gui/PhotoShare/PhotoDialog.h | 48 +- .../src/gui/PhotoShare/PhotoDialog.ui | 524 ++++++++---------- retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp | 1 - retroshare-gui/src/retroshare-gui.pro | 18 +- 16 files changed, 484 insertions(+), 1210 deletions(-) delete mode 100644 retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp delete mode 100644 retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h delete mode 100644 retroshare-gui/src/gui/PhotoShare/AddCommentDialog.ui delete mode 100644 retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp delete mode 100644 retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h delete mode 100644 retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui diff --git a/libretroshare/src/retroshare/rsphoto.h b/libretroshare/src/retroshare/rsphoto.h index f94f50f34..9c41e5377 100644 --- a/libretroshare/src/retroshare/rsphoto.h +++ b/libretroshare/src/retroshare/rsphoto.h @@ -25,8 +25,10 @@ #include #include #include -#include "rsgxsservice.h" -#include "rsgxscommon.h" +#include "retroshare/rsgxsservice.h" +#include "retroshare/rsgxscommon.h" +#include "retroshare/rsgxsifacehelper.h" + /* The Main Interface Class - for information about your Peers */ class RsPhoto; @@ -135,30 +137,13 @@ class RsPhotoAlbum uint32_t mModFlags; }; -class RsGxsPhotoCommentItem; -class RsPhotoComment -{ -public: - RsPhotoComment(); - - explicit RsPhotoComment(const RsGxsPhotoCommentItem& comment); - - RsPhotoComment& operator=(const RsGxsPhotoCommentItem& comment); - - RsMsgMetaData mMeta; - - std::string mComment; - uint32_t mCommentFlag; -}; std::ostream &operator<<(std::ostream &out, const RsPhotoPhoto &photo); std::ostream &operator<<(std::ostream &out, const RsPhotoAlbum &album); typedef std::map > PhotoResult; -typedef std::map > PhotoCommentResult; -typedef std::map > PhotoRelatedCommentResult; -class RsPhoto +class RsPhoto: public RsGxsIfaceHelper, public RsGxsCommentService { public: @@ -168,7 +153,7 @@ public: static const uint32_t FLAG_MSG_TYPE_MASK; - RsPhoto() { return; } + explicit RsPhoto(RsGxsIface &gxs) : RsGxsIfaceHelper(gxs) { return; } virtual ~RsPhoto() { return; } @@ -235,7 +220,7 @@ public: virtual bool getMsgSummary(const uint32_t &token, MsgMetaResult &msgInfo) = 0; - /* Specific Service Data */ + /* Specific Service Data */ /*! * @param token token to be redeemed for album request @@ -252,22 +237,6 @@ public: virtual bool getPhoto(const uint32_t &token, PhotoResult &photo) = 0; - /* details are updated in album - to choose Album ID, and storage path */ - - /*! - * @param token token to be redeemed for photo request - * @param photo the photo returned for given request token - * @return false if request token is invalid, check token status for error report - */ - virtual bool getPhotoComment(const uint32_t &token, - PhotoCommentResult& comments) = 0; - /*! - * @param token token to be redeemed for photo request - * @param photo the photo returned for given request token - * @return false if request token is invalid, check token status for error report - */ - virtual bool getPhotoRelatedComment(const uint32_t &token, PhotoRelatedCommentResult &comments) = 0; - /*! * submits album, which returns a token that needs * to be acknowledge to get album grp id @@ -284,16 +253,6 @@ public: */ virtual bool submitPhoto(uint32_t& token, RsPhotoPhoto &photo) = 0; - /*! - * submits photo comment, which returns a token that needs - * to be acknowledged to get photo msg-grp id pair - * The mParentId needs to be set to an existing msg for which - * commenting is enabled - * @param token token to redeem for acknowledgement - * @param comment comment to be submitted - */ - virtual bool submitComment(uint32_t& token, RsPhotoComment &photo) = 0; - /*! * subscribes to group, and returns token which can be used * to be acknowledged to get group Id diff --git a/libretroshare/src/rsitems/rsphotoitems.cc b/libretroshare/src/rsitems/rsphotoitems.cc index 2791b668c..77a920fd6 100644 --- a/libretroshare/src/rsitems/rsphotoitems.cc +++ b/libretroshare/src/rsitems/rsphotoitems.cc @@ -33,11 +33,10 @@ RsItem *RsGxsPhotoSerialiser::create_item(uint16_t service, uint8_t item_sub_id) switch(item_sub_id) { - case RS_PKT_SUBTYPE_PHOTO_COMMENT_ITEM: return new RsGxsPhotoCommentItem() ; case RS_PKT_SUBTYPE_PHOTO_SHOW_ITEM: return new RsGxsPhotoPhotoItem() ; case RS_PKT_SUBTYPE_PHOTO_ITEM: return new RsGxsPhotoAlbumItem() ; default: - return NULL ; + return RsGxsCommentSerialiser::create_item(service,item_sub_id) ; } } @@ -68,11 +67,6 @@ void RsGxsPhotoPhotoItem::serial_process(RsGenericSerializer::SerializeJob j,RsG photo.mThumbnail.serial_process(j, ctx); } -void RsGxsPhotoCommentItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) -{ - RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_COMMENT,comment.mComment,"mComment"); - RsTypeSerializer::serial_process(j,ctx,comment.mCommentFlag,"mCommentFlag"); -} void RsGxsPhotoAlbumItem::clear() { @@ -88,12 +82,6 @@ void RsGxsPhotoAlbumItem::clear() album.mThumbnail.clear(); } -void RsGxsPhotoCommentItem::clear() -{ - comment.mComment.clear(); - comment.mCommentFlag = 0; -} - void RsGxsPhotoPhotoItem::clear() { photo.mCaption.clear(); diff --git a/libretroshare/src/rsitems/rsphotoitems.h b/libretroshare/src/rsitems/rsphotoitems.h index 92f99843c..a504ae29b 100644 --- a/libretroshare/src/rsitems/rsphotoitems.h +++ b/libretroshare/src/rsitems/rsphotoitems.h @@ -26,6 +26,7 @@ #include "rsitems/rsserviceids.h" #include "rsitems/rsgxsitems.h" +#include "rsitems/rsgxscommentitems.h" #include "serialiser/rsserial.h" #include "serialiser/rsserializer.h" @@ -34,7 +35,6 @@ const uint8_t RS_PKT_SUBTYPE_PHOTO_ITEM = 0x02; const uint8_t RS_PKT_SUBTYPE_PHOTO_SHOW_ITEM = 0x03; -const uint8_t RS_PKT_SUBTYPE_PHOTO_COMMENT_ITEM = 0x04; class RsGxsPhotoAlbumItem : public RsGxsGrpItem { @@ -66,24 +66,11 @@ public: RsPhotoPhoto photo; }; -class RsGxsPhotoCommentItem : public RsGxsMsgItem +class RsGxsPhotoSerialiser : public RsGxsCommentSerialiser { public: - RsGxsPhotoCommentItem(): RsGxsMsgItem(RS_SERVICE_GXS_TYPE_PHOTO, RS_PKT_SUBTYPE_PHOTO_COMMENT_ITEM) {} - virtual ~RsGxsPhotoCommentItem() {} - void clear(); - - virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx); - - RsPhotoComment comment; -}; - -class RsGxsPhotoSerialiser : public RsServiceSerializer -{ -public: - - RsGxsPhotoSerialiser() :RsServiceSerializer(RS_SERVICE_GXS_TYPE_PHOTO) {} + RsGxsPhotoSerialiser() :RsGxsCommentSerialiser(RS_SERVICE_GXS_TYPE_PHOTO) {} virtual ~RsGxsPhotoSerialiser() {} virtual RsItem *create_item(uint16_t service, uint8_t item_sub_id) const; diff --git a/libretroshare/src/services/p3photoservice.cc b/libretroshare/src/services/p3photoservice.cc index 72402ddf8..7a0e3bd9c 100644 --- a/libretroshare/src/services/p3photoservice.cc +++ b/libretroshare/src/services/p3photoservice.cc @@ -42,18 +42,6 @@ RsPhotoAlbum::RsPhotoAlbum() return; } -RsPhotoComment::RsPhotoComment() - : mComment(""), mCommentFlag(0) { - -} - -RsPhotoComment::RsPhotoComment(const RsGxsPhotoCommentItem &comment) - : mComment(""), mCommentFlag(0) { - - *this = comment.comment; - (*this).mMeta = comment.meta; - -} std::ostream &operator<<(std::ostream &out, const RsPhotoPhoto &photo) { out << "RsPhotoPhoto [ "; @@ -62,7 +50,6 @@ std::ostream &operator<<(std::ostream &out, const RsPhotoPhoto &photo) return out; } - std::ostream &operator<<(std::ostream &out, const RsPhotoAlbum &album) { out << "RsPhotoAlbum [ "; @@ -73,8 +60,10 @@ std::ostream &operator<<(std::ostream &out, const RsPhotoAlbum &album) p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs) : RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXS_TYPE_PHOTO, gixs, photoAuthenPolicy()), + RsPhoto(static_cast(*this)), mPhotoMutex(std::string("Photo Mutex")) { + mCommentService = new p3GxsCommentService(this, RS_SERVICE_GXS_TYPE_PHOTO); } const std::string GXS_PHOTO_APP_NAME = "gxsphoto"; @@ -93,8 +82,6 @@ RsServiceInfo p3PhotoService::getServiceInfo() GXS_PHOTO_MIN_MINOR_VERSION); } - - uint32_t p3PhotoService::photoAuthenPolicy() { uint32_t policy = 0; @@ -124,11 +111,10 @@ bool p3PhotoService::updated() void p3PhotoService::service_tick() { - + mCommentService->comment_tick(); } - void p3PhotoService::groupsChanged(std::list& grpIds) { RsStackMutex stack(mPhotoMutex); @@ -267,54 +253,6 @@ bool p3PhotoService::getPhoto(const uint32_t& token, PhotoResult& photos) return ok; } -bool p3PhotoService::getPhotoComment(const uint32_t &token, PhotoCommentResult &comments) -{ - GxsMsgDataMap msgData; - bool ok = RsGenExchange::getMsgData(token, msgData); - - if(ok) - { - GxsMsgDataMap::iterator mit = msgData.begin(); - - for(; mit != msgData.end(); ++mit) - { - RsGxsGroupId grpId = mit->first; - std::vector& msgItems = mit->second; - std::vector::iterator vit = msgItems.begin(); - - for(; vit != msgItems.end(); ++vit) - { - RsGxsPhotoCommentItem* item = dynamic_cast(*vit); - - if(item) - { - RsPhotoComment comment = item->comment; - comment.mMeta = item->meta; - comments[grpId].push_back(comment); - delete item; - }else - { - std::cerr << "Not a comment Item, deleting!" << std::endl; - delete *vit; - } - } - } - } - - return ok; -} - -RsPhotoComment& RsPhotoComment::operator=(const RsGxsPhotoCommentItem& comment) -{ - *this = comment.comment; - return *this; -} - -bool p3PhotoService::getPhotoRelatedComment(const uint32_t &token, PhotoRelatedCommentResult &comments) -{ - return RsGenExchange::getMsgRelatedDataT(token, comments); -} - bool p3PhotoService::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album) { RsGxsPhotoAlbumItem* albumItem = new RsGxsPhotoAlbumItem(); @@ -324,8 +262,6 @@ bool p3PhotoService::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album) return true; } - - void p3PhotoService::notifyChanges(std::vector& changes) { @@ -363,17 +299,6 @@ bool p3PhotoService::submitPhoto(uint32_t& token, RsPhotoPhoto& photo) return true; } -bool p3PhotoService::submitComment(uint32_t &token, RsPhotoComment &comment) -{ - RsGxsPhotoCommentItem* commentItem = new RsGxsPhotoCommentItem(); - commentItem->comment = comment; - commentItem->meta = comment.mMeta; - commentItem->meta.mMsgFlags = FLAG_MSG_TYPE_PHOTO_COMMENT; - - RsGenExchange::publishMsg(token, commentItem); - return true; -} - bool p3PhotoService::acknowledgeMsg(const uint32_t& token, std::pair& msgId) { @@ -397,4 +322,3 @@ bool p3PhotoService::subscribeToAlbum(uint32_t &token, const RsGxsGroupId &grpId return true; } - diff --git a/libretroshare/src/services/p3photoservice.h b/libretroshare/src/services/p3photoservice.h index d5a5ba661..7bbffd2b0 100644 --- a/libretroshare/src/services/p3photoservice.h +++ b/libretroshare/src/services/p3photoservice.h @@ -24,122 +24,154 @@ #include "gxs/rsgenexchange.h" #include "retroshare/rsphoto.h" +#include "services/p3gxscommon.h" -class p3PhotoService : public RsPhoto, public RsGenExchange +class p3PhotoService : public RsGenExchange, public RsPhoto { public: - p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs); -virtual RsServiceInfo getServiceInfo(); + p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs); + virtual RsServiceInfo getServiceInfo(); -static uint32_t photoAuthenPolicy(); + static uint32_t photoAuthenPolicy(); public: - /*! - * @return true if a change has occured - */ - bool updated(); + /*! + * @return true if a change has occured + */ + bool updated(); - /*! - * - */ - void service_tick(); + /*! + * + */ + void service_tick(); protected: - void notifyChanges(std::vector& changes); + void notifyChanges(std::vector& changes); public: - /** Requests **/ + /** Requests **/ - void groupsChanged(std::list& grpIds); + void groupsChanged(std::list& grpIds); - void msgsChanged(GxsMsgIdResult& msgs); + void msgsChanged(GxsMsgIdResult& msgs); - RsTokenService* getTokenService(); + RsTokenService* getTokenService(); - bool getGroupList(const uint32_t &token, - std::list &groupIds); - bool getMsgList(const uint32_t &token, - GxsMsgIdResult& msgIds); + bool getGroupList(const uint32_t &token, std::list &groupIds); + bool getMsgList(const uint32_t &token, GxsMsgIdResult& msgIds); - /* Generic Summary */ - bool getGroupSummary(const uint32_t &token, - std::list &groupInfo); + /* Generic Summary */ + bool getGroupSummary(const uint32_t &token, std::list &groupInfo); - bool getMsgSummary(const uint32_t &token, - MsgMetaResult &msgInfo); + bool getMsgSummary(const uint32_t &token, MsgMetaResult &msgInfo); - /* Specific Service Data */ - bool getAlbum(const uint32_t &token, std::vector &albums); - bool getPhoto(const uint32_t &token, PhotoResult &photos); - bool getPhotoComment(const uint32_t &token, PhotoCommentResult &comments); - bool getPhotoRelatedComment(const uint32_t &token, PhotoRelatedCommentResult &comments); + /* Specific Service Data */ + bool getAlbum(const uint32_t &token, std::vector &albums); + bool getPhoto(const uint32_t &token, PhotoResult &photos); + +public: + /* Comment service - Provide RsGxsCommentService - redirect to p3GxsCommentService */ + virtual bool getCommentData(uint32_t token, std::vector &msgs) override + { + return mCommentService->getGxsCommentData(token, msgs); + } + + virtual bool getRelatedComments( uint32_t token, std::vector &msgs ) override + { + return mCommentService->getGxsRelatedComments(token, msgs); + } + + virtual bool createNewComment(uint32_t &token, RsGxsComment &msg) override + { + return mCommentService->createGxsComment(token, msg); + } + + virtual bool createNewVote(uint32_t &token, RsGxsVote &msg) override + { + return mCommentService->createGxsVote(token, msg); + } + + virtual bool acknowledgeComment(uint32_t token, std::pair& msgId) override + { + return acknowledgeMsg(token, msgId); + } + + virtual bool acknowledgeVote(uint32_t token, std::pair& msgId) override + { + if (mCommentService->acknowledgeVote(token, msgId)) + { + return true; + } + return acknowledgeMsg(token, msgId); + } public: - /** Modifications **/ + /** Modifications **/ - /*! - * submits album, which returns a token that needs - * to be acknowledge to get album grp id - * @param token token to redeem for acknowledgement - * @param album album to be submitted - */ - bool submitAlbumDetails(uint32_t& token, RsPhotoAlbum &album); + /*! + * submits album, which returns a token that needs + * to be acknowledge to get album grp id + * @param token token to redeem for acknowledgement + * @param album album to be submitted + */ + bool submitAlbumDetails(uint32_t& token, RsPhotoAlbum &album); - /*! - * submits photo, which returns a token that needs - * to be acknowledge to get photo msg-grp id pair - * @param token token to redeem for acknowledgement - * @param photo photo to be submitted - */ - bool submitPhoto(uint32_t& token, RsPhotoPhoto &photo); + /*! + * submits photo, which returns a token that needs + * to be acknowledge to get photo msg-grp id pair + * @param token token to redeem for acknowledgement + * @param photo photo to be submitted + */ + bool submitPhoto(uint32_t& token, RsPhotoPhoto &photo); - /*! - * submits photo comment, which returns a token that needs - * to be acknowledged to get photo msg-grp id pair - * The mParentId needs to be set to an existing msg for which - * commenting is enabled - * @param token token to redeem for acknowledgement - * @param comment comment to be submitted - */ - bool submitComment(uint32_t& token, RsPhotoComment &photo); + /*! + * submits photo comment, which returns a token that needs + * to be acknowledged to get photo msg-grp id pair + * The mParentId needs to be set to an existing msg for which + * commenting is enabled + * @param token token to redeem for acknowledgement + * @param comment comment to be submitted + */ + // bool submitComment(uint32_t& token, RsPhotoComment &photo); - /*! - * subscribes to group, and returns token which can be used - * to be acknowledged to get group Id - * @param token token to redeem for acknowledgement - * @param grpId the id of the group to subscribe to - */ - bool subscribeToAlbum(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe); + /*! + * subscribes to group, and returns token which can be used + * to be acknowledged to get group Id + * @param token token to redeem for acknowledgement + * @param grpId the id of the group to subscribe to + */ + bool subscribeToAlbum(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe); - /*! - * This allows the client service to acknowledge that their msgs has - * been created/modified and retrieve the create/modified msg ids - * @param token the token related to modification/create request - * @param msgIds map of grpid->msgIds of message created/modified - * @return true if token exists false otherwise - */ - bool acknowledgeMsg(const uint32_t& token, std::pair& msgId); + /*! + * This allows the client service to acknowledge that their msgs has + * been created/modified and retrieve the create/modified msg ids + * @param token the token related to modification/create request + * @param msgIds map of grpid->msgIds of message created/modified + * @return true if token exists false otherwise + */ + bool acknowledgeMsg(const uint32_t& token, std::pair& msgId); - /*! + /*! * This allows the client service to acknowledge that their grps has * been created/modified and retrieve the create/modified grp ids * @param token the token related to modification/create request * @param msgIds vector of ids of groups created/modified * @return true if token exists false otherwise */ - bool acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId); + bool acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId); private: + p3GxsCommentService* mCommentService; - std::vector mGroupChange; - std::vector mMsgChange; + std::vector mGroupChange; + std::vector mMsgChange; - RsMutex mPhotoMutex; + RsMutex mPhotoMutex; }; #endif // P3PHOTOSERVICEV2_H diff --git a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp b/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp deleted file mode 100644 index 7481d4a47..000000000 --- a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp * - * * - * Copyright (C) 2018 by Retroshare Team * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program 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 Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#include "AddCommentDialog.h" -#include "ui_AddCommentDialog.h" - -AddCommentDialog::AddCommentDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::AddCommentDialog) -{ - ui->setupUi(this); -} - -AddCommentDialog::~AddCommentDialog() -{ - delete ui; -} - -QString AddCommentDialog::getComment() const -{ - return ui->textEditAddComment->document()->toPlainText(); -} diff --git a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h b/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h deleted file mode 100644 index f2003c132..000000000 --- a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h * - * * - * Copyright (C) 2018 by Retroshare Team * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program 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 Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#ifndef ADDCOMMENTDIALOG_H -#define ADDCOMMENTDIALOG_H - -#include - -namespace Ui { - class AddCommentDialog; -} - -class AddCommentDialog : public QDialog -{ - Q_OBJECT - -public: - explicit AddCommentDialog(QWidget *parent = 0); - ~AddCommentDialog(); - QString getComment() const; - -private: - Ui::AddCommentDialog *ui; -}; - -#endif // ADDCOMMENTDIALOG_H diff --git a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.ui b/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.ui deleted file mode 100644 index d07b9f6dd..000000000 --- a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.ui +++ /dev/null @@ -1,67 +0,0 @@ - - - AddCommentDialog - - - - 0 - 0 - 370 - 118 - - - - Add Comment - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - AddCommentDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - AddCommentDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp deleted file mode 100644 index 42f50c4f0..000000000 --- a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp * - * * - * Copyright (C) 2018 by Retroshare Team * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program 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 Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#include - -#include "PhotoCommentItem.h" -#include "ui_PhotoCommentItem.h" - - -PhotoCommentItem::PhotoCommentItem(const RsPhotoComment& comment, QWidget *parent): - QWidget(parent), - ui(new Ui::PhotoCommentItem), mComment(comment) -{ - ui->setupUi(this); - setUp(); -} - -PhotoCommentItem::~PhotoCommentItem() -{ - delete ui; -} - -const RsPhotoComment& PhotoCommentItem::getComment() -{ - return mComment; -} - -void PhotoCommentItem::setUp() -{ - ui->labelComment->setText(QString::fromUtf8(mComment.mComment.c_str())); - QDateTime qtime; - qtime.setTime_t(mComment.mMeta.mPublishTs); - QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm"); - ui->datetimelabel->setText(timestamp); -} diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h deleted file mode 100644 index eaf95fae7..000000000 --- a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h * - * * - * Copyright (C) 2018 by Retroshare Team * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program 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 Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#ifndef PHOTOCOMMENTITEM_H -#define PHOTOCOMMENTITEM_H - -#include -#include "retroshare/rsphoto.h" - -namespace Ui { - class PhotoCommentItem; -} - -class PhotoCommentItem : public QWidget -{ - Q_OBJECT - -public: - explicit PhotoCommentItem(const RsPhotoComment& comment, QWidget *parent = 0); - ~PhotoCommentItem(); - - const RsPhotoComment& getComment(); - -private: - - void setUp(); -private: - Ui::PhotoCommentItem *ui; - RsPhotoComment mComment; -}; - -#endif // PHOTOCOMMENTITEM_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui deleted file mode 100644 index ce00ee85d..000000000 --- a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui +++ /dev/null @@ -1,200 +0,0 @@ - - - PhotoCommentItem - - - - 0 - 0 - 338 - 60 - - - - Form - - - - 0 - - - - - - 0 - 0 - - - - - 400 - 71 - - - - - - - - - 255 - 255 - 255 - - - - - - - 237 - 239 - 244 - - - - - - - - - 255 - 255 - 255 - - - - - - - 237 - 239 - 244 - - - - - - - - - 237 - 239 - 244 - - - - - - - 237 - 239 - 244 - - - - - - - - true - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/images/no_avatar_70.png - - - true - - - - - - - - 0 - 0 - - - - true - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Qt::Vertical - - - - 29 - 13 - - - - - - - - - 75 - true - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:600; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; color:#666666;">DateTime</span></p></body></html> - - - - - - - - - - - - - diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp index 0d2112304..6251dc38f 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp @@ -23,235 +23,168 @@ #include "PhotoDialog.h" #include "ui_PhotoDialog.h" #include "retroshare/rsidentity.h" -#include "AddCommentDialog.h" +#include "gui/gxs/GxsCommentDialog.h" PhotoDialog::PhotoDialog(RsPhoto *rs_photo, const RsPhotoPhoto &photo, QWidget *parent) : - QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), - ui(new Ui::PhotoDialog), mRsPhoto(rs_photo), mPhotoQueue(new TokenQueue(mRsPhoto->getTokenService(), this)), - mPhotoDetails(photo) + QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), + ui(new Ui::PhotoDialog), mRsPhoto(rs_photo), mPhotoQueue(new TokenQueue(mRsPhoto->getTokenService(), this)), + mPhotoDetails(photo), + mCommentsCreated(false) { - ui->setupUi(this); - setAttribute ( Qt::WA_DeleteOnClose, true ); + ui->setupUi(this); + setAttribute ( Qt::WA_DeleteOnClose, true ); - connect(ui->pushButton_AddComment, SIGNAL(clicked()), this, SLOT(createComment())); - connect(ui->pushButton_AddCommentDlg, SIGNAL(clicked()), this, SLOT(addComment())); - connect(ui->fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen())); + connect(ui->fullscreenButton, SIGNAL(clicked()),this, SLOT(setFullScreen())); + connect(ui->commentsButton, SIGNAL(clicked()),this, SLOT(toggleComments())); + connect(ui->detailsButton, SIGNAL(clicked()),this, SLOT(toggleDetails())); -#if QT_VERSION >= 0x040700 - ui->lineEdit->setPlaceholderText(tr("Write a comment...")) ; -#endif - - setUp(); + setUp(); } PhotoDialog::~PhotoDialog() { - delete ui; - delete mPhotoQueue; + delete ui; + delete mPhotoQueue; } void PhotoDialog::setUp() { - QPixmap qtn; - qtn.loadFromData(mPhotoDetails.mThumbnail.mData, mPhotoDetails.mThumbnail.mSize, "PNG"); - ui->label_Photo->setPixmap(qtn); - ui->lineEdit_Title->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName)); + QPixmap qtn; + qtn.loadFromData(mPhotoDetails.mThumbnail.mData, mPhotoDetails.mThumbnail.mSize, "PNG"); + ui->label_Photo->setPixmap(qtn); + ui->label_Photo->setVisible(true); - requestComments(); + // set size of label to match image. + ui->label_Photo->setMinimumSize(ui->label_Photo->sizeHint()); + // alternative is to scale contents. + // ui->label_Photo->setScaledContents(true); + // Neither are ideal. sizeHint is potentially too large. + // scaled contents - doesn't respect Aspect Ratio... + // + // Ideal soln: + // Allow both, depending on Zoom Factor. + // Auto: use Scale, with correct aspect ratio. + // answer here: https://stackoverflow.com/questions/8211982/qt-resizing-a-qlabel-containing-a-qpixmap-while-keeping-its-aspect-ratio + // Fixed %, then manually scale to that, with scroll area. + + ui->lineEdit_Title->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName)); + ui->frame_comments->setVisible(false); + ui->frame_details->setVisible(false); } -void PhotoDialog::addComment() +void PhotoDialog::toggleDetails() { - AddCommentDialog dlg(this); - if (dlg.exec() == QDialog::Accepted) { - RsPhotoComment comment; - comment.mComment = dlg.getComment().toUtf8().constData(); - - uint32_t token; - comment.mMeta.mGroupId = mPhotoDetails.mMeta.mGroupId; - comment.mMeta.mParentId = mPhotoDetails.mMeta.mOrigMsgId; - mRsPhoto->submitComment(token, comment); - mPhotoQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0); - } + if (ui->frame_details->isVisible()) { + ui->frame_details->setVisible(false); + } else { + ui->frame_details->setVisible(true); + } } -void PhotoDialog::clearComments() +void PhotoDialog::toggleComments() { - //QLayout* l = ui->scrollAreaWidgetContents->layout(); - QSetIterator sit(mComments); - while(sit.hasNext()) - { - PhotoCommentItem* item = sit.next(); - ui->verticalLayout->removeWidget(item); - item->setParent(NULL); - delete item; - } + if (ui->frame_comments->isVisible()) { + ui->frame_comments->setVisible(false); + } else { + if (mCommentsCreated) { + ui->frame_comments->setVisible(true); + } else { + // create CommentDialog. + RsGxsCommentService *commentService = dynamic_cast(mRsPhoto); + GxsCommentDialog *commentDialog = new GxsCommentDialog(this, mRsPhoto->getTokenService(), commentService); - mComments.clear(); + // TODO: Need to fetch all msg versions, otherwise - won't get all the comments. + // For the moment - use current msgid. + // Needs to be passed to PhotoDialog, or fetched here. + + RsGxsGroupId grpId = mPhotoDetails.mMeta.mGroupId; + RsGxsMessageId msgId = mPhotoDetails.mMeta.mMsgId; + + std::set msgv; + msgv.insert(msgId); + msgv.insert(mPhotoDetails.mMeta.mOrigMsgId); // if duplicate will be ignored. + + commentDialog->commentLoad(grpId, msgv,msgId); + + // insert into frame. + QVBoxLayout *vbox = new QVBoxLayout(); + + vbox->addWidget(commentDialog); + ui->frame_comments->setLayout(vbox); + + ui->frame_comments->setVisible(true); + mCommentsCreated = true; + } + } } -void PhotoDialog::resetComments() -{ - QSetIterator sit(mComments); - //QLayout* l = ui->scrollAreaWidgetContents->layout(); - while(sit.hasNext()) - { - PhotoCommentItem* item = sit.next(); - ui->verticalLayout->insertWidget(0,item); - } -} - -void PhotoDialog::requestComments() -{ - RsTokReqOptions opts; - opts.mMsgFlagMask = RsPhoto::FLAG_MSG_TYPE_MASK; - opts.mMsgFlagFilter = RsPhoto::FLAG_MSG_TYPE_PHOTO_COMMENT; - - opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS; - opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA; - opts.mOptions = RS_TOKREQOPT_MSG_PARENT | RS_TOKREQOPT_MSG_LATEST; - RsGxsGrpMsgIdPair msgId; - uint32_t token; - msgId.first = mPhotoDetails.mMeta.mGroupId; - msgId.second = mPhotoDetails.mMeta.mMsgId; - std::vector msgIdV; - msgIdV.push_back(msgId); - mPhotoQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIdV, 0); -} - -void PhotoDialog::createComment() -{ - RsPhotoComment comment; - QString commentString = ui->lineEdit->text(); - - comment.mComment = commentString.toUtf8().constData(); - - uint32_t token; - comment.mMeta.mGroupId = mPhotoDetails.mMeta.mGroupId; - comment.mMeta.mParentId = mPhotoDetails.mMeta.mOrigMsgId; - mRsPhoto->submitComment(token, comment); - mPhotoQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0); - - ui->lineEdit->clear(); -} - - /*************** message loading **********************/ void PhotoDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req) { - std::cerr << "PhotoShare::loadRequest()"; - std::cerr << std::endl; + std::cerr << "PhotoShare::loadRequest()"; + std::cerr << std::endl; - if (queue == mPhotoQueue) - { - /* now switch on req */ - switch(req.mType) - { - case TOKENREQ_MSGINFO: - { - switch(req.mAnsType) - { - case RS_TOKREQ_ANSTYPE_DATA: - loadComment(req.mToken); - break; - case RS_TOKREQ_ANSTYPE_LIST: - loadList(req.mToken); - break; - case RS_TOKREQ_ANSTYPE_ACK: - acknowledgeComment(req.mToken); - break; - default: - std::cerr << "PhotoShare::loadRequest() ERROR: MSG INVALID TYPE"; - std::cerr << std::endl; - break; - } - break; - } + if (queue == mPhotoQueue) + { + /* now switch on req */ + switch(req.mType) + { + case TOKENREQ_MSGINFO: + { + switch(req.mAnsType) + { + case RS_TOKREQ_ANSTYPE_LIST: + loadList(req.mToken); + break; + default: + std::cerr << "PhotoShare::loadRequest() ERROR: MSG INVALID TYPE"; + std::cerr << std::endl; + break; + } + break; + } - default: - { - std::cerr << "PhotoShare::loadRequest() ERROR: INVALID TYPE"; - std::cerr << std::endl; - break; - } - } - } + default: + { + std::cerr << "PhotoShare::loadRequest() ERROR: INVALID TYPE"; + std::cerr << std::endl; + break; + } + } + } } -void PhotoDialog::loadComment(uint32_t token) -{ - - clearComments(); - - PhotoRelatedCommentResult results; - mRsPhoto->getPhotoRelatedComment(token, results); - - PhotoRelatedCommentResult::iterator mit = results.begin(); - - for(; mit != results.end(); ++mit) - { - const std::vector& commentV = mit->second; - std::vector::const_iterator vit = commentV.begin(); - - for(; vit != commentV.end(); ++vit) - { - addComment(*vit); - } - } - - resetComments(); -} - void PhotoDialog::loadList(uint32_t token) { - GxsMsgReq msgIds; - mRsPhoto->getMsgList(token, msgIds); - RsTokReqOptions opts; + GxsMsgReq msgIds; + mRsPhoto->getMsgList(token, msgIds); + RsTokReqOptions opts; - // just use data as no need to worry about getting comments - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - uint32_t reqToken; - mPhotoQueue->requestMsgInfo(reqToken, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, 0); -} - -void PhotoDialog::addComment(const RsPhotoComment &comment) -{ - PhotoCommentItem* item = new PhotoCommentItem(comment); - mComments.insert(item); -} - -void PhotoDialog::acknowledgeComment(uint32_t token) -{ - RsGxsGrpMsgIdPair msgId; - mRsPhoto->acknowledgeMsg(token, msgId); - - if(msgId.first.isNull() || msgId.second.isNull()){ - - }else - { - requestComments(); - } + // just use data as no need to worry about getting comments + opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; + uint32_t reqToken; + mPhotoQueue->requestMsgInfo(reqToken, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, 0); } void PhotoDialog::setFullScreen() { if (!isFullScreen()) { - // hide menu & toolbars + // hide menu & toolbars #ifdef Q_OS_LINUX - show(); - raise(); - setWindowState( windowState() | Qt::WindowFullScreen ); + show(); + raise(); + setWindowState( windowState() | Qt::WindowFullScreen ); #else - setWindowState( windowState() | Qt::WindowFullScreen ); - show(); - raise(); + setWindowState( windowState() | Qt::WindowFullScreen ); + show(); + raise(); #endif } else { - setWindowState( windowState() ^ Qt::WindowFullScreen ); - show(); + setWindowState( windowState() ^ Qt::WindowFullScreen ); + show(); } } diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h index abbd0bd7d..4f2c325eb 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h @@ -25,58 +25,40 @@ #include #include "retroshare/rsphoto.h" #include "util/TokenQueue.h" -#include "PhotoCommentItem.h" namespace Ui { - class PhotoDialog; + class PhotoDialog; } class PhotoDialog : public QDialog, public TokenResponse { - Q_OBJECT + Q_OBJECT public: - explicit PhotoDialog(RsPhoto* rs_photo, const RsPhotoPhoto& photo, QWidget *parent = 0); - ~PhotoDialog(); + explicit PhotoDialog(RsPhoto* rs_photo, const RsPhotoPhoto& photo, QWidget *parent = 0); + ~PhotoDialog(); private slots: - void addComment(); - void createComment(); void setFullScreen(); + void toggleDetails(); + void toggleComments(); public: - void loadRequest(const TokenQueue *queue, const TokenRequest &req); + void loadRequest(const TokenQueue *queue, const TokenRequest &req); private: - void setUp(); + void setUp(); - /*! - * clears comments - * and places them back in dialog - */ - void resetComments(); + void loadList(uint32_t token); - /*! - * Request comments - */ - void requestComments(); - - /*! - * Simply removes comments but doesn't place them back in dialog - */ - void clearComments(); - - void acknowledgeComment(uint32_t token); - void loadComment(uint32_t token); - void loadList(uint32_t token); - void addComment(const RsPhotoComment& comment); private: - Ui::PhotoDialog *ui; + Ui::PhotoDialog *ui; - RsPhoto* mRsPhoto; - TokenQueue* mPhotoQueue; - RsPhotoPhoto mPhotoDetails; - QSet mComments; + RsPhoto* mRsPhoto; + TokenQueue* mPhotoQueue; + RsPhotoPhoto mPhotoDetails; + + bool mCommentsCreated; }; #endif // PHOTODIALOG_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.ui b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.ui index a6689f772..b8ab9d67b 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.ui +++ b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.ui @@ -6,8 +6,8 @@ 0 0 - 594 - 572 + 790 + 824 @@ -16,313 +16,239 @@ true - - - - - - 0 - 1 - + + + + + Qt::Horizontal - - Photo - - - - - - - 0 - 0 - - - - - 200 - 300 - - - - TextLabel - - - - - - - - - - - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - true - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - true - - - - - 0 - 0 - 328 - 20 - - + + + + - + + 0 + 1 + + + + Album / Photo Name + + + + + + + 100 + 100 + + + + true + + + + + 0 + 0 + 558 + 551 + + + + + + + + 0 + 0 + + + + + 200 + 300 + + + + TextLabel + + + + + + + + + + + + + + + + + ... + + + + :/images/window_fullscreen.png:/images/window_fullscreen.png + + + true + + + + + + + Details \/ + + + + + + + + 50 % + + + + + 75 % + + + + + 100 % + + + + + 200 % + + + + + + + + <N> Comments >> + + + + + + + + + + 0 0 - - - - - 1 + + + 50 + 0 + + + + + + + false - + + + 0 + 0 + + + + + + + + Caption + + + + + + + false + + + + 0 + 0 + + + + + + + + Where: + + + + + + + false + + + + 0 + 0 + + + + + + + + false + + + + 0 + 0 + + + + + + + + Photo Title: + + + + + + + When + + - - - - - - - - - Comment - - - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - Summary - - - - - - false - - - - 0 - 0 - - - - - - - - Caption - - - - - - - false - - - - 0 - 0 - - - - - - - - Where: - - - - - - - false - - - - 0 - 0 - - - - - - - - false - - - - 0 - 0 - - - - - - - - Photo Title: - - - - - - - When - - - - - - - - - - ... - - - - :/images/window_fullscreen.png:/images/window_fullscreen.png - - - true - - - - - - - Qt::Horizontal - - - - 238 - 20 - - - - - - - - Add Comment - + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp index 16991b72f..908a3027c 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp @@ -165,7 +165,6 @@ void GxsGroupDialog::injectExtraWidget(QWidget *widget) // add extra widget into layout. QVBoxLayout *vbox = new QVBoxLayout(); vbox->addWidget(widget); - vbox->addStretch(1); ui.extraFrame->setLayout(vbox); } diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index f5e25f593..c7de7add3 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -1164,10 +1164,8 @@ gxsphotoshare { gui/PhotoShare/PhotoShareItemHolder.h \ gui/PhotoShare/PhotoShare.h \ gui/PhotoShare/PhotoSlideShow.h \ - gui/PhotoShare/PhotoDialog.h \ - gui/PhotoShare/PhotoCommentItem.h \ - gui/PhotoShare/AddCommentDialog.h - + gui/PhotoShare/PhotoDialog.h + FORMS += \ gui/PhotoShare/AlbumExtra.ui \ gui/PhotoShare/PhotoItem.ui \ @@ -1176,10 +1174,8 @@ gxsphotoshare { gui/PhotoShare/AlbumDialog.ui \ gui/PhotoShare/AlbumCreateDialog.ui \ gui/PhotoShare/PhotoShare.ui \ - gui/PhotoShare/PhotoSlideShow.ui \ - gui/PhotoShare/PhotoCommentItem.ui \ - gui/PhotoShare/AddCommentDialog.ui - + gui/PhotoShare/PhotoSlideShow.ui + SOURCES += \ gui/PhotoShare/AlbumGroupDialog.cpp \ gui/PhotoShare/AlbumExtra.cpp \ @@ -1191,10 +1187,8 @@ gxsphotoshare { gui/PhotoShare/AlbumCreateDialog.cpp \ gui/PhotoShare/PhotoShareItemHolder.cpp \ gui/PhotoShare/PhotoShare.cpp \ - gui/PhotoShare/PhotoSlideShow.cpp \ - gui/PhotoShare/PhotoCommentItem.cpp \ - gui/PhotoShare/AddCommentDialog.cpp - + gui/PhotoShare/PhotoSlideShow.cpp + RESOURCES += gui/PhotoShare/Photo_images.qrc }