@ -25,8 +25,10 @@
|
||||
#include <inttypes.h>
|
||||
#include <string>
|
||||
#include <list>
|
||||
#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<RsGxsGroupId, std::vector<RsPhotoPhoto> > PhotoResult;
|
||||
typedef std::map<RsGxsGroupId, std::vector<RsPhotoComment> > PhotoCommentResult;
|
||||
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsPhotoComment> > 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
|
||||
|
@ -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<uint32_t>(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();
|
||||
|
@ -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;
|
||||
|
@ -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<RsGxsIface&>(*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<RsGxsGroupId>& 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<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsPhotoCommentItem* item = dynamic_cast<RsGxsPhotoCommentItem*>(*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<RsGxsPhotoCommentItem, RsPhotoComment>(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<RsGxsNotify*>& 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<RsGxsGroupId, RsGxsMessageId>& msgId)
|
||||
{
|
||||
@ -397,4 +322,3 @@ bool p3PhotoService::subscribeToAlbum(uint32_t &token, const RsGxsGroupId &grpId
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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<RsGxsNotify*>& changes);
|
||||
void notifyChanges(std::vector<RsGxsNotify*>& changes);
|
||||
public:
|
||||
|
||||
/** Requests **/
|
||||
/** Requests **/
|
||||
|
||||
void groupsChanged(std::list<RsGxsGroupId>& grpIds);
|
||||
void groupsChanged(std::list<RsGxsGroupId>& grpIds);
|
||||
|
||||
|
||||
void msgsChanged(GxsMsgIdResult& msgs);
|
||||
void msgsChanged(GxsMsgIdResult& msgs);
|
||||
|
||||
RsTokenService* getTokenService();
|
||||
RsTokenService* getTokenService();
|
||||
|
||||
bool getGroupList(const uint32_t &token,
|
||||
std::list<RsGxsGroupId> &groupIds);
|
||||
bool getMsgList(const uint32_t &token,
|
||||
GxsMsgIdResult& msgIds);
|
||||
bool getGroupList(const uint32_t &token, std::list<RsGxsGroupId> &groupIds);
|
||||
bool getMsgList(const uint32_t &token, GxsMsgIdResult& msgIds);
|
||||
|
||||
/* Generic Summary */
|
||||
bool getGroupSummary(const uint32_t &token,
|
||||
std::list<RsGroupMetaData> &groupInfo);
|
||||
/* Generic Summary */
|
||||
bool getGroupSummary(const uint32_t &token, std::list<RsGroupMetaData> &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<RsPhotoAlbum> &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<RsPhotoAlbum> &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<RsGxsComment> &msgs) override
|
||||
{
|
||||
return mCommentService->getGxsCommentData(token, msgs);
|
||||
}
|
||||
|
||||
virtual bool getRelatedComments( uint32_t token, std::vector<RsGxsComment> &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<RsGxsGroupId, RsGxsMessageId>& msgId) override
|
||||
{
|
||||
return acknowledgeMsg(token, msgId);
|
||||
}
|
||||
|
||||
virtual bool acknowledgeVote(uint32_t token, std::pair<RsGxsGroupId, RsGxsMessageId>& 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<RsGxsGroupId, RsGxsMessageId>& 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<RsGxsGroupId, RsGxsMessageId>& 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<RsGxsGroupChange*> mGroupChange;
|
||||
std::vector<RsGxsMsgChange*> mMsgChange;
|
||||
std::vector<RsGxsGroupChange*> mGroupChange;
|
||||
std::vector<RsGxsMsgChange*> mMsgChange;
|
||||
|
||||
RsMutex mPhotoMutex;
|
||||
RsMutex mPhotoMutex;
|
||||
};
|
||||
|
||||
#endif // P3PHOTOSERVICEV2_H
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1573</width>
|
||||
<height>1177</height>
|
||||
<width>987</width>
|
||||
<height>584</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -289,8 +289,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1003</width>
|
||||
<height>1094</height>
|
||||
<width>634</width>
|
||||
<height>523</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="scrollAreaWidgetContentsVLayout">
|
||||
@ -533,24 +533,14 @@ border-image: url(:/images/closepressed.png)
|
||||
<string>Identity info</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_KeyId">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_YourOpinion">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_GpgId">
|
||||
<property name="text">
|
||||
<string>Your opinion:</string>
|
||||
<string>Owner node ID :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="2" colspan="2">
|
||||
<item row="13" column="1">
|
||||
<widget class="QLineEdit" name="overallOpinion_TF">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Overall reputation score, accounting for yours and your friends'.</p><p>Negative is bad, positive is good. Zero is neutral. If the score is too low,</p><p>the identity is flagged as bad, and will be filtered out in forums, chat lobbies,</p><p>channels, etc.</p></body></html></string>
|
||||
@ -560,130 +550,7 @@ border-image: url(:/images/closepressed.png)
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_LastUsed">
|
||||
<property name="text">
|
||||
<string>Last used:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_Type">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_Nickname">
|
||||
<property name="text">
|
||||
<string>Identity name :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="4">
|
||||
<widget class="Line" name="line_IdInfo">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" rowspan="2" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_GpgName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2" colspan="2">
|
||||
<widget class="QComboBox" name="ownOpinion_CB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><!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:'Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Your own opinion about an identity rules the visibility of that identity for yourself and your friend nodes. Your own opinion is shared among friends and used to compute a reputation score: If your opinion about an identity is neutral, the reputation score is the difference between friend's positive and negative opinions. If not, your own opinion gives the score.</p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The overall score is used in chat lobbies, forums and channels to decide on the actions to take for each specific identity. When the overall score is lower than -1, the identity is banned, which prevents all messages and forums/channels authored by this identity to be forwarded, both ways. Some forums also have special anti-spam flags that require a non negative reputation level, making them more sensitive to bad opinions. Banned identities gradually lose their activity and eventually disappear (after 5 days).</p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You can change the thresholds and the time of inactivity to delete identities in preferences -&gt; people. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Negative</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/thumbs-down.png</normaloff>:/icons/png/thumbs-down.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neutral</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/thumbs-neutral.png</normaloff>:/icons/png/thumbs-neutral.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Positive</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/thumbs-up.png</normaloff>:/icons/png/thumbs-up.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_LastUsed">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_Type">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" rowspan="2" colspan="2">
|
||||
<widget class="QLabel" name="label_GpgName">
|
||||
<property name="text">
|
||||
<string>Owner node name :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_GpgId">
|
||||
<property name="text">
|
||||
<string>Owner node ID :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2" colspan="2">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_GpgId">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -693,50 +560,12 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="2">
|
||||
<widget class="QLabel" name="banoption_label">
|
||||
<property name="text">
|
||||
<string>Ban-option:</string>
|
||||
<item row="0" column="2" rowspan="14">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="2">
|
||||
<widget class="QLabel" name="neighborNodesOpinion_LB">
|
||||
<property name="text">
|
||||
<string>Friend votes:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Average opinion of neighbor nodes about this identity. Negative is bad,</p><p>positive is good. Zero is neutral.</p></body></html></string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="2" colspan="2">
|
||||
<widget class="QCheckBox" name="autoBanIdentities_CB">
|
||||
<property name="text">
|
||||
<string>Auto-Ban all identities signed by the same node</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_Nickname">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4" rowspan="9">
|
||||
<layout class="QGridLayout" name="avatarGLayout">
|
||||
<item row="0" column="0">
|
||||
<item>
|
||||
<widget class="QLabel" name="avatarLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -773,18 +602,21 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item>
|
||||
<widget class="QPushButton" name="inviteButton">
|
||||
<property name="text">
|
||||
<string>Send Invite</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="avatarOpinionHLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_PosIcon">
|
||||
<property name="maximumSize">
|
||||
@ -862,7 +694,7 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item>
|
||||
<spacer name="avatarVSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -877,7 +709,21 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="2">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_Type">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_Type">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="overallOpinion_LB">
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -890,27 +736,170 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_LastUsed">
|
||||
<property name="text">
|
||||
<string>Last used:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_KeyId">
|
||||
<property name="text">
|
||||
<string>Identity ID :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_PublishTS">
|
||||
<property name="text">
|
||||
<string>Created on :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_GpgName">
|
||||
<property name="text">
|
||||
<string>Owner node name :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="banoption_label">
|
||||
<property name="text">
|
||||
<string>Ban-option:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="label_YourOpinion">
|
||||
<property name="text">
|
||||
<string>Your opinion:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Average opinion of neighbor nodes about this identity. Negative is bad,</p><p>positive is good. Zero is neutral.</p></body></html></string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_LastUsed">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1" rowspan="2">
|
||||
<widget class="QComboBox" name="ownOpinion_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p><span style=" font-family:'Sans'; font-size:9pt;">Your own opinion about an identity rules the visibility of that identity for yourself and your friend nodes. Your own opinion is shared among friends and used to compute a reputation score: If your opinion about an identity is neutral, the reputation score is the difference between friend's positive and negative opinions. If not, your own opinion gives the score.</span></p><p><span style=" font-family:'Sans'; font-size:9pt;">The overall score is used in chat lobbies, forums and channels to decide on the actions to take for each specific identity. When the overall score is lower than -1, the identity is banned, which prevents all messages and forums/channels authored by this identity to be forwarded, both ways. Some forums also have special anti-spam flags that require a non negative reputation level, making them more sensitive to bad opinions. Banned identities gradually lose their activity and eventually disappear (after 5 days).</span></p><p><span style=" font-family:'Sans'; font-size:9pt;">You can change the thresholds and the time of inactivity to delete identities in preferences -&gt; people. </span></p></body></html></string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Negative</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/thumbs-down.png</normaloff>:/icons/png/thumbs-down.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Neutral</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/thumbs-neutral.png</normaloff>:/icons/png/thumbs-neutral.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Positive</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/thumbs-up.png</normaloff>:/icons/png/thumbs-up.png</iconset>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_Nickname">
|
||||
<property name="text">
|
||||
<string>Identity name :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="autoBanIdentities_CB">
|
||||
<property name="text">
|
||||
<string>Auto-Ban all identities signed by the same node</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_GpgName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_PublishTS">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="neighborNodesOpinion_LB">
|
||||
<property name="text">
|
||||
<string>Friend votes:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_Nickname">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="Line" name="line_IdInfo">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_KeyId">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -1,39 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp *
|
||||
* *
|
||||
* Copyright (C) 2018 by Retroshare Team <retroshare.project@gmail.com> *
|
||||
* *
|
||||
* 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 <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#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();
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h *
|
||||
* *
|
||||
* Copyright (C) 2018 by Retroshare Team <retroshare.project@gmail.com> *
|
||||
* *
|
||||
* 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 <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef ADDCOMMENTDIALOG_H
|
||||
#define ADDCOMMENTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
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
|
@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AddCommentDialog</class>
|
||||
<widget class="QDialog" name="AddCommentDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>370</width>
|
||||
<height>118</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Add Comment</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEditAddComment"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>AddCommentDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>AddCommentDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -1,52 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp *
|
||||
* *
|
||||
* Copyright (C) 2018 by Retroshare Team <retroshare.project@gmail.com> *
|
||||
* *
|
||||
* 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 <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#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);
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h *
|
||||
* *
|
||||
* Copyright (C) 2018 by Retroshare Team <retroshare.project@gmail.com> *
|
||||
* *
|
||||
* 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 <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef PHOTOCOMMENTITEM_H
|
||||
#define PHOTOCOMMENTITEM_H
|
||||
|
||||
#include <QWidget>
|
||||
#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
|
@ -1,200 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PhotoCommentItem</class>
|
||||
<widget class="QWidget" name="PhotoCommentItem">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>338</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="expandFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>71</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>237</red>
|
||||
<green>239</green>
|
||||
<blue>244</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>237</red>
|
||||
<green>239</green>
|
||||
<blue>244</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>237</red>
|
||||
<green>239</green>
|
||||
<blue>244</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>237</red>
|
||||
<green>239</green>
|
||||
<blue>244</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/no_avatar_70.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="2" colspan="2">
|
||||
<widget class="QLabel" name="labelComment">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>29</width>
|
||||
<height>13</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLabel" name="datetimelabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="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></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -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<PhotoCommentItem*> 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<RsGxsCommentService *>(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<RsGxsMessageId> 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<PhotoCommentItem*> 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<RsGxsGrpMsgIdPair> 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<RsPhotoComment>& commentV = mit->second;
|
||||
std::vector<RsPhotoComment>::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();
|
||||
}
|
||||
}
|
||||
|
@ -25,58 +25,40 @@
|
||||
#include <QSet>
|
||||
#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<PhotoCommentItem*> mComments;
|
||||
RsPhoto* mRsPhoto;
|
||||
TokenQueue* mPhotoQueue;
|
||||
RsPhotoPhoto mPhotoDetails;
|
||||
|
||||
bool mCommentsCreated;
|
||||
};
|
||||
|
||||
#endif // PHOTODIALOG_H
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>594</width>
|
||||
<height>572</height>
|
||||
<width>790</width>
|
||||
<height>824</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -16,313 +16,239 @@
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="albumGroup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Photo</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Photo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="2" colspan="2">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>328</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="albumGroup">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Album / Photo Name</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>558</width>
|
||||
<height>551</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Photo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QToolButton" name="fullscreenButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/window_fullscreen.png</normaloff>:/images/window_fullscreen.png</iconset>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="detailsButton">
|
||||
<property name="text">
|
||||
<string>Details \/</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>50 %</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>75 %</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>100 %</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>200 %</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="commentsButton">
|
||||
<property name="text">
|
||||
<string><N> Comments >></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_details">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</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>
|
||||
</layout>
|
||||
<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_8">
|
||||
<property name="text">
|
||||
<string>Caption</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" 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="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Where:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" 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="3" 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>Photo Title:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>When</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pushButton_AddComment">
|
||||
<property name="text">
|
||||
<string>Comment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</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_8">
|
||||
<property name="text">
|
||||
<string>Caption</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" 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="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Where:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" 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="3" 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>Photo Title:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>When</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QToolButton" name="fullscreenButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/window_fullscreen.png</normaloff>:/images/window_fullscreen.png</iconset>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>238</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pushButton_AddCommentDlg">
|
||||
<property name="text">
|
||||
<string>Add Comment</string>
|
||||
</property>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame_comments">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -279,13 +279,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="shareimagecheckBox">
|
||||
<property name="text">
|
||||
<string>Share Orginal Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="maximumSize">
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "rshare.h"
|
||||
#include "PostedItem.h"
|
||||
#include "gui/feeds/FeedHolder.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/HandleRichText.h"
|
||||
@ -132,6 +133,7 @@ void PostedItem::setup()
|
||||
|
||||
ui->clearButton->hide();
|
||||
ui->readAndClearButton->hide();
|
||||
ui->nameLabel->hide();
|
||||
}
|
||||
|
||||
bool PostedItem::setGroup(const RsPostedGroup &group, bool doFill)
|
||||
@ -250,6 +252,9 @@ void PostedItem::fill()
|
||||
/* Wait for all requests */
|
||||
return;
|
||||
}
|
||||
|
||||
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_POSTED, mGroup.mMeta.mGroupId, groupName());
|
||||
ui->nameLabel->setText(link.toHtml());
|
||||
|
||||
QPixmap sqpixmap2 = QPixmap(":/images/thumb-default.png");
|
||||
|
||||
@ -392,11 +397,13 @@ void PostedItem::fill()
|
||||
{
|
||||
ui->clearButton->hide();
|
||||
ui->readAndClearButton->hide();
|
||||
ui->nameLabel->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->clearButton->show();
|
||||
ui->readAndClearButton->show();
|
||||
ui->nameLabel->show();
|
||||
}
|
||||
|
||||
// disable voting buttons - if they have already voted.
|
||||
|
@ -320,6 +320,23 @@
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<italic>true</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="fromBoldLabel">
|
||||
<property name="sizePolicy">
|
||||
|
@ -73,7 +73,7 @@
|
||||
#define IMAGE_NEWFORUM ":/images/new_forum16.png"
|
||||
#define IMAGE_FORUMAUTHD ":/images/konv_message2.png"
|
||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||
#define IMAGE_WIKI ":/images/wikibook_32.png"
|
||||
#define IMAGE_WIKI ":/icons/png/wiki.png"
|
||||
#define IMAGE_EDIT ":/images/edit_16.png"
|
||||
|
||||
|
||||
@ -108,10 +108,10 @@ WikiDialog::WikiDialog(QWidget *parent)
|
||||
|
||||
|
||||
/* Setup Group Tree */
|
||||
mYourGroups = ui.groupTreeWidget->addCategoryItem(tr("My Groups"), QIcon(IMAGE_FOLDER), true);
|
||||
mSubscribedGroups = ui.groupTreeWidget->addCategoryItem(tr("Subscribed Groups"), QIcon(IMAGE_FOLDERRED), true);
|
||||
mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(IMAGE_FOLDERGREEN), false);
|
||||
mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(IMAGE_FOLDERYELLOW), false);
|
||||
mYourGroups = ui.groupTreeWidget->addCategoryItem(tr("My Groups"), QIcon(), true);
|
||||
mSubscribedGroups = ui.groupTreeWidget->addCategoryItem(tr("Subscribed Groups"), QIcon(), true);
|
||||
mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(), false);
|
||||
mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(), false);
|
||||
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="titleBarFrame">
|
||||
<widget class="QFrame" name="toolBarFrameTop">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
@ -51,7 +51,16 @@
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -66,7 +75,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="Wiki_images.qrc">:/images/wikibook_32.png</pixmap>
|
||||
<pixmap resource="../icons.qrc">:/icons/png/wiki.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
@ -93,8 +102,8 @@
|
||||
<string>New Group</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Wiki_images.qrc">
|
||||
<normaloff>:/images/resource-group-new.png</normaloff>:/images/resource-group-new.png</iconset>
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/png/add.png</normaloff>:/icons/png/add.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -123,12 +132,21 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>232</width>
|
||||
<height>462</height>
|
||||
<width>241</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -186,7 +204,16 @@
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -261,7 +288,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Wiki_images.qrc">
|
||||
<normaloff>:/images/republish.png</normaloff>:/images/republish.png</iconset>
|
||||
<normaloff>:/images/reload.png</normaloff>:/images/reload.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -284,7 +311,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Wiki_images.qrc">
|
||||
<normaloff>:/images/story-editor.png</normaloff>:/images/story-editor.png</iconset>
|
||||
<normaloff>:/images/editpage.png</normaloff>:/images/editpage.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -314,7 +341,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Wiki_images.qrc">
|
||||
<normaloff>:/images/appointment-new.png</normaloff>:/images/appointment-new.png</iconset>
|
||||
<normaloff>:/images/addpage.png</normaloff>:/images/addpage.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -340,7 +367,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="Wiki_images.qrc">
|
||||
<normaloff>:/images/republish.png</normaloff>:/images/republish.png</iconset>
|
||||
<normaloff>:/images/reload.png</normaloff>:/images/reload.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -392,8 +419,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>501</width>
|
||||
<height>462</height>
|
||||
<width>510</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -443,6 +470,7 @@
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="Wiki_images.qrc"/>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -414,7 +414,7 @@ void WikiEditDialog::setNewPage()
|
||||
ui.groupBox_History->hide();
|
||||
ui.pushButton_History->setText(tr("Show Edit History"));
|
||||
|
||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/appointment-new_64.png"));
|
||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/addpage.png"));
|
||||
ui.headerFrame->setHeaderText(tr("Create New Wiki Page"));
|
||||
setWindowTitle(tr("Create New Wiki Page"));
|
||||
|
||||
@ -569,7 +569,7 @@ void WikiEditDialog::setupData(const RsGxsGroupId &groupId, const RsGxsMessageId
|
||||
requestPage(msgId);
|
||||
}
|
||||
|
||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/story-editor_48.png"));
|
||||
ui.headerFrame->setHeaderImage(QPixmap(":/images/editpage.png"));
|
||||
ui.headerFrame->setHeaderText(tr("Edit Wiki Page"));
|
||||
setWindowTitle(tr("Edit Wiki Page"));
|
||||
|
||||
|
@ -1,17 +1,9 @@
|
||||
<RCC>
|
||||
<qresource prefix="/" >
|
||||
<file>images/appointment-new.png</file>
|
||||
<file>images/appointment-new_64.png</file>
|
||||
<file>images/arrow-left.png</file>
|
||||
<file>images/arrow-right.png</file>
|
||||
<file>images/book2_32.png</file>
|
||||
<file>images/story-editor.png</file>
|
||||
<file>images/story-editor_48.png</file>
|
||||
<file>images/republish.png</file>
|
||||
<file>images/resource-group-new.png</file>
|
||||
<file>images/resource-group_64.png</file>
|
||||
<file>images/resource-group-new_48.png</file>
|
||||
<file>images/resource-group-new_64.png</file>
|
||||
<file>images/wikibook_32.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/">
|
||||
<file>images/arrow-left.png</file>
|
||||
<file>images/arrow-right.png</file>
|
||||
<file>images/addpage.png</file>
|
||||
<file>images/editpage.png</file>
|
||||
<file>images/reload.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
retroshare-gui/src/gui/WikiPoos/images/addpage.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1019 B After Width: | Height: | Size: 962 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1006 B After Width: | Height: | Size: 944 B |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 786 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.6 KiB |
BIN
retroshare-gui/src/gui/WikiPoos/images/editpage.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
retroshare-gui/src/gui/WikiPoos/images/reload.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.5 KiB |
@ -19,6 +19,7 @@
|
||||
*******************************************************************************/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "util/misc.h"
|
||||
#include "util/DateTime.h"
|
||||
@ -105,7 +106,6 @@ void GxsGroupDialog::init()
|
||||
|
||||
|
||||
connect(ui.groupLogo, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
|
||||
connect(ui.addLogoButton, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
|
||||
|
||||
ui.typePublic->setChecked(true);
|
||||
ui.distributionValueLabel->setText(tr("Public"));
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -377,7 +376,6 @@ void GxsGroupDialog::setupVisibility()
|
||||
ui.groupName->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_NAME);
|
||||
|
||||
ui.groupLogo->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_ICON);
|
||||
ui.addLogoButton->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_ICON);
|
||||
|
||||
ui.groupDesc->setVisible(mEnabledFlags & GXS_GROUP_FLAGS_DESCRIPTION);
|
||||
|
||||
@ -418,8 +416,6 @@ void GxsGroupDialog::setAllReadonly()
|
||||
void GxsGroupDialog::setupReadonly()
|
||||
{
|
||||
|
||||
ui.addLogoButton->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_ICON));
|
||||
|
||||
ui.publishGroupBox->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_PUBLISHSIGN));
|
||||
|
||||
ui.pubKeyShare_cb->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_SHAREKEYS));
|
||||
|
@ -59,160 +59,114 @@
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="horizontalSpacing">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="ClickableLabel" name="groupLogo">
|
||||
<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="toolTip">
|
||||
<string><html><head/><body><p>Click to add a Logo</p></body></html></string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../icons.qrc">:/icons/png/add-image.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="groupLogo">
|
||||
<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="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images.qrc">:/images/channels.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="groupName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="addLogoButton">
|
||||
<property name="text">
|
||||
<string>Add Icon</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<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="QLabel" name="label_2">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The identity here can be used to send feedback.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Owner:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="addAdmins_cb">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add moderators</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/settings/permissions.svg</normaloff>:/icons/settings/permissions.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="pubKeyShare_cb">
|
||||
<property name="toolTip">
|
||||
<string>Key recipients can publish to restricted-type group and can view and publish for private-type channels</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Share Publish Key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="groupName"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>132</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The identity here can be used to send feedback.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Owner:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="addAdmins_cb">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add moderators</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/settings/permissions.svg</normaloff>:/icons/settings/permissions.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QCheckBox" name="pubKeyShare_cb">
|
||||
<property name="toolTip">
|
||||
<string>Key recipients can publish to restricted-type group and can view and publish for private-type channels</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Share Publish Key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -894,6 +848,11 @@
|
||||
<extends>QComboBox</extends>
|
||||
<header>gui/common/GroupChooser.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ClickableLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>util/ClickableLabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
|
@ -87,7 +87,7 @@ void WikiGroupDialog::initUi()
|
||||
|
||||
QPixmap WikiGroupDialog::serviceImage()
|
||||
{
|
||||
return QPixmap(":/images/resource-group-new_64.png");
|
||||
return QPixmap(":/icons/png/wiki.png");
|
||||
}
|
||||
|
||||
bool WikiGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
|
||||
|
@ -813,6 +813,11 @@ GxsChannelPostsWidget QToolButton#subscribeToolButton::menu-button {
|
||||
|
||||
}
|
||||
|
||||
GxsGroupDialog QLabel#groupLogo{
|
||||
border: 2px solid #CCCCCC;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
PostedItem QFrame#frame_notes {
|
||||
background: white;
|
||||
}
|
||||
@ -880,12 +885,12 @@ PostedCreatePostDialog QPushButton#submitButton {
|
||||
border-radius: 4px;
|
||||
max-height: 27px;
|
||||
min-width: 4em;
|
||||
padding: 2px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
PostedCreatePostDialog QPushButton#submitButton:hover {
|
||||
background: #03b1f3;
|
||||
border-radius: 4px;
|
||||
min-width: 4em;
|
||||
padding: 2px;
|
||||
}
|
||||
padding: 2px;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ signals:
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
|
||||
void enterEvent(QEvent *ev) override { setStyleSheet("QLabel { border: 1px solid #3A3939; }");}
|
||||
void enterEvent(QEvent *ev) override { setStyleSheet("QLabel { border: 2px solid #039bd5; }");}
|
||||
|
||||
void leaveEvent(QEvent *ev) override { setStyleSheet("QLabel { border: 2px solid #CCCCCC; border-radius: 3px; }");}
|
||||
|
||||
|