mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #1831 from drbob/thewire_fix_message_display
TheWire fixup up display of messages
This commit is contained in:
commit
25467dda9f
@ -4412,7 +4412,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_
|
||||
if(details.mReputation.mOverallReputationLevel < minReputationForForwardingMessages(grpMeta->mSignFlags, details.mFlags))
|
||||
{
|
||||
#ifdef NXS_NET_DEBUG_0
|
||||
GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " not sending item ID " << (*vit)->mMsgId << ", because the author is flags " << std::hex << details.mFlags << std::dec << " and reputation level " << details.mReputation.mOverallReputationLevel << std::endl;
|
||||
GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " not sending item ID " << (*vit)->mMsgId << ", because the author is flags " << std::hex << details.mFlags << std::dec << " and reputation level " << (int) details.mReputation.mOverallReputationLevel << std::endl;
|
||||
#endif
|
||||
continue ;
|
||||
}
|
||||
|
@ -62,13 +62,10 @@ public:
|
||||
#define RSPHOTO_SHAREMODE_DUP_200K (4)
|
||||
#define RSPHOTO_SHAREMODE_DUP_1M (5)
|
||||
|
||||
class RsPhotoAlbum
|
||||
struct RsPhotoAlbum: RsGxsGenericGroupData
|
||||
{
|
||||
public:
|
||||
RsPhotoAlbum();
|
||||
|
||||
RsGroupMetaData mMeta;
|
||||
|
||||
// V2 Album - keep it simple.
|
||||
// mMeta.mTitle.
|
||||
uint32_t mShareMode;
|
||||
@ -221,7 +218,29 @@ public:
|
||||
*/
|
||||
virtual bool acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId) = 0;
|
||||
|
||||
// Blocking versions.
|
||||
/*!
|
||||
* request to create a new album. Blocks until process completes.
|
||||
* @param album album to be submitted
|
||||
* @return true if created false otherwise
|
||||
*/
|
||||
virtual bool createAlbum(RsPhotoAlbum &album) = 0;
|
||||
|
||||
/*!
|
||||
* request to update an existing album. Blocks until process completes.
|
||||
* @param album album to be submitted
|
||||
* @return true if created false otherwise
|
||||
*/
|
||||
virtual bool updateAlbum(const RsPhotoAlbum &album) = 0;
|
||||
|
||||
/*!
|
||||
* retrieve albums based in groupIds.
|
||||
* @param groupIds the ids to fetch.
|
||||
* @param albums vector to be filled by request.
|
||||
* @return true is successful, false otherwise.
|
||||
*/
|
||||
virtual bool getAlbums(const std::list<RsGxsGroupId> &groupIds,
|
||||
std::vector<RsPhotoAlbum> &albums) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -69,22 +69,17 @@ class CollectionRef
|
||||
std::string CollectionId;
|
||||
};
|
||||
|
||||
|
||||
class RsWikiCollection
|
||||
struct RsWikiCollection: RsGxsGenericGroupData
|
||||
{
|
||||
public:
|
||||
|
||||
RsGroupMetaData mMeta;
|
||||
|
||||
std::string mDescription;
|
||||
std::string mCategory;
|
||||
|
||||
std::string mHashTags;
|
||||
|
||||
//std::map<std::string, CollectionRef> linkReferences;
|
||||
// std::map<std::string, CollectionRef> linkReferences;
|
||||
};
|
||||
|
||||
|
||||
class RsWikiSnapshot
|
||||
{
|
||||
public:
|
||||
@ -129,6 +124,11 @@ virtual bool submitComment(uint32_t &token, RsWikiComment &comment) = 0;
|
||||
|
||||
virtual bool updateCollection(uint32_t &token, RsWikiCollection &collection) = 0;
|
||||
|
||||
// Blocking Interfaces.
|
||||
virtual bool createCollection(RsWikiCollection &collection) = 0;
|
||||
virtual bool updateCollection(const RsWikiCollection &collection) = 0;
|
||||
virtual bool getCollections(const std::list<RsGxsGroupId> groupIds, std::vector<RsWikiCollection> &groups) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -34,16 +34,13 @@
|
||||
class RsWire;
|
||||
extern RsWire *rsWire;
|
||||
|
||||
class RsWireGroup
|
||||
struct RsWireGroup: RsGxsGenericGroupData
|
||||
{
|
||||
public:
|
||||
|
||||
RsGroupMetaData mMeta;
|
||||
std::string mDescription;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* RsWire - is intended to be a Twitter clone - but fully decentralised.
|
||||
*
|
||||
@ -154,6 +151,11 @@ virtual bool getPulseData(const uint32_t &token, std::vector<RsWirePulse> &pulse
|
||||
virtual bool createGroup(uint32_t &token, RsWireGroup &group) = 0;
|
||||
virtual bool createPulse(uint32_t &token, RsWirePulse &pulse) = 0;
|
||||
|
||||
// Blocking Interfaces.
|
||||
virtual bool createGroup(RsWireGroup &group) = 0;
|
||||
virtual bool updateGroup(const RsWireGroup &group) = 0;
|
||||
virtual bool getGroups(const std::list<RsGxsGroupId> grpIds, std::vector<RsWireGroup> &groups) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1376,6 +1376,8 @@ int RsServer::StartupRetroShare()
|
||||
mPhoto, mPhoto->getServiceInfo(),
|
||||
mReputations, mGxsCircles,mGxsIdService,
|
||||
pgpAuxUtils);
|
||||
|
||||
mPhoto->setNetworkExchangeService(photo_ns);
|
||||
#endif
|
||||
|
||||
#ifdef RS_USE_WIRE
|
||||
@ -1391,6 +1393,8 @@ int RsServer::StartupRetroShare()
|
||||
mWire, mWire->getServiceInfo(),
|
||||
mReputations, mGxsCircles,mGxsIdService,
|
||||
pgpAuxUtils);
|
||||
|
||||
mWire->setNetworkExchangeService(wire_ns);
|
||||
#endif
|
||||
// now add to p3service
|
||||
pqih->addService(gxsid_ns, true);
|
||||
|
@ -317,3 +317,38 @@ bool p3PhotoService::subscribeToAlbum(uint32_t &token, const RsGxsGroupId &grpId
|
||||
return true;
|
||||
}
|
||||
|
||||
// Blocking versions =============================================================
|
||||
|
||||
bool p3PhotoService::createAlbum(RsPhotoAlbum &album)
|
||||
{
|
||||
uint32_t token;
|
||||
return submitAlbumDetails(token, album) && waitToken(token) == RsTokenService::COMPLETE;
|
||||
}
|
||||
|
||||
bool p3PhotoService::updateAlbum(const RsPhotoAlbum &album)
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
bool p3PhotoService::getAlbums(const std::list<RsGxsGroupId> &groupIds,
|
||||
std::vector<RsPhotoAlbum> &albums)
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
if (groupIds.empty())
|
||||
{
|
||||
if (!requestGroupInfo(token, opts) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestGroupInfo(token, opts, groupIds) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
}
|
||||
|
||||
return getAlbum(token, albums) && !albums.empty();
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,13 @@ public:
|
||||
return acknowledgeMsg(token, msgId);
|
||||
}
|
||||
|
||||
// Blocking versions.
|
||||
virtual bool createComment(RsGxsComment &msg) override
|
||||
{
|
||||
uint32_t token;
|
||||
return mCommentService->createGxsComment(token, msg) && waitToken(token) == RsTokenService::COMPLETE;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/** Modifications **/
|
||||
@ -165,6 +172,29 @@ public:
|
||||
*/
|
||||
bool acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId);
|
||||
|
||||
// Blocking versions.
|
||||
/*!
|
||||
* request to create a new album. Blocks until process completes.
|
||||
* @param album album to be submitted
|
||||
* @return true if created false otherwise
|
||||
*/
|
||||
virtual bool createAlbum(RsPhotoAlbum &album) override;
|
||||
|
||||
/*!
|
||||
* request to update an existing album. Blocks until process completes.
|
||||
* @param album album to be submitted
|
||||
* @return true if created false otherwise
|
||||
*/
|
||||
virtual bool updateAlbum(const RsPhotoAlbum &album) override;
|
||||
|
||||
/*!
|
||||
* retrieve albums based in groupIds.
|
||||
* @param groupIds the ids to fetch.
|
||||
* @param albums vector to be filled by request.
|
||||
* @return true is successful, false otherwise.
|
||||
*/
|
||||
virtual bool getAlbums(const std::list<RsGxsGroupId> &groupIds,
|
||||
std::vector<RsPhotoAlbum> &albums) override;
|
||||
private:
|
||||
p3GxsCommentService* mCommentService;
|
||||
|
||||
|
@ -323,6 +323,38 @@ bool p3Wiki::updateCollection(uint32_t &token, RsWikiCollection &group)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Blocking Interfaces.
|
||||
bool p3Wiki::createCollection(RsWikiCollection &group)
|
||||
{
|
||||
uint32_t token;
|
||||
return submitCollection(token, group) && waitToken(token) == RsTokenService::COMPLETE;
|
||||
}
|
||||
|
||||
bool p3Wiki::updateCollection(const RsWikiCollection &group)
|
||||
{
|
||||
uint32_t token;
|
||||
RsWikiCollection update(group);
|
||||
return updateCollection(token, update) && waitToken(token) == RsTokenService::COMPLETE;
|
||||
}
|
||||
|
||||
bool p3Wiki::getCollections(const std::list<RsGxsGroupId> groupIds, std::vector<RsWikiCollection> &groups)
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
if (groupIds.empty())
|
||||
{
|
||||
if (!requestGroupInfo(token, opts) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestGroupInfo(token, opts, groupIds) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
}
|
||||
return getCollections(token, groups) && !groups.empty();
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const RsWikiCollection &group)
|
||||
{
|
||||
|
@ -56,17 +56,22 @@ public:
|
||||
virtual void service_tick();
|
||||
|
||||
/* Specific Service Data */
|
||||
virtual bool getCollections(const uint32_t &token, std::vector<RsWikiCollection> &collections);
|
||||
virtual bool getSnapshots(const uint32_t &token, std::vector<RsWikiSnapshot> &snapshots);
|
||||
virtual bool getComments(const uint32_t &token, std::vector<RsWikiComment> &comments);
|
||||
virtual bool getCollections(const uint32_t &token, std::vector<RsWikiCollection> &collections) override;
|
||||
virtual bool getSnapshots(const uint32_t &token, std::vector<RsWikiSnapshot> &snapshots) override;
|
||||
virtual bool getComments(const uint32_t &token, std::vector<RsWikiComment> &comments) override;
|
||||
|
||||
virtual bool getRelatedSnapshots(const uint32_t &token, std::vector<RsWikiSnapshot> &snapshots);
|
||||
virtual bool getRelatedSnapshots(const uint32_t &token, std::vector<RsWikiSnapshot> &snapshots) override;
|
||||
|
||||
virtual bool submitCollection(uint32_t &token, RsWikiCollection &collection);
|
||||
virtual bool submitSnapshot(uint32_t &token, RsWikiSnapshot &snapshot);
|
||||
virtual bool submitComment(uint32_t &token, RsWikiComment &comment);
|
||||
virtual bool submitCollection(uint32_t &token, RsWikiCollection &collection) override;
|
||||
virtual bool submitSnapshot(uint32_t &token, RsWikiSnapshot &snapshot) override;
|
||||
virtual bool submitComment(uint32_t &token, RsWikiComment &comment) override;
|
||||
|
||||
virtual bool updateCollection(uint32_t &token, RsWikiCollection &collection);
|
||||
virtual bool updateCollection(uint32_t &token, RsWikiCollection &collection) override;
|
||||
|
||||
// Blocking Interfaces.
|
||||
virtual bool createCollection(RsWikiCollection &collection) override;
|
||||
virtual bool updateCollection(const RsWikiCollection &collection) override;
|
||||
virtual bool getCollections(const std::list<RsGxsGroupId> groupIds, std::vector<RsWikiCollection> &groups) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -64,11 +64,14 @@ uint32_t p3Wire::wireAuthenPolicy()
|
||||
|
||||
// Edits generally need an authors signature.
|
||||
|
||||
// Wire requires all TopLevel (Orig/Reply) msgs to be signed with both PUBLISH & AUTHOR.
|
||||
// Reply References need to be signed by Author.
|
||||
flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
|
||||
flag |= GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
|
||||
|
||||
flag |= GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
|
||||
flag |= GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
|
||||
// expect the requirements to be the same for RESTRICTED / PRIVATE groups too.
|
||||
// This needs to be worked through / fully evaluated.
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
|
||||
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
|
||||
|
||||
@ -205,6 +208,38 @@ bool p3Wire::createPulse(uint32_t &token, RsWirePulse &pulse)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Blocking Interfaces.
|
||||
bool p3Wire::createGroup(RsWireGroup &group)
|
||||
{
|
||||
uint32_t token;
|
||||
return createGroup(token, group) && waitToken(token) == RsTokenService::COMPLETE;
|
||||
}
|
||||
|
||||
bool p3Wire::updateGroup(const RsWireGroup &group)
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
bool p3Wire::getGroups(const std::list<RsGxsGroupId> groupIds, std::vector<RsWireGroup> &groups)
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
if (groupIds.empty())
|
||||
{
|
||||
if (!requestGroupInfo(token, opts) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestGroupInfo(token, opts, groupIds) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
}
|
||||
return getGroupData(token, groups) && !groups.empty();
|
||||
}
|
||||
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const RsWireGroup &group)
|
||||
{
|
||||
|
@ -50,11 +50,16 @@ public:
|
||||
virtual RsTokenService* getTokenService();
|
||||
|
||||
/* Specific Service Data */
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsWireGroup> &groups);
|
||||
virtual bool getPulseData(const uint32_t &token, std::vector<RsWirePulse> &pulses);
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsWireGroup> &groups) override;
|
||||
virtual bool getPulseData(const uint32_t &token, std::vector<RsWirePulse> &pulses) override;
|
||||
|
||||
virtual bool createGroup(uint32_t &token, RsWireGroup &group);
|
||||
virtual bool createPulse(uint32_t &token, RsWirePulse &pulse);
|
||||
virtual bool createGroup(uint32_t &token, RsWireGroup &group) override;
|
||||
virtual bool createPulse(uint32_t &token, RsWirePulse &pulse) override;
|
||||
|
||||
// Blocking Interfaces.
|
||||
virtual bool createGroup(RsWireGroup &group) override;
|
||||
virtual bool updateGroup(const RsWireGroup &group) override;
|
||||
virtual bool getGroups(const std::list<RsGxsGroupId> grpIds, std::vector<RsWireGroup> &groups) override;
|
||||
|
||||
private:
|
||||
virtual void generateDummyData();
|
||||
|
@ -62,13 +62,13 @@ uint32_t AlbumCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC |
|
||||
uint32_t AlbumEditEnabledFlags = AlbumCreateEnabledFlags;
|
||||
uint32_t AlbumEditDefaultsFlags = AlbumCreateDefaultsFlags;
|
||||
|
||||
AlbumGroupDialog::AlbumGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
|
||||
: GxsGroupDialog(tokenQueue, AlbumCreateEnabledFlags, AlbumCreateDefaultsFlags, parent)
|
||||
AlbumGroupDialog::AlbumGroupDialog(QWidget *parent)
|
||||
: GxsGroupDialog(AlbumCreateEnabledFlags, AlbumCreateDefaultsFlags, parent)
|
||||
{
|
||||
}
|
||||
|
||||
AlbumGroupDialog::AlbumGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent)
|
||||
: GxsGroupDialog(tokenExternalQueue, tokenService, mode, groupId, AlbumEditEnabledFlags, AlbumEditDefaultsFlags, parent)
|
||||
AlbumGroupDialog::AlbumGroupDialog(Mode mode, RsGxsGroupId groupId, QWidget *parent)
|
||||
: GxsGroupDialog(mode, groupId, AlbumEditEnabledFlags, AlbumEditDefaultsFlags, parent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -129,54 +129,44 @@ void AlbumGroupDialog::prepareAlbumGroup(RsPhotoAlbum &group, const RsGroupMetaD
|
||||
group.mWhen = mAlbumExtra->getWhen();
|
||||
}
|
||||
|
||||
bool AlbumGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
|
||||
bool AlbumGroupDialog::service_createGroup(RsGroupMetaData &meta)
|
||||
{
|
||||
// Specific Function.
|
||||
RsPhotoAlbum grp;
|
||||
prepareAlbumGroup(grp, meta);
|
||||
|
||||
rsPhoto->submitAlbumDetails(token, grp);
|
||||
return true;
|
||||
bool success = rsPhoto->createAlbum(grp);
|
||||
// TODO createAlbum should refresh groupId or GroupObj.
|
||||
return success;
|
||||
}
|
||||
|
||||
bool AlbumGroupDialog::service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta)
|
||||
bool AlbumGroupDialog::service_updateGroup(const RsGroupMetaData &editedMeta)
|
||||
{
|
||||
RsPhotoAlbum grp;
|
||||
prepareAlbumGroup(grp, editedMeta);
|
||||
|
||||
std::cerr << "AlbumGroupDialog::service_EditGroup() submitting changes";
|
||||
std::cerr << "AlbumGroupDialog::service_updateGroup() submitting changes";
|
||||
std::cerr << std::endl;
|
||||
|
||||
// TODO: no interface here, yet.
|
||||
// rsPhoto->updateGroup(token, grp);
|
||||
return true;
|
||||
bool success = rsPhoto->updateAlbum(grp);
|
||||
// TODO updateAlbum should refresh groupId or GroupObj.
|
||||
return success;
|
||||
}
|
||||
|
||||
bool AlbumGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGroupMetaData& groupMetaData, QString &description)
|
||||
bool AlbumGroupDialog::service_loadGroup(const RsGxsGenericGroupData *data, Mode /*mode*/, QString &description)
|
||||
{
|
||||
std::cerr << "AlbumGroupDialog::service_loadGroup(" << token << ")";
|
||||
std::cerr << "AlbumGroupDialog::service_loadGroup()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::vector<RsPhotoAlbum> groups;
|
||||
if (!rsPhoto->getAlbum(token, groups))
|
||||
const RsPhotoAlbum *pgroup = dynamic_cast<const RsPhotoAlbum*>(data);
|
||||
|
||||
if(pgroup == nullptr)
|
||||
{
|
||||
std::cerr << "AlbumGroupDialog::service_loadGroup() Error getting GroupData";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "AlbumGroupDialog::service_loadGroup() Error not a RsPhotoAlbum" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "AlbumGroupDialog::service_loadGroup() Error Group.size() != 1";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cerr << "AlbumGroupDialog::service_loadGroup() Unfinished Loading";
|
||||
std::cerr << std::endl;
|
||||
|
||||
const RsPhotoAlbum &group = groups[0];
|
||||
groupMetaData = group.mMeta;
|
||||
const RsPhotoAlbum& group = *pgroup;
|
||||
description = QString::fromUtf8(group.mDescription.c_str());
|
||||
|
||||
if (group.mThumbnail.mData) {
|
||||
@ -197,3 +187,29 @@ bool AlbumGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGroupM
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AlbumGroupDialog::service_getGroupData(const RsGxsGroupId& grpId,RsGxsGenericGroupData *& data)
|
||||
{
|
||||
std::cerr << "AlbumGroupDialog::service_getGroupData(" << grpId << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGxsGroupId> groupIds({grpId});
|
||||
std::vector<RsPhotoAlbum> groups;
|
||||
if (!rsPhoto->getAlbums(groupIds, groups))
|
||||
{
|
||||
std::cerr << "AlbumGroupDialog::service_getGroupData() Error getting GroupData";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "AlbumGroupDialog::service_getGroupData() Error Group.size() != 1";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
data = new RsPhotoAlbum(groups[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -32,15 +32,16 @@ class AlbumGroupDialog : public GxsGroupDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AlbumGroupDialog(TokenQueue *tokenQueue, QWidget *parent);
|
||||
AlbumGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent);
|
||||
AlbumGroupDialog(QWidget *parent);
|
||||
AlbumGroupDialog(Mode mode, RsGxsGroupId groupId, QWidget *parent);
|
||||
|
||||
protected:
|
||||
virtual void initUi();
|
||||
virtual QPixmap serviceImage();
|
||||
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
|
||||
virtual bool service_loadGroup(uint32_t token, Mode mode, RsGroupMetaData& groupMetaData, QString &description);
|
||||
virtual bool service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta);
|
||||
virtual void initUi() override;
|
||||
virtual QPixmap serviceImage() override;
|
||||
virtual bool service_createGroup(RsGroupMetaData &meta) override;
|
||||
virtual bool service_updateGroup(const RsGroupMetaData &editedMeta) override;
|
||||
virtual bool service_loadGroup(const RsGxsGenericGroupData *data, Mode mode, QString &description) override;
|
||||
virtual bool service_getGroupData(const RsGxsGroupId &grpId, RsGxsGenericGroupData *&data) override;
|
||||
|
||||
private:
|
||||
void prepareAlbumGroup(RsPhotoAlbum &group, const RsGroupMetaData &meta);
|
||||
|
@ -233,7 +233,7 @@ void PhotoShare::OpenSlideShow()
|
||||
|
||||
void PhotoShare::createAlbum()
|
||||
{
|
||||
AlbumGroupDialog albumCreate(mPhotoQueue, this);
|
||||
AlbumGroupDialog albumCreate(this);
|
||||
albumCreate.exec();
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ void PhotoShare::OpenViewEditAlbumDialog()
|
||||
if (canEdit) {
|
||||
mode = GxsGroupDialog::MODE_EDIT;
|
||||
}
|
||||
AlbumGroupDialog agDialog(mPhotoQueue, rsPhoto->getTokenService(), mode, album.mMeta.mGroupId, this);
|
||||
AlbumGroupDialog agDialog(mode, album.mMeta.mGroupId, this);
|
||||
agDialog.exec();
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,8 @@ void PulseAddDialog::setReplyTo(RsWirePulse &pulse, std::string &groupName)
|
||||
mReplyGroupName = groupName;
|
||||
|
||||
{
|
||||
PulseDetails *details = new PulseDetails(NULL, pulse, groupName, true);
|
||||
std::map<rstime_t, RsWirePulse *> replies;
|
||||
PulseDetails *details = new PulseDetails(NULL, &pulse, groupName, replies);
|
||||
// add extra widget into layout.
|
||||
QVBoxLayout *vbox = new QVBoxLayout();
|
||||
vbox->addWidget(details);
|
||||
|
@ -31,12 +31,14 @@
|
||||
#include <iostream>
|
||||
|
||||
/** Constructor */
|
||||
PulseDetails::PulseDetails(PulseHolder *actions, RsWirePulse &pulse, std::string &groupName, bool is_original)
|
||||
:QWidget(NULL), mActions(actions), mPulse(pulse), mGroupName(groupName), mIsOriginal(is_original)
|
||||
PulseDetails::PulseDetails(PulseHolder *actions, RsWirePulse *pulse, std::string &groupName,
|
||||
std::map<rstime_t, RsWirePulse *> replies)
|
||||
:QWidget(NULL), mActions(actions), mPulse(*pulse), mGroupName(groupName)
|
||||
{
|
||||
setupUi(this);
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
setup();
|
||||
addReplies(replies);
|
||||
}
|
||||
|
||||
PulseDetails::PulseDetails(PulseHolder *actions,
|
||||
@ -46,7 +48,7 @@ PulseDetails::PulseDetails(PulseHolder *actions,
|
||||
RsGxsId &parentAuthorId,
|
||||
rstime_t &parentPublishTs,
|
||||
std::string &parentPulseText)
|
||||
:QWidget(NULL), mActions(actions), mPulse(), mGroupName(parentGroupName), mIsOriginal(false)
|
||||
:QWidget(NULL), mActions(actions), mPulse(), mGroupName(parentGroupName)
|
||||
{
|
||||
setupUi(this);
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
@ -60,6 +62,15 @@ PulseDetails::PulseDetails(PulseHolder *actions,
|
||||
setup();
|
||||
}
|
||||
|
||||
void PulseDetails::setBackground(QString color)
|
||||
{
|
||||
QWidget *tocolor = this;
|
||||
QPalette p = tocolor->palette();
|
||||
p.setColor(tocolor->backgroundRole(), QColor(color));
|
||||
tocolor->setPalette(p);
|
||||
tocolor->setAutoFillBackground(true);
|
||||
}
|
||||
|
||||
void PulseDetails::setup()
|
||||
{
|
||||
connect(toolButton_expand, SIGNAL(clicked()), this, SLOT(toggle()));
|
||||
@ -77,6 +88,47 @@ void PulseDetails::setup()
|
||||
// label_icon->setText();
|
||||
textBrowser->setPlainText(QString::fromStdString(mPulse.mPulseText));
|
||||
frame_expand->setVisible(false);
|
||||
|
||||
label_replies->setText("");
|
||||
frame_replies->setVisible(false);
|
||||
mHasReplies = false;
|
||||
}
|
||||
|
||||
void PulseDetails::addReplies(std::map<rstime_t, RsWirePulse *> replies)
|
||||
{
|
||||
if (replies.size() == 0)
|
||||
{
|
||||
// do nothing.
|
||||
return;
|
||||
}
|
||||
else if (replies.size() == 1)
|
||||
{
|
||||
label_replies->setText("1 reply");
|
||||
}
|
||||
else if (replies.size() > 1)
|
||||
{
|
||||
label_replies->setText(QString("%1 replies").arg(replies.size()));
|
||||
}
|
||||
|
||||
// add extra widgets into layout.
|
||||
QLayout *vbox = frame_replies->layout();
|
||||
mHasReplies = true;
|
||||
|
||||
std::map<rstime_t, RsWirePulse *> emptyReplies;
|
||||
std::map<rstime_t, RsWirePulse *>::reverse_iterator it;
|
||||
for (it = replies.rbegin(); it != replies.rend(); it++)
|
||||
{
|
||||
// add Ref as child reply.
|
||||
PulseDetails *pd = new PulseDetails(mActions,
|
||||
it->second->mRefGroupId,
|
||||
it->second->mRefGroupName,
|
||||
it->second->mRefOrigMsgId,
|
||||
it->second->mRefAuthorId,
|
||||
it->second->mRefPublishTs,
|
||||
it->second->mRefPulseText);
|
||||
pd->setBackground("goldenrod");
|
||||
vbox->addWidget(pd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -86,10 +138,14 @@ void PulseDetails::toggle()
|
||||
// switch to minimal view.
|
||||
label_summary->setVisible(true);
|
||||
frame_expand->setVisible(false);
|
||||
frame_replies->setVisible(false);
|
||||
} else {
|
||||
// switch to expanded view.
|
||||
label_summary->setVisible(false);
|
||||
frame_expand->setVisible(true);
|
||||
if (mHasReplies) {
|
||||
frame_replies->setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,8 @@ class PulseDetails : public QWidget, private Ui::PulseDetails
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PulseDetails(PulseHolder *actions, RsWirePulse &pulse, std::string &groupName, bool is_original);
|
||||
PulseDetails(PulseHolder *actions, RsWirePulse *pulse, std::string &groupName,
|
||||
std::map<rstime_t, RsWirePulse *> replies);
|
||||
|
||||
// when Reply parent....
|
||||
PulseDetails(PulseHolder *actions,
|
||||
@ -44,6 +45,8 @@ public:
|
||||
|
||||
void setup();
|
||||
|
||||
void setBackground(QString color);
|
||||
|
||||
private slots:
|
||||
void toggle();
|
||||
void follow();
|
||||
@ -51,12 +54,13 @@ private slots:
|
||||
void reply();
|
||||
|
||||
private:
|
||||
void addReplies(std::map<rstime_t, RsWirePulse *> replies);
|
||||
QString getSummary();
|
||||
|
||||
PulseHolder *mActions;
|
||||
RsWirePulse mPulse;
|
||||
std::string mGroupName;
|
||||
bool mIsOriginal;
|
||||
bool mHasReplies;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>750</width>
|
||||
<height>166</height>
|
||||
<width>807</width>
|
||||
<height>231</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
@ -47,9 +47,9 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GxsIdLabel" name="label_idName">
|
||||
<widget class="QLabel" name="label_replies">
|
||||
<property name="text">
|
||||
<string>idLabel</string>
|
||||
<string># replies</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -69,7 +69,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_summary">
|
||||
<property name="text">
|
||||
<string>Summary Text/ date</string>
|
||||
<string>Summary Text</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -92,7 +92,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_date">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
<string>DateTime 02/02/20</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -134,6 +134,13 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="GxsIdLabel" name="label_idName">
|
||||
<property name="text">
|
||||
<string>idLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_icon">
|
||||
<property name="minimumSize">
|
||||
@ -171,6 +178,57 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_replies">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Replies</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
@ -44,40 +44,42 @@ PulseItem::PulseItem(PulseHolder *holder, std::string path)
|
||||
|
||||
}
|
||||
|
||||
PulseItem::PulseItem(PulseHolder *holder, RsWirePulse &pulse, RsWireGroup &group)
|
||||
:QWidget(NULL), mHolder(holder), mType(0)
|
||||
PulseItem::PulseItem(PulseHolder *holder, RsWirePulse *pulse_ptr, RsWireGroup *group_ptr, std::map<rstime_t, RsWirePulse *> replies)
|
||||
:QWidget(NULL), mHolder(holder), mPulse(*pulse_ptr), mType(0)
|
||||
{
|
||||
setupUi(this);
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
QWidget *pulse_widget = widget_parent; // default msg goes into widget_parent.
|
||||
|
||||
/* if it is a reply */
|
||||
if (pulse.mPulseType & WIRE_PULSE_TYPE_REPLY_MSG) {
|
||||
if (mPulse.mPulseType & WIRE_PULSE_TYPE_REPLY_MSG) {
|
||||
|
||||
std::cerr << "Installing Reply Msg";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "GroupID: " << pulse.mRefGroupId;
|
||||
std::cerr << "GroupID: " << mPulse.mRefGroupId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "GroupName: " << pulse.mRefGroupName;
|
||||
std::cerr << "GroupName: " << mPulse.mRefGroupName;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "OrigMsgId: " << pulse.mRefOrigMsgId;
|
||||
std::cerr << "OrigMsgId: " << mPulse.mRefOrigMsgId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "AuthorId: " << pulse.mRefAuthorId;
|
||||
std::cerr << "AuthorId: " << mPulse.mRefAuthorId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "PublishTs: " << pulse.mRefPublishTs;
|
||||
std::cerr << "PublishTs: " << mPulse.mRefPublishTs;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "PulseText: " << pulse.mRefPulseText;
|
||||
std::cerr << "PulseText: " << mPulse.mRefPulseText;
|
||||
std::cerr << std::endl;
|
||||
|
||||
// fill in the parent.
|
||||
PulseDetails *parent = new PulseDetails(
|
||||
mHolder,
|
||||
pulse.mRefGroupId,
|
||||
pulse.mRefGroupName,
|
||||
pulse.mRefOrigMsgId,
|
||||
pulse.mRefAuthorId,
|
||||
pulse.mRefPublishTs,
|
||||
pulse.mRefPulseText);
|
||||
mPulse.mRefGroupId,
|
||||
mPulse.mRefGroupName,
|
||||
mPulse.mRefOrigMsgId,
|
||||
mPulse.mRefAuthorId,
|
||||
mPulse.mRefPublishTs,
|
||||
mPulse.mRefPulseText);
|
||||
|
||||
parent->setBackground("sienna");
|
||||
|
||||
// add extra widget into layout.
|
||||
QVBoxLayout *vbox = new QVBoxLayout();
|
||||
@ -88,45 +90,8 @@ PulseItem::PulseItem(PulseHolder *holder, RsWirePulse &pulse, RsWireGroup &group
|
||||
// if its a reply, the real msg goes into reply slot.
|
||||
pulse_widget = widget_reply;
|
||||
}
|
||||
else if (pulse.mPulseType & WIRE_PULSE_TYPE_REPLY_REFERENCE)
|
||||
else
|
||||
{
|
||||
// THIS IS A FAKE ONE... LEAVE IN UNTIL ITS HANDLED ELSEWHERE.
|
||||
// NB: PARENT PublishTS and AuthorID appear wrong...
|
||||
|
||||
std::cerr << "Installing Ref Msg";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "GroupID: " << pulse.mRefGroupId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "GroupName: " << pulse.mRefGroupName;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "OrigMsgId: " << pulse.mRefOrigMsgId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "AuthorId: " << pulse.mRefAuthorId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "PublishTs: " << pulse.mRefPublishTs;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "PulseText: " << pulse.mRefPulseText;
|
||||
std::cerr << std::endl;
|
||||
|
||||
// fill in the parent.
|
||||
PulseDetails *parent = new PulseDetails(
|
||||
mHolder,
|
||||
pulse.mRefGroupId,
|
||||
pulse.mRefGroupName,
|
||||
pulse.mRefOrigMsgId,
|
||||
pulse.mRefAuthorId,
|
||||
pulse.mRefPublishTs,
|
||||
pulse.mRefPulseText);
|
||||
|
||||
// add extra widget into layout.
|
||||
QVBoxLayout *vbox = new QVBoxLayout();
|
||||
vbox->addWidget(parent);
|
||||
vbox->setContentsMargins(0,0,0,0);
|
||||
widget_reply->setLayout(vbox);
|
||||
|
||||
// if its a REF, the real msg goes into parent slot.
|
||||
pulse_widget = widget_parent;
|
||||
} else {
|
||||
// ORIGINAL PULSE.
|
||||
// hide widget_reply, as it will be empty.
|
||||
widget_reply->setVisible(false);
|
||||
@ -135,7 +100,7 @@ PulseItem::PulseItem(PulseHolder *holder, RsWirePulse &pulse, RsWireGroup &group
|
||||
{
|
||||
std::cerr << "Adding Main Message";
|
||||
std::cerr << std::endl;
|
||||
PulseDetails *details = new PulseDetails(mHolder, pulse, group.mMeta.mGroupName, true);
|
||||
PulseDetails *details = new PulseDetails(mHolder, &mPulse, group_ptr->mMeta.mGroupName, replies);
|
||||
|
||||
// add extra widget into layout.
|
||||
QVBoxLayout *vbox = new QVBoxLayout();
|
||||
@ -144,10 +109,13 @@ PulseItem::PulseItem(PulseHolder *holder, RsWirePulse &pulse, RsWireGroup &group
|
||||
vbox->setContentsMargins(0,0,0,0);
|
||||
pulse_widget->setLayout(vbox);
|
||||
pulse_widget->setVisible(true);
|
||||
// details->toggle();
|
||||
}
|
||||
}
|
||||
|
||||
rstime_t PulseItem::publishTs()
|
||||
{
|
||||
return mPulse.mMeta.mPublishTs;
|
||||
}
|
||||
|
||||
void PulseItem::removeItem()
|
||||
{
|
||||
@ -178,6 +146,8 @@ void PulseItem::mousePressEvent(QMouseEvent *event)
|
||||
setSelected(true);
|
||||
|
||||
QWidget::mousePressEvent(event);
|
||||
|
||||
mHolder->notifyPulseSelection(this);
|
||||
}
|
||||
|
||||
const QPixmap *PulseItem::getPixmap()
|
||||
|
@ -32,7 +32,7 @@ class PulseHolder
|
||||
public:
|
||||
virtual ~PulseHolder() {}
|
||||
virtual void deletePulseItem(PulseItem *, uint32_t ptype) = 0;
|
||||
virtual void notifySelection(PulseItem *item, int ptype) = 0;
|
||||
virtual void notifyPulseSelection(PulseItem *item) = 0;
|
||||
|
||||
// Actions.
|
||||
virtual void follow(RsGxsGroupId &groupId) = 0;
|
||||
@ -47,8 +47,9 @@ class PulseItem : public QWidget, private Ui::PulseItem
|
||||
|
||||
public:
|
||||
PulseItem(PulseHolder *holder, std::string url);
|
||||
PulseItem(PulseHolder *holder, RsWirePulse &pulse, RsWireGroup &group);
|
||||
PulseItem(PulseHolder *holder, RsWirePulse *pulse_ptr, RsWireGroup *group_ptr, std::map<rstime_t, RsWirePulse *> replies);
|
||||
|
||||
rstime_t publishTs();
|
||||
void removeItem();
|
||||
|
||||
void setSelected(bool on);
|
||||
|
@ -25,6 +25,18 @@
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<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>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
@ -52,6 +64,21 @@ border-radius: 10px}</string>
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
@ -81,7 +108,7 @@ border-radius: 10px}</string>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>40</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
@ -93,8 +120,8 @@ border-radius: 10px}</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
@ -113,8 +140,8 @@ border-radius: 10px}</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
@ -127,7 +154,7 @@ border-radius: 10px}</string>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>40</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
@ -37,10 +37,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define GROUP_SET_ALL (0)
|
||||
#define GROUP_SET_OWN (1)
|
||||
#define GROUP_SET_SUBSCRIBED (2)
|
||||
#define GROUP_SET_AUTO (3)
|
||||
#define GROUP_SET_RECOMMENDED (4)
|
||||
#define GROUP_SET_OTHERS (5)
|
||||
|
||||
|
||||
#define WIRE_TOKEN_TYPE_SUBSCRIBE_CHANGE 1
|
||||
|
||||
|
||||
/** Constructor */
|
||||
WireDialog::WireDialog(QWidget *parent)
|
||||
: MainPage(parent)
|
||||
: MainPage(parent), mGroupSet(GROUP_SET_ALL)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
@ -52,6 +62,8 @@ WireDialog::WireDialog(QWidget *parent)
|
||||
connect( ui.pushButton_Post, SIGNAL(clicked()), this, SLOT(createPulse()));
|
||||
connect( ui.toolButton_refresh, SIGNAL(clicked()), this, SLOT(refreshGroups()));
|
||||
|
||||
connect(ui.comboBox_groupSet, SIGNAL(currentIndexChanged(int)), this, SLOT(selectGroupSet(int)));
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
|
||||
timer->start(1000);
|
||||
@ -67,12 +79,6 @@ void WireDialog::refreshGroups()
|
||||
requestGroupData();
|
||||
}
|
||||
|
||||
void WireDialog::addItem(QWidget *item)
|
||||
{
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
alayout->addWidget(item);
|
||||
}
|
||||
|
||||
|
||||
void WireDialog::addGroup(QWidget *item)
|
||||
{
|
||||
@ -81,19 +87,11 @@ void WireDialog::addGroup(QWidget *item)
|
||||
}
|
||||
|
||||
// PulseHolder interface.
|
||||
void WireDialog::deletePulseItem(PulseItem *item, uint32_t type)
|
||||
void WireDialog::deletePulseItem(PulseItem * /* item */, uint32_t /* type */)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void WireDialog::notifySelection(PulseItem *item, int ptype)
|
||||
{
|
||||
std::cerr << "WireDialog::notifySelection() from : " << ptype << " " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
notifyPulseSelection(item);
|
||||
}
|
||||
|
||||
|
||||
// Actions from PulseHolder.
|
||||
void WireDialog::follow(RsGxsGroupId &groupId)
|
||||
@ -148,9 +146,6 @@ void WireDialog::reply(RsWirePulse &pulse, std::string &groupName)
|
||||
|
||||
void WireDialog::notifyPulseSelection(PulseItem *item)
|
||||
{
|
||||
std::cerr << "WireDialog::notifyPulseSelection() from : " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (mPulseSelected)
|
||||
{
|
||||
std::cerr << "WireDialog::notifyPulseSelection() unselecting old one : " << mPulseSelected;
|
||||
@ -158,11 +153,42 @@ void WireDialog::notifyPulseSelection(PulseItem *item)
|
||||
|
||||
mPulseSelected->setSelected(false);
|
||||
}
|
||||
|
||||
mPulseSelected = item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void WireDialog::subscribe(RsGxsGroupId &groupId)
|
||||
{
|
||||
uint32_t token;
|
||||
rsWire->subscribeToGroup(token, groupId, true);
|
||||
mWireQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_ACK, WIRE_TOKEN_TYPE_SUBSCRIBE_CHANGE);
|
||||
}
|
||||
|
||||
void WireDialog::unsubscribe(RsGxsGroupId &groupId)
|
||||
{
|
||||
uint32_t token;
|
||||
rsWire->subscribeToGroup(token, groupId, false);
|
||||
mWireQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_ACK, WIRE_TOKEN_TYPE_SUBSCRIBE_CHANGE);
|
||||
}
|
||||
|
||||
void WireDialog::notifyGroupSelection(WireGroupItem *item)
|
||||
{
|
||||
std::cerr << "WireDialog::notifyGroupSelection() from : " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (mGroupSelected)
|
||||
{
|
||||
std::cerr << "WireDialog::notifyGroupSelection() unselecting old one : " << mGroupSelected;
|
||||
std::cerr << std::endl;
|
||||
|
||||
mGroupSelected->setSelected(false);
|
||||
}
|
||||
|
||||
mGroupSelected = item;
|
||||
}
|
||||
|
||||
|
||||
void WireDialog::checkUpdate()
|
||||
{
|
||||
#if 0
|
||||
@ -180,7 +206,7 @@ void WireDialog::checkUpdate()
|
||||
|
||||
void WireDialog::createGroup()
|
||||
{
|
||||
WireGroupDialog wireCreate(mWireQueue, this);
|
||||
WireGroupDialog wireCreate(this);
|
||||
wireCreate.exec();
|
||||
}
|
||||
|
||||
@ -207,22 +233,55 @@ void WireDialog::createPulse()
|
||||
mAddDialog->show();
|
||||
}
|
||||
|
||||
void WireDialog::addPulse(RsWirePulse &pulse, RsWireGroup &group)
|
||||
void WireDialog::addPulse(RsWirePulse *pulse, RsWireGroup *group,
|
||||
std::map<rstime_t, RsWirePulse *> replies)
|
||||
{
|
||||
std::cerr << "WireDialog::addPulse() GroupId : " << pulse.mMeta.mGroupId;
|
||||
std::cerr << " MsgId : " << pulse.mMeta.mGroupId;
|
||||
std::cerr << "WireDialog::addPulse() GroupId : " << pulse->mMeta.mGroupId;
|
||||
std::cerr << " OrigMsgId : " << pulse->mMeta.mOrigMsgId;
|
||||
std::cerr << " Replies : " << replies.size();
|
||||
std::cerr << std::endl;
|
||||
|
||||
QWidget *item = new PulseItem(this, pulse, group);
|
||||
addItem(item);
|
||||
PulseItem *pulseItem = new PulseItem(this, pulse, group, replies);
|
||||
|
||||
/* ensure its a boxlayout */
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
QBoxLayout *boxlayout = dynamic_cast<QBoxLayout *>(alayout);
|
||||
if (boxlayout == NULL) {
|
||||
std::cerr << "WireDialog::addPulse() ERROR not boxlayout, inserting at end";
|
||||
std::cerr << std::endl;
|
||||
alayout->addWidget(pulseItem);
|
||||
return;
|
||||
}
|
||||
|
||||
/* iterate through layout, and insert at the correct time */
|
||||
for(int i = 0; i < alayout->count(); i++)
|
||||
{
|
||||
QLayoutItem *layoutItem = boxlayout->itemAt(i);
|
||||
PulseItem *pitem = dynamic_cast<PulseItem *>(layoutItem->widget());
|
||||
if (pitem != NULL)
|
||||
{
|
||||
if (pitem->publishTs() < pulseItem->publishTs())
|
||||
{
|
||||
std::cerr << "WireDialog::addPulse() Inserting at index: " << i;
|
||||
std::cerr << std::endl;
|
||||
/* insert at this index */
|
||||
boxlayout->insertWidget(i, pulseItem);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// last item.
|
||||
std::cerr << "WireDialog::addPulse() Inserting at end";
|
||||
std::cerr << std::endl;
|
||||
boxlayout->addWidget(pulseItem);
|
||||
}
|
||||
|
||||
void WireDialog::addGroup(RsWireGroup &group)
|
||||
void WireDialog::addGroup(const RsWireGroup &group)
|
||||
{
|
||||
std::cerr << "WireDialog::addGroup() GroupId : " << group.mMeta.mGroupId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
addGroup(new WireGroupItem(group));
|
||||
addGroup(new WireGroupItem(this, group));
|
||||
}
|
||||
|
||||
void WireDialog::deletePulses()
|
||||
@ -261,11 +320,6 @@ void WireDialog::deleteGroups()
|
||||
std::cerr << "WireDialog::deleteGroups()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
mAllGroups.clear();
|
||||
mOwnGroups.clear();
|
||||
ui.groupChooser->clear();
|
||||
|
||||
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents_groups->layout();
|
||||
QLayoutItem *item;
|
||||
int i = 0;
|
||||
@ -294,6 +348,10 @@ void WireDialog::deleteGroups()
|
||||
|
||||
void WireDialog::updateGroups(std::vector<RsWireGroup>& groups)
|
||||
{
|
||||
mAllGroups.clear();
|
||||
mOwnGroups.clear();
|
||||
ui.groupChooser->clear();
|
||||
|
||||
std::vector<RsWireGroup>::const_iterator it;
|
||||
for(it = groups.begin(); it != groups.end(); it++) {
|
||||
// save list of all groups.
|
||||
@ -310,8 +368,62 @@ void WireDialog::updateGroups(std::vector<RsWireGroup>& groups)
|
||||
}
|
||||
|
||||
|
||||
// LOAD DATA...............................................
|
||||
void WireDialog::selectGroupSet(int index)
|
||||
{
|
||||
std::cerr << "WireDialog::selectGroupSet(" << index << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
mGroupSet = index;
|
||||
if (mGroupSet < 0) {
|
||||
mGroupSet = GROUP_SET_ALL;
|
||||
}
|
||||
showGroups();
|
||||
}
|
||||
|
||||
void WireDialog::showGroups()
|
||||
{
|
||||
deleteGroups();
|
||||
deletePulses();
|
||||
|
||||
/* depends on the comboBox */
|
||||
std::map<RsGxsGroupId, RsWireGroup>::const_iterator it;
|
||||
for (it = mAllGroups.begin(); it != mAllGroups.end(); it++)
|
||||
{
|
||||
bool add = (mGroupSet == GROUP_SET_ALL);
|
||||
if (it->second.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) {
|
||||
if (mGroupSet == GROUP_SET_OWN) {
|
||||
add = true;
|
||||
}
|
||||
}
|
||||
else if (it->second.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) {
|
||||
if (mGroupSet == GROUP_SET_SUBSCRIBED) {
|
||||
add = true;
|
||||
}
|
||||
if (mGroupSet == GROUP_SET_AUTO) {
|
||||
add = true;
|
||||
}
|
||||
if (mGroupSet == GROUP_SET_RECOMMENDED) {
|
||||
add = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (mGroupSet == GROUP_SET_OTHERS) {
|
||||
add = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (add) {
|
||||
addGroup(it->second);
|
||||
// request data.
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
grpIds.push_back(it->second.mMeta.mGroupId);
|
||||
requestPulseData(grpIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// LOAD DATA...............................................
|
||||
|
||||
void WireDialog::requestGroupData()
|
||||
{
|
||||
@ -329,29 +441,12 @@ bool WireDialog::loadGroupData(const uint32_t &token)
|
||||
std::cerr << "WireDialog::loadGroupData()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
deleteGroups();
|
||||
deletePulses();
|
||||
|
||||
std::vector<RsWireGroup> groups;
|
||||
rsWire->getGroupData(token, groups);
|
||||
|
||||
std::vector<RsWireGroup>::iterator vit = groups.begin();
|
||||
|
||||
for(; vit != groups.end(); ++vit)
|
||||
{
|
||||
RsWireGroup& group = *vit;
|
||||
|
||||
std::cerr << " WireDialog::addGroup() GroupId: " << group.mMeta.mGroupId << std::endl;
|
||||
|
||||
addGroup(group);
|
||||
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
grpIds.push_back(group.mMeta.mGroupId);
|
||||
requestPulseData(grpIds);
|
||||
}
|
||||
|
||||
// save list of groups.
|
||||
updateGroups(groups);
|
||||
showGroups();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -367,43 +462,168 @@ void WireDialog::requestPulseData(const std::list<RsGxsGroupId>& grpIds)
|
||||
mWireQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, 0);
|
||||
}
|
||||
|
||||
|
||||
/* LoadPulseData...
|
||||
*
|
||||
* group into threads, using std::map<RsGxsMessageId, PulseReplySet>
|
||||
* then sort by publishTS, using std::map<time, PulseOrderedReply>
|
||||
* then add into gui.
|
||||
* - use pointers to avoid copying everywhere.
|
||||
*
|
||||
* should we mutex Groups, or copy so we don't lose a pointer?
|
||||
* should be fine, as mAllGroups only modified from loadData calls.
|
||||
******
|
||||
*
|
||||
* NB: Potentially, this should be changed to use GXS to do the bulk of the work.
|
||||
* - request Top-Level Msgs, sorted by PublishTS.
|
||||
* - Insert into GUI.
|
||||
* - for each request children Msg, and fill in "replies"
|
||||
*
|
||||
* This needs sorted option on GXS Data fetch.
|
||||
*/
|
||||
|
||||
class PulseReplySet
|
||||
{
|
||||
public:
|
||||
PulseReplySet() : group(NULL), msg(NULL) {}
|
||||
PulseReplySet(RsWirePulse *m, RsWireGroup *g)
|
||||
: group(g), msg(m) {}
|
||||
|
||||
RsWireGroup *group;
|
||||
RsWirePulse *msg;
|
||||
std::map<RsGxsMessageId, RsWirePulse *> replies; // orig ID -> replies.
|
||||
};
|
||||
|
||||
class PulseOrderedReply
|
||||
{
|
||||
public:
|
||||
PulseOrderedReply() : group(NULL), msg(NULL) {}
|
||||
PulseOrderedReply(RsWirePulse *m, RsWireGroup *g)
|
||||
: group(g), msg(m) {}
|
||||
|
||||
RsWireGroup *group;
|
||||
RsWirePulse *msg;
|
||||
std::map<rstime_t, RsWirePulse *> replies; // publish -> replies.
|
||||
};
|
||||
|
||||
bool WireDialog::loadPulseData(const uint32_t &token)
|
||||
{
|
||||
std::cerr << "WireDialog::loadPulseData()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
// clearPulses();
|
||||
|
||||
std::vector<RsWirePulse> pulses;
|
||||
rsWire->getPulseData(token, pulses);
|
||||
|
||||
std::list<RsWirePulse *> references;
|
||||
std::map<RsGxsMessageId, PulseReplySet> pulseGrouping;
|
||||
|
||||
std::vector<RsWirePulse>::iterator vit = pulses.begin();
|
||||
for(; vit != pulses.end(); vit++)
|
||||
{
|
||||
RsWirePulse& pulse = *vit;
|
||||
|
||||
RsGxsGroupId &gid = pulse.mMeta.mGroupId;
|
||||
std::map<RsGxsGroupId, RsWireGroup>::iterator mit = mAllGroups.find(gid);
|
||||
if (mit != mAllGroups.end())
|
||||
if (pulse.mPulseType & WIRE_PULSE_TYPE_REPLY_REFERENCE)
|
||||
{
|
||||
RsWireGroup &group = mit->second;
|
||||
addPulse(pulse, group);
|
||||
std::cerr << "WireDialog::loadPulseData() GroupId: " << pulse.mMeta.mGroupId;
|
||||
// store references to add in later.
|
||||
std::cerr << "WireDialog::loadPulseData() REF: GroupId: " << pulse.mMeta.mGroupId;
|
||||
std::cerr << " PulseId: " << pulse.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
references.push_back(&pulse);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "WireDialog::loadPulseData() ERROR Missing GroupId: " << pulse.mMeta.mGroupId;
|
||||
std::cerr << " PulseId: " << pulse.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
RsGxsGroupId &gid = pulse.mMeta.mGroupId;
|
||||
std::map<RsGxsGroupId, RsWireGroup>::iterator git = mAllGroups.find(gid);
|
||||
if (git != mAllGroups.end())
|
||||
{
|
||||
RsWireGroup &group = git->second;
|
||||
std::cerr << "WireDialog::loadPulseData() MSG: GroupId: " << pulse.mMeta.mGroupId;
|
||||
std::cerr << " PulseId: " << pulse.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
// install into pulseGrouping.
|
||||
pulseGrouping[pulse.mMeta.mOrigMsgId] = PulseReplySet(&pulse, &group);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "WireDialog::loadPulseData() ERROR Missing GroupId: " << pulse.mMeta.mGroupId;
|
||||
std::cerr << " PulseId: " << pulse.mMeta.mMsgId;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// updatePulses();
|
||||
// add references.
|
||||
std::list<RsWirePulse *>::iterator lrit;
|
||||
for(lrit = references.begin(); lrit != references.end(); lrit++)
|
||||
{
|
||||
std::map<RsGxsMessageId, PulseReplySet>::iterator pgit;
|
||||
pgit = pulseGrouping.find((*lrit)->mMeta.mThreadId);
|
||||
if (pgit != pulseGrouping.end())
|
||||
{
|
||||
// install into reply map.
|
||||
// TODO handle Edits / Latest MSGS.
|
||||
std::map<RsGxsMessageId, RsWirePulse *>::iterator rmit;
|
||||
rmit = pgit->second.replies.find((*lrit)->mMeta.mOrigMsgId);
|
||||
if (rmit == pgit->second.replies.end())
|
||||
{
|
||||
std::cerr << "WireDialog::loadPulseData() Installing REF: " << (*lrit)->mMeta.mOrigMsgId;
|
||||
std::cerr << " to threadId: " << (*lrit)->mMeta.mThreadId;
|
||||
std::cerr << std::endl;
|
||||
pgit->second.replies[(*lrit)->mMeta.mOrigMsgId] = (*lrit);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "WireDialog::loadPulseData() ERROR Duplicate reply REF: " << (*lrit)->mMeta.mOrigMsgId;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// no original msg for REF.
|
||||
std::cerr << "WireDialog::loadPulseData() ERROR No matching ThreadId REF: " << (*lrit)->mMeta.mThreadId;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
references.clear();
|
||||
|
||||
// sort by publish time.
|
||||
std::map<rstime_t, PulseOrderedReply> pulseOrdering;
|
||||
std::map<RsGxsMessageId, PulseReplySet>::iterator pgit;
|
||||
for(pgit = pulseGrouping.begin(); pgit != pulseGrouping.end(); pgit++)
|
||||
{
|
||||
PulseOrderedReply &msg = pulseOrdering[pgit->second.msg->mMeta.mPublishTs] =
|
||||
PulseOrderedReply(pgit->second.msg, pgit->second.group);
|
||||
std::map<RsGxsMessageId, RsWirePulse *>::iterator rmit;
|
||||
for(rmit = pgit->second.replies.begin();
|
||||
rmit != pgit->second.replies.end(); rmit++)
|
||||
{
|
||||
msg.replies[rmit->second->mMeta.mPublishTs] = rmit->second;
|
||||
}
|
||||
}
|
||||
|
||||
// now add to the GUI.
|
||||
std::map<rstime_t, PulseOrderedReply>::reverse_iterator poit;
|
||||
for (poit = pulseOrdering.rbegin(); poit != pulseOrdering.rend(); poit++)
|
||||
{
|
||||
// add into GUI should insert at correct time point, amongst all other ones.
|
||||
addPulse(poit->second.msg, poit->second.group, poit->second.replies);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void WireDialog::acknowledgeGroup(const uint32_t &token, const uint32_t &userType)
|
||||
{
|
||||
/* reload groups */
|
||||
std::cerr << "WireDialog::acknowledgeGroup(usertype: " << userType << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsGxsGroupId grpId;
|
||||
rsWire->acknowledgeGrp(token, grpId);
|
||||
|
||||
refreshGroups();
|
||||
}
|
||||
|
||||
|
||||
/**************************** Request / Response Filling of Data ************************/
|
||||
|
||||
@ -426,9 +646,9 @@ void WireDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
case RS_TOKREQ_ANSTYPE_DATA:
|
||||
loadGroupData(req.mToken);
|
||||
break;
|
||||
// case RS_TOKREQ_ANSTYPE_ACK:
|
||||
// acknowledgeGroup(req.mToken);
|
||||
// break;
|
||||
case RS_TOKREQ_ANSTYPE_ACK:
|
||||
acknowledgeGroup(req.mToken, req.mUserType);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "WireDialog::loadRequest() ERROR: GROUP: INVALID ANS TYPE";
|
||||
std::cerr << std::endl;
|
||||
|
@ -29,13 +29,14 @@
|
||||
#include <map>
|
||||
|
||||
#include "gui/TheWire/PulseItem.h"
|
||||
#include "gui/TheWire/WireGroupItem.h"
|
||||
#include "gui/TheWire/PulseAddDialog.h"
|
||||
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
#define IMAGE_WIRE ":/icons/wire.png"
|
||||
|
||||
class WireDialog : public MainPage, public TokenResponse, public PulseHolder
|
||||
class WireDialog : public MainPage, public TokenResponse, public PulseHolder, public WireGroupHolder
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -48,13 +49,17 @@ public:
|
||||
|
||||
// PulseHolder interface.
|
||||
virtual void deletePulseItem(PulseItem *, uint32_t type);
|
||||
virtual void notifySelection(PulseItem *item, int ptype);
|
||||
virtual void notifyPulseSelection(PulseItem *item);
|
||||
|
||||
virtual void follow(RsGxsGroupId &groupId);
|
||||
virtual void rate(RsGxsId &authorId);
|
||||
virtual void reply(RsWirePulse &pulse, std::string &groupName);
|
||||
|
||||
void notifyPulseSelection(PulseItem *item);
|
||||
|
||||
// WireGroupHolder interface.
|
||||
virtual void subscribe(RsGxsGroupId &groupId);
|
||||
virtual void unsubscribe(RsGxsGroupId &groupId);
|
||||
virtual void notifyGroupSelection(WireGroupItem *item);
|
||||
|
||||
private slots:
|
||||
|
||||
@ -62,31 +67,38 @@ private slots:
|
||||
void createPulse();
|
||||
void checkUpdate();
|
||||
void refreshGroups();
|
||||
void selectGroupSet(int index);
|
||||
|
||||
private:
|
||||
|
||||
void addItem(QWidget *item);
|
||||
void addGroup(QWidget *item);
|
||||
|
||||
void addPulse(RsWirePulse &pulse, RsWireGroup &group);
|
||||
void addGroup(RsWireGroup &group);
|
||||
void addPulse(RsWirePulse *pulse, RsWireGroup *group,
|
||||
std::map<rstime_t, RsWirePulse *> replies);
|
||||
|
||||
void addGroup(const RsWireGroup &group);
|
||||
|
||||
void deletePulses();
|
||||
void deleteGroups();
|
||||
void showGroups();
|
||||
void updateGroups(std::vector<RsWireGroup> &groups);
|
||||
|
||||
// Loading Data.
|
||||
void requestGroupData();
|
||||
bool loadGroupData(const uint32_t &token);
|
||||
void acknowledgeGroup(const uint32_t &token, const uint32_t &userType);
|
||||
|
||||
void requestPulseData(const std::list<RsGxsGroupId>& grpIds);
|
||||
bool loadPulseData(const uint32_t &token);
|
||||
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
int mGroupSet;
|
||||
|
||||
PulseAddDialog *mAddDialog;
|
||||
|
||||
PulseItem *mPulseSelected;
|
||||
WireGroupItem *mGroupSelected;
|
||||
|
||||
TokenQueue *mWireQueue;
|
||||
|
||||
|
@ -116,7 +116,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>567</width>
|
||||
<width>434</width>
|
||||
<height>412</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -234,7 +234,7 @@
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<width>400</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -270,7 +270,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>129</width>
|
||||
<width>262</width>
|
||||
<height>416</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -296,7 +296,12 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="comboBox_3">
|
||||
<widget class="QComboBox" name="comboBox_groupSet">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>All</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Yourself</string>
|
||||
|
@ -56,13 +56,13 @@ uint32_t WireCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC |
|
||||
uint32_t WireEditEnabledFlags = WireCreateEnabledFlags;
|
||||
uint32_t WireEditDefaultsFlags = WireCreateDefaultsFlags;
|
||||
|
||||
WireGroupDialog::WireGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
|
||||
: GxsGroupDialog(tokenQueue, WireCreateEnabledFlags, WireCreateDefaultsFlags, parent)
|
||||
WireGroupDialog::WireGroupDialog(QWidget *parent)
|
||||
: GxsGroupDialog(WireCreateEnabledFlags, WireCreateDefaultsFlags, parent)
|
||||
{
|
||||
}
|
||||
|
||||
WireGroupDialog::WireGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent)
|
||||
: GxsGroupDialog(tokenExternalQueue, tokenService, mode, groupId, WireEditEnabledFlags, WireEditDefaultsFlags, parent)
|
||||
WireGroupDialog::WireGroupDialog(Mode mode, RsGxsGroupId groupId, QWidget *parent)
|
||||
: GxsGroupDialog(mode, groupId, WireEditEnabledFlags, WireEditDefaultsFlags, parent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -115,54 +115,43 @@ void WireGroupDialog::prepareWireGroup(RsWireGroup &group, const RsGroupMetaData
|
||||
|
||||
}
|
||||
|
||||
bool WireGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
|
||||
bool WireGroupDialog::service_createGroup(RsGroupMetaData &meta)
|
||||
{
|
||||
// Specific Function.
|
||||
RsWireGroup grp;
|
||||
prepareWireGroup(grp, meta);
|
||||
|
||||
rsWire->createGroup(token, grp);
|
||||
return true;
|
||||
bool success = rsWire->createGroup(grp);
|
||||
// TODO createGroup should refresh groupId or Data
|
||||
return success;
|
||||
}
|
||||
|
||||
bool WireGroupDialog::service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta)
|
||||
bool WireGroupDialog::service_updateGroup(const RsGroupMetaData &editedMeta)
|
||||
{
|
||||
RsWireGroup grp;
|
||||
prepareWireGroup(grp, editedMeta);
|
||||
|
||||
std::cerr << "WireGroupDialog::service_EditGroup() submitting changes";
|
||||
std::cerr << "WireGroupDialog::service_updateGroup() submitting changes";
|
||||
std::cerr << std::endl;
|
||||
|
||||
// TODO: no interface here, yet.
|
||||
// rsWire->updateGroup(token, grp);
|
||||
return true;
|
||||
bool success = rsWire->updateGroup(grp);
|
||||
// TODO updateGroup should refresh groupId or Data
|
||||
return success;
|
||||
}
|
||||
|
||||
bool WireGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGroupMetaData& groupMetaData, QString &description)
|
||||
bool WireGroupDialog::service_loadGroup(const RsGxsGenericGroupData *data, Mode mode, QString &description)
|
||||
{
|
||||
std::cerr << "WireGroupDialog::service_loadGroup(" << token << ")";
|
||||
std::cerr << "WireGroupDialog::service_loadGroup()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::vector<RsWireGroup> groups;
|
||||
if (!rsWire->getGroupData(token, groups))
|
||||
const RsWireGroup *pgroup = dynamic_cast<const RsWireGroup*>(data);
|
||||
if (pgroup == nullptr)
|
||||
{
|
||||
std::cerr << "WireGroupDialog::service_loadGroup() Error getting GroupData";
|
||||
std::cerr << "WireGroupDialog::service_loadGroup() Error not a RsWireGroup";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "WireGroupDialog::service_loadGroup() Error Group.size() != 1";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cerr << "WireGroupDialog::service_loadGroup() Unfinished Loading";
|
||||
std::cerr << std::endl;
|
||||
|
||||
const RsWireGroup &group = groups[0];
|
||||
groupMetaData = group.mMeta;
|
||||
const RsWireGroup &group = *pgroup;
|
||||
description = QString::fromUtf8(group.mDescription.c_str());
|
||||
|
||||
#if 0
|
||||
@ -178,3 +167,28 @@ bool WireGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGroupMe
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WireGroupDialog::service_getGroupData(const RsGxsGroupId &grpId, RsGxsGenericGroupData *&data)
|
||||
{
|
||||
std::cerr << "WireGroupDialog::service_getGroupData(" << grpId << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGxsGroupId> groupIds({grpId});
|
||||
std::vector<RsWireGroup> groups;
|
||||
if (!rsWire->getGroups(groupIds, groups))
|
||||
{
|
||||
std::cerr << "WireGroupDialog::service_loadGroup() Error getting GroupData";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (groups.size() != 1)
|
||||
{
|
||||
std::cerr << "WireGroupDialog::service_loadGroup() Error Group.size() != 1";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
data = new RsWireGroup(groups[0]);
|
||||
return true;
|
||||
}
|
||||
|
@ -29,15 +29,16 @@ class WireGroupDialog : public GxsGroupDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WireGroupDialog(TokenQueue *tokenQueue, QWidget *parent);
|
||||
WireGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent);
|
||||
WireGroupDialog(QWidget *parent);
|
||||
WireGroupDialog(Mode mode, RsGxsGroupId groupId, QWidget *parent);
|
||||
|
||||
protected:
|
||||
virtual void initUi();
|
||||
virtual QPixmap serviceImage();
|
||||
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
|
||||
virtual bool service_loadGroup(uint32_t token, Mode mode, RsGroupMetaData& groupMetaData, QString &description);
|
||||
virtual bool service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta);
|
||||
virtual void initUi() override;
|
||||
virtual QPixmap serviceImage() override;
|
||||
virtual bool service_createGroup(RsGroupMetaData &meta) override;
|
||||
virtual bool service_updateGroup(const RsGroupMetaData &editedMeta) override;
|
||||
virtual bool service_loadGroup(const RsGxsGenericGroupData *data, Mode mode, QString &description) override;
|
||||
virtual bool service_getGroupData(const RsGxsGroupId &grpId, RsGxsGenericGroupData *&data) override;
|
||||
|
||||
private:
|
||||
void prepareWireGroup(RsWireGroup &group, const RsGroupMetaData &meta);
|
||||
|
@ -30,8 +30,8 @@
|
||||
|
||||
/** Constructor */
|
||||
|
||||
WireGroupItem::WireGroupItem(RsWireGroup grp)
|
||||
:QWidget(NULL), mGroup(grp), mType(0)
|
||||
WireGroupItem::WireGroupItem(WireGroupHolder *holder, const RsWireGroup &grp)
|
||||
:QWidget(NULL), mHolder(holder), mGroup(grp)
|
||||
{
|
||||
setupUi(this);
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
@ -42,10 +42,31 @@ WireGroupItem::WireGroupItem(RsWireGroup grp)
|
||||
void WireGroupItem::setup()
|
||||
{
|
||||
label_groupName->setText(QString::fromStdString(mGroup.mMeta.mGroupName));
|
||||
// label_authorId->setText(mGroup.mMeta.mAuthorId);
|
||||
label_authorId->setId(mGroup.mMeta.mAuthorId);
|
||||
frame_details->setVisible(false);
|
||||
|
||||
connect(toolButton_show, SIGNAL(clicked()), this, SLOT(show()));
|
||||
connect(toolButton_subscribe, SIGNAL(clicked()), this, SLOT(subscribe()));
|
||||
setGroupSet();
|
||||
}
|
||||
|
||||
void WireGroupItem::setGroupSet()
|
||||
{
|
||||
if (mGroup.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) {
|
||||
toolButton_type->setText("Own");
|
||||
toolButton_subscribe->setText("N/A");
|
||||
toolButton_subscribe->setEnabled(false);
|
||||
}
|
||||
else if (mGroup.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
|
||||
{
|
||||
toolButton_type->setText("Subcribed");
|
||||
toolButton_subscribe->setText("Unsubcribe");
|
||||
}
|
||||
else
|
||||
{
|
||||
toolButton_type->setText("Other");
|
||||
toolButton_subscribe->setText("Subcribe");
|
||||
}
|
||||
}
|
||||
|
||||
void WireGroupItem::show()
|
||||
@ -53,12 +74,24 @@ void WireGroupItem::show()
|
||||
frame_details->setVisible(!frame_details->isVisible());
|
||||
}
|
||||
|
||||
void WireGroupItem::subscribe()
|
||||
{
|
||||
if (mGroup.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
|
||||
{
|
||||
mHolder->unsubscribe(mGroup.mMeta.mGroupId);
|
||||
}
|
||||
else
|
||||
{
|
||||
mHolder->subscribe(mGroup.mMeta.mGroupId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WireGroupItem::removeItem()
|
||||
{
|
||||
}
|
||||
|
||||
void WireGroupItem::setSelected(bool on)
|
||||
void WireGroupItem::setSelected(bool /* on */)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -27,12 +27,22 @@
|
||||
|
||||
class WireGroupItem;
|
||||
|
||||
class WireGroupHolder
|
||||
{
|
||||
public:
|
||||
virtual ~WireGroupHolder() {}
|
||||
virtual void subscribe(RsGxsGroupId &groupId) = 0;
|
||||
virtual void unsubscribe(RsGxsGroupId &groupId) = 0;
|
||||
|
||||
virtual void notifyGroupSelection(WireGroupItem *item) = 0;
|
||||
};
|
||||
|
||||
class WireGroupItem : public QWidget, private Ui::WireGroupItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WireGroupItem(RsWireGroup grp);
|
||||
WireGroupItem(WireGroupHolder *holder, const RsWireGroup &grp);
|
||||
|
||||
void removeItem();
|
||||
|
||||
@ -43,15 +53,17 @@ public:
|
||||
|
||||
private slots:
|
||||
void show();
|
||||
void subscribe();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
|
||||
private:
|
||||
void setup();
|
||||
void setGroupSet();
|
||||
|
||||
WireGroupHolder *mHolder;
|
||||
RsWireGroup mGroup;
|
||||
uint32_t mType;
|
||||
bool mSelected;
|
||||
};
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<widget class="QToolButton" name="toolButton_type">
|
||||
<property name="text">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
@ -71,7 +71,7 @@
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_authorId">
|
||||
<widget class="GxsIdLabel" name="label_authorId">
|
||||
<property name="text">
|
||||
<string> GxsIdLabel</string>
|
||||
</property>
|
||||
@ -91,7 +91,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<widget class="QToolButton" name="toolButton_subscribe">
|
||||
<property name="text">
|
||||
<string>Sub/Un</string>
|
||||
</property>
|
||||
@ -105,6 +105,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>GxsIdLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>gui/gxs/GxsIdLabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -181,7 +181,7 @@ void WikiDialog::OpenOrShowAddGroupDialog()
|
||||
|
||||
void WikiDialog::newGroup()
|
||||
{
|
||||
WikiGroupDialog cf(mWikiQueue, this);
|
||||
WikiGroupDialog cf(this);
|
||||
cf.exec ();
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ void WikiDialog::showGroupDetails()
|
||||
return;
|
||||
}
|
||||
|
||||
WikiGroupDialog cf(mWikiQueue, rsWiki->getTokenService(), GxsGroupDialog::MODE_SHOW, groupId, this);
|
||||
WikiGroupDialog cf(GxsGroupDialog::MODE_SHOW, groupId, this);
|
||||
cf.exec ();
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ void WikiDialog::editGroupDetails()
|
||||
return;
|
||||
}
|
||||
|
||||
WikiGroupDialog cf(mWikiQueue, rsWiki->getTokenService(), GxsGroupDialog::MODE_EDIT, groupId, this);
|
||||
WikiGroupDialog cf(GxsGroupDialog::MODE_EDIT, groupId, this);
|
||||
cf.exec ();
|
||||
}
|
||||
|
||||
|
@ -54,13 +54,13 @@ uint32_t WikiCreateDefaultsFlags = ( GXS_GROUP_DEFAULTS_DISTRIB_PUBLIC |
|
||||
uint32_t WikiEditDefaultsFlags = WikiCreateDefaultsFlags;
|
||||
uint32_t WikiEditEnabledFlags = WikiCreateEnabledFlags;
|
||||
|
||||
WikiGroupDialog::WikiGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
|
||||
:GxsGroupDialog(tokenQueue, WikiCreateEnabledFlags, WikiCreateDefaultsFlags, parent)
|
||||
WikiGroupDialog::WikiGroupDialog(QWidget *parent)
|
||||
:GxsGroupDialog(WikiCreateEnabledFlags, WikiCreateDefaultsFlags, parent)
|
||||
{
|
||||
}
|
||||
|
||||
WikiGroupDialog::WikiGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent)
|
||||
:GxsGroupDialog(tokenExternalQueue, tokenService, mode, groupId, WikiEditEnabledFlags, WikiEditDefaultsFlags, parent)
|
||||
WikiGroupDialog::WikiGroupDialog(Mode mode, RsGxsGroupId groupId, QWidget *parent)
|
||||
:GxsGroupDialog(mode, groupId, WikiEditEnabledFlags, WikiEditDefaultsFlags, parent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -90,40 +90,62 @@ QPixmap WikiGroupDialog::serviceImage()
|
||||
return QPixmap(":/icons/png/wiki.png");
|
||||
}
|
||||
|
||||
bool WikiGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
|
||||
|
||||
bool WikiGroupDialog::service_createGroup(RsGroupMetaData &meta)
|
||||
{
|
||||
// Specific Function.
|
||||
RsWikiCollection grp;
|
||||
grp.mMeta = meta;
|
||||
grp.mDescription = getDescription().toStdString();
|
||||
std::cerr << "WikiGroupDialog::service_CreateGroup() storing to Queue";
|
||||
|
||||
std::cerr << "WikiGroupDialog::service_CreateGroup()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
rsWiki->submitCollection(token, grp);
|
||||
|
||||
return true;
|
||||
bool success = rsWiki->createCollection(grp);
|
||||
// createCollection should refresh groupId or data
|
||||
return success;
|
||||
}
|
||||
|
||||
bool WikiGroupDialog::service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta)
|
||||
bool WikiGroupDialog::service_updateGroup(const RsGroupMetaData &editedMeta)
|
||||
{
|
||||
RsWikiCollection grp;
|
||||
grp.mMeta = editedMeta;
|
||||
grp.mDescription = getDescription().toStdString();
|
||||
|
||||
std::cerr << "WikiGroupDialog::service_EditGroup() submitting changes.";
|
||||
std::cerr << "WikiGroupDialog::service_updateGroup() submitting changes.";
|
||||
std::cerr << std::endl;
|
||||
|
||||
rsWiki->updateCollection(token, grp);
|
||||
bool success = rsWiki->updateCollection(grp);
|
||||
// updateCollection should refresh groupId or data
|
||||
return success;
|
||||
}
|
||||
|
||||
bool WikiGroupDialog::service_loadGroup(const RsGxsGenericGroupData *data, Mode mode, QString &description)
|
||||
{
|
||||
std::cerr << "WikiGroupDialog::service_loadGroup()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
const RsWikiCollection *pgroup = dynamic_cast<const RsWikiCollection *>(data);
|
||||
if (pgroup == nullptr)
|
||||
{
|
||||
std::cerr << "WikiGroupDialog::service_loadGroup() Error not a RsWikiCollection";
|
||||
std::cerr << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
const RsWikiCollection &group = *pgroup;
|
||||
description = QString::fromUtf8(group.mDescription.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WikiGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGroupMetaData& groupMetaData, QString &description)
|
||||
bool WikiGroupDialog::service_getGroupData(const RsGxsGroupId &groupId, RsGxsGenericGroupData *&data)
|
||||
{
|
||||
std::cerr << "WikiGroupDialog::service_loadGroup(" << token << ")";
|
||||
std::cerr << "WikiGroupDialog::service_getGroupData(" << groupId << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGxsGroupId> groupIds({groupId});
|
||||
std::vector<RsWikiCollection> groups;
|
||||
if (!rsWiki->getCollections(token, groups))
|
||||
if (!rsWiki->getCollections(groupIds, groups))
|
||||
{
|
||||
std::cerr << "WikiGroupDialog::service_loadGroup() Error getting GroupData";
|
||||
std::cerr << std::endl;
|
||||
@ -137,11 +159,7 @@ bool WikiGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGroupMe
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cerr << "WikisGroupDialog::service_loadGroup() Unfinished Loading";
|
||||
std::cerr << std::endl;
|
||||
|
||||
groupMetaData = groups[0].mMeta;
|
||||
description = QString::fromUtf8(groups[0].mDescription.c_str());
|
||||
|
||||
data = new RsWikiCollection(groups[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -29,15 +29,16 @@ class WikiGroupDialog : public GxsGroupDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WikiGroupDialog(TokenQueue *tokenQueue, QWidget *parent);
|
||||
WikiGroupDialog(TokenQueue *tokenExternalQueue, RsTokenService *tokenService, Mode mode, RsGxsGroupId groupId, QWidget *parent = NULL);
|
||||
WikiGroupDialog(QWidget *parent);
|
||||
WikiGroupDialog(Mode mode, RsGxsGroupId groupId, QWidget *parent = NULL);
|
||||
|
||||
protected:
|
||||
virtual void initUi();
|
||||
virtual QPixmap serviceImage();
|
||||
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
|
||||
virtual bool service_loadGroup(uint32_t token, Mode mode, RsGroupMetaData& groupMetaData, QString &description);
|
||||
virtual bool service_EditGroup(uint32_t &token, RsGroupMetaData& groupMetaData);
|
||||
virtual void initUi() override;
|
||||
virtual QPixmap serviceImage() override;
|
||||
virtual bool service_createGroup(RsGroupMetaData &meta) override;
|
||||
virtual bool service_updateGroup(const RsGroupMetaData &editedMeta) override;
|
||||
virtual bool service_loadGroup(const RsGxsGenericGroupData *data, Mode mode, QString &description) override;
|
||||
virtual bool service_getGroupData(const RsGxsGroupId &groupId, RsGxsGenericGroupData *&data) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -38,10 +38,10 @@ signals:
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
|
||||
void enterEvent(QEvent *ev) override { setStyleSheet("QLabel { border: 2px solid #039bd5; }");}
|
||||
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; }");}
|
||||
void leaveEvent(QEvent * /* ev */ ) override { setStyleSheet("QLabel { border: 2px solid #CCCCCC; border-radius: 3px; }");}
|
||||
|
||||
};
|
||||
|
||||
#endif // CLICKABLELABEL_H
|
||||
#endif // CLICKABLELABEL_H
|
||||
|
Loading…
Reference in New Issue
Block a user