mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 15:39:27 -05:00
Merge pull request #419 from PhenomRetroShare/Fix_ChannelNewsFeedWhenComment
Fix GxsChannelPostItem when received comment.
This commit is contained in:
commit
35da9cb193
@ -83,9 +83,10 @@ virtual ~RsGxsChannels() { return; }
|
|||||||
|
|
||||||
/* Specific Service Data */
|
/* Specific Service Data */
|
||||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups) = 0;
|
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups) = 0;
|
||||||
|
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts) = 0;
|
||||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts) = 0;
|
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts) = 0;
|
||||||
|
//Not currently used
|
||||||
virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &posts) = 0;
|
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &posts) = 0;
|
||||||
|
|
||||||
/* From RsGxsCommentService */
|
/* From RsGxsCommentService */
|
||||||
//virtual bool getCommentData(const uint32_t &token, std::vector<RsGxsComment> &comments) = 0;
|
//virtual bool getCommentData(const uint32_t &token, std::vector<RsGxsComment> &comments) = 0;
|
||||||
|
@ -108,6 +108,19 @@ class RsGxsComment
|
|||||||
|
|
||||||
// This is filled in if detailed Comment Data is called.
|
// This is filled in if detailed Comment Data is called.
|
||||||
std::list<RsGxsVote> mVotes;
|
std::list<RsGxsVote> mVotes;
|
||||||
|
|
||||||
|
const std::ostream &print(std::ostream &out, std::string indent = "", std::string varName = "") const {
|
||||||
|
out << indent << varName << " of RsGxsComment Values ###################" << std::endl;
|
||||||
|
mMeta.print(out, indent + " ", "mMeta");
|
||||||
|
out << indent << " mComment: " << mComment << std::endl;
|
||||||
|
out << indent << " mUpVotes: " << mUpVotes << std::endl;
|
||||||
|
out << indent << " mDownVotes: " << mDownVotes << std::endl;
|
||||||
|
out << indent << " mScore: " << mScore << std::endl;
|
||||||
|
out << indent << " mOwnVote: " << mOwnVote << std::endl;
|
||||||
|
out << indent << " mVotes.size(): " << mVotes.size() << std::endl;
|
||||||
|
out << indent << "######################################################" << std::endl;
|
||||||
|
return out;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ virtual ~RsGxsForums() { return; }
|
|||||||
/* Specific Service Data */
|
/* Specific Service Data */
|
||||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsForumGroup> &groups) = 0;
|
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsForumGroup> &groups) = 0;
|
||||||
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs) = 0;
|
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs) = 0;
|
||||||
virtual bool getRelatedMessages(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs) = 0;
|
//Not currently used
|
||||||
|
//virtual bool getRelatedMessages(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs) = 0;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0;
|
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0;
|
||||||
|
@ -131,6 +131,24 @@ public:
|
|||||||
time_t mChildTs;
|
time_t mChildTs;
|
||||||
std::string mServiceString; // Service Specific Free-Form extra storage.
|
std::string mServiceString; // Service Specific Free-Form extra storage.
|
||||||
|
|
||||||
|
const std::ostream &print(std::ostream &out, std::string indent = "", std::string varName = "") const {
|
||||||
|
out
|
||||||
|
<< indent << varName << " of RsMsgMetaData Values ###################" << std::endl
|
||||||
|
<< indent << " mGroupId: " << mGroupId.toStdString() << std::endl
|
||||||
|
<< indent << " mMsgId: " << mMsgId.toStdString() << std::endl
|
||||||
|
<< indent << " mThreadId: " << mThreadId.toStdString() << std::endl
|
||||||
|
<< indent << " mParentId: " << mParentId.toStdString() << std::endl
|
||||||
|
<< indent << " mOrigMsgId: " << mOrigMsgId.toStdString() << std::endl
|
||||||
|
<< indent << " mAuthorId: " << mAuthorId.toStdString() << std::endl
|
||||||
|
<< indent << " mMsgName: " << mMsgName << std::endl
|
||||||
|
<< indent << " mPublishTs: " << mPublishTs << std::endl
|
||||||
|
<< indent << " mMsgFlags: " << std::hex << mMsgFlags << std::dec << std::endl
|
||||||
|
<< indent << " mMsgStatus: " << std::hex << mMsgStatus << std::dec << std::endl
|
||||||
|
<< indent << " mChildTs: " << mChildTs << std::endl
|
||||||
|
<< indent << " mServiceString: " << mServiceString << std::endl
|
||||||
|
<< indent << "######################################################" << std::endl;
|
||||||
|
return out;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class GxsGroupStatistic
|
class GxsGroupStatistic
|
||||||
|
@ -84,7 +84,8 @@ virtual ~RsPosted() { return; }
|
|||||||
/* Specific Service Data */
|
/* Specific Service Data */
|
||||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &groups) = 0;
|
virtual bool getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &groups) = 0;
|
||||||
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts) = 0;
|
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts) = 0;
|
||||||
virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &posts) = 0;
|
//Not currently used
|
||||||
|
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &posts) = 0;
|
||||||
|
|
||||||
/* From RsGxsCommentService */
|
/* From RsGxsCommentService */
|
||||||
//virtual bool getCommentData(const uint32_t &token, std::vector<RsGxsComment> &comments) = 0;
|
//virtual bool getCommentData(const uint32_t &token, std::vector<RsGxsComment> &comments) = 0;
|
||||||
|
@ -147,6 +147,7 @@ uint32_t RsGxsCommentSerialiser::sizeGxsCommentItem(RsGxsCommentItem *item)
|
|||||||
|
|
||||||
#ifdef GXSCOMMENT_DEBUG
|
#ifdef GXSCOMMENT_DEBUG
|
||||||
std::cerr << "RsGxsCommentSerialiser::sizeGxsCommentItem() is: " << s << std::endl;
|
std::cerr << "RsGxsCommentSerialiser::sizeGxsCommentItem() is: " << s << std::endl;
|
||||||
|
msg.print(std::cerr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
@ -321,7 +321,7 @@ bool p3GxsChannels::groupShareKeys(const RsGxsGroupId &groupId, std::set<RsPeerI
|
|||||||
* at the moment - fix it up later
|
* at the moment - fix it up later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &msgs)
|
bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &msgs, std::vector<RsGxsComment> &cmts)
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::getPostData()";
|
std::cerr << "p3GxsChannels::getPostData()";
|
||||||
@ -342,19 +342,32 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelP
|
|||||||
|
|
||||||
for(; vit != msgItems.end(); ++vit)
|
for(; vit != msgItems.end(); ++vit)
|
||||||
{
|
{
|
||||||
RsGxsChannelPostItem* item = dynamic_cast<RsGxsChannelPostItem*>(*vit);
|
RsGxsChannelPostItem* postItem = dynamic_cast<RsGxsChannelPostItem*>(*vit);
|
||||||
|
|
||||||
if(item)
|
if(postItem)
|
||||||
{
|
{
|
||||||
RsGxsChannelPost msg;
|
RsGxsChannelPost msg;
|
||||||
item->toChannelPost(msg, true);
|
postItem->toChannelPost(msg, true);
|
||||||
msgs.push_back(msg);
|
msgs.push_back(msg);
|
||||||
delete item;
|
delete postItem;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RsGxsCommentItem* cmt = dynamic_cast<RsGxsCommentItem*>(*vit);
|
RsGxsCommentItem* cmtItem = dynamic_cast<RsGxsCommentItem*>(*vit);
|
||||||
if(!cmt)
|
if(cmtItem)
|
||||||
|
{
|
||||||
|
RsGxsComment cmt;
|
||||||
|
RsGxsMsgItem *mi = (*vit);
|
||||||
|
cmt = cmtItem->mMsg;
|
||||||
|
cmt.mMeta = mi->meta;
|
||||||
|
#ifdef GXSCOMMENT_DEBUG
|
||||||
|
std::cerr << "p3GxsChannels::getPostData Found Comment:" << std::endl;
|
||||||
|
cmt.print(std::cerr," ", "cmt");
|
||||||
|
#endif
|
||||||
|
cmts.push_back(cmt);
|
||||||
|
delete cmtItem;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
RsGxsMsgItem* msg = (*vit);
|
RsGxsMsgItem* msg = (*vit);
|
||||||
//const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217;
|
//const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217;
|
||||||
@ -364,8 +377,8 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelP
|
|||||||
<< " PacketService=" << std::hex << (int)msg->PacketService() << std::dec
|
<< " PacketService=" << std::hex << (int)msg->PacketService() << std::dec
|
||||||
<< " PacketSubType=" << std::hex << (int)msg->PacketSubType() << std::dec
|
<< " PacketSubType=" << std::hex << (int)msg->PacketSubType() << std::dec
|
||||||
<< " , deleting!" << std::endl;
|
<< " , deleting!" << std::endl;
|
||||||
|
delete *vit;
|
||||||
}
|
}
|
||||||
delete *vit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -379,8 +392,8 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelP
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Not currently used
|
||||||
bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &msgs)
|
/*bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &msgs)
|
||||||
{
|
{
|
||||||
#ifdef GXSCHANNELS_DEBUG
|
#ifdef GXSCHANNELS_DEBUG
|
||||||
std::cerr << "p3GxsChannels::getRelatedPosts()";
|
std::cerr << "p3GxsChannels::getRelatedPosts()";
|
||||||
@ -436,7 +449,7 @@ bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vector<RsGxsChan
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
|
@ -79,9 +79,10 @@ virtual void handle_event(uint32_t event_type, const std::string &elabel);
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups);
|
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups);
|
||||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts);
|
||||||
|
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts) { std::vector<RsGxsComment> cmts; return getPostData( token, posts, cmts);}
|
||||||
virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
//Not currently used
|
||||||
|
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -255,8 +255,8 @@ bool p3GxsForums::getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Not currently used
|
||||||
bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs)
|
/*bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs)
|
||||||
{
|
{
|
||||||
GxsMsgRelatedDataMap msgData;
|
GxsMsgRelatedDataMap msgData;
|
||||||
bool ok = RsGenExchange::getMsgRelatedData(token, msgData);
|
bool ok = RsGenExchange::getMsgRelatedData(token, msgData);
|
||||||
@ -291,7 +291,7 @@ bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vector<RsGxsFor
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
|
|
||||||
|
@ -62,7 +62,8 @@ virtual void handle_event(uint32_t event_type, const std::string &elabel);
|
|||||||
|
|
||||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsForumGroup> &groups);
|
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsForumGroup> &groups);
|
||||||
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs);
|
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs);
|
||||||
virtual bool getRelatedMessages(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs);
|
//Not currently used
|
||||||
|
//virtual bool getRelatedMessages(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read);
|
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read);
|
||||||
|
@ -139,8 +139,8 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Not currently used
|
||||||
bool p3Posted::getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &msgs)
|
/*bool p3Posted::getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &msgs)
|
||||||
{
|
{
|
||||||
GxsMsgRelatedDataMap msgData;
|
GxsMsgRelatedDataMap msgData;
|
||||||
bool ok = RsGenExchange::getMsgRelatedData(token, msgData);
|
bool ok = RsGenExchange::getMsgRelatedData(token, msgData);
|
||||||
@ -178,7 +178,7 @@ bool p3Posted::getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost>
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
|
@ -64,7 +64,8 @@ virtual void receiveHelperChanges(std::vector<RsGxsNotify*>& changes)
|
|||||||
// Posted Specific DataTypes.
|
// Posted Specific DataTypes.
|
||||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &groups);
|
virtual bool getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &groups);
|
||||||
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts);
|
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts);
|
||||||
virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &posts);
|
//Not currently used
|
||||||
|
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &posts);
|
||||||
|
|
||||||
virtual bool createGroup(uint32_t &token, RsPostedGroup &group);
|
virtual bool createGroup(uint32_t &token, RsPostedGroup &group);
|
||||||
virtual bool createPost(uint32_t &token, RsPostedPost &post);
|
virtual bool createPost(uint32_t &token, RsPostedPost &post);
|
||||||
|
@ -295,7 +295,6 @@ void PostedItem::fill()
|
|||||||
ui->voteDownButton->setEnabled(false);
|
ui->voteDownButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
uint32_t up, down, nComments;
|
uint32_t up, down, nComments;
|
||||||
|
|
||||||
|
@ -108,6 +108,8 @@ void GxsChannelPostItem::setup()
|
|||||||
ui->subjectLabel->clear();
|
ui->subjectLabel->clear();
|
||||||
ui->datetimelabel->clear();
|
ui->datetimelabel->clear();
|
||||||
ui->filelabel->clear();
|
ui->filelabel->clear();
|
||||||
|
ui->newCommentLabel->hide();
|
||||||
|
ui->commLabel->hide();
|
||||||
|
|
||||||
/* general ones */
|
/* general ones */
|
||||||
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(toggle()));
|
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(toggle()));
|
||||||
@ -143,10 +145,10 @@ void GxsChannelPostItem::setup()
|
|||||||
ui->subjectLabel->setMinimumWidth(100);
|
ui->subjectLabel->setMinimumWidth(100);
|
||||||
ui->warning_label->setMinimumWidth(100);
|
ui->warning_label->setMinimumWidth(100);
|
||||||
|
|
||||||
ui->frame->setProperty("state", "");
|
ui->mainFrame->setProperty("state", "");
|
||||||
QPalette palette = ui->frame->palette();
|
QPalette palette = ui->mainFrame->palette();
|
||||||
palette.setColor(ui->frame->backgroundRole(), COLOR_NORMAL);
|
palette.setColor(ui->mainFrame->backgroundRole(), COLOR_NORMAL);
|
||||||
ui->frame->setPalette(palette);
|
ui->mainFrame->setPalette(palette);
|
||||||
|
|
||||||
ui->expandFrame->hide();
|
ui->expandFrame->hide();
|
||||||
}
|
}
|
||||||
@ -241,21 +243,36 @@ void GxsChannelPostItem::loadMessage(const uint32_t &token)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<RsGxsChannelPost> posts;
|
std::vector<RsGxsChannelPost> posts;
|
||||||
if (!rsGxsChannels->getPostData(token, posts))
|
std::vector<RsGxsComment> cmts;
|
||||||
|
if (!rsGxsChannels->getPostData(token, posts, cmts))
|
||||||
{
|
{
|
||||||
std::cerr << "GxsChannelPostItem::loadMessage() ERROR getting data";
|
std::cerr << "GxsChannelPostItem::loadMessage() ERROR getting data";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (posts.size() != 1)
|
if (posts.size() == 1)
|
||||||
|
{
|
||||||
|
setPost(posts[0]);
|
||||||
|
}
|
||||||
|
else if (cmts.size() == 1)
|
||||||
|
{
|
||||||
|
RsGxsComment cmt = cmts[0];
|
||||||
|
|
||||||
|
ui->newCommentLabel->show();
|
||||||
|
ui->commLabel->show();
|
||||||
|
ui->commLabel->setText(QString::fromUtf8(cmt.mComment.c_str()));
|
||||||
|
|
||||||
|
//Change this item to be uploaded with thread element.
|
||||||
|
setMessageId(cmt.mMeta.mThreadId);
|
||||||
|
requestMessage();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items";
|
std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPost(posts[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelPostItem::fill()
|
void GxsChannelPostItem::fill()
|
||||||
@ -347,7 +364,8 @@ void GxsChannelPostItem::fill()
|
|||||||
{
|
{
|
||||||
if (mIsHome) {
|
if (mIsHome) {
|
||||||
ui->commentButton->show();
|
ui->commentButton->show();
|
||||||
} else {
|
} else if (ui->commentButton->icon().isNull()){
|
||||||
|
//Icon is seted if a comment received.
|
||||||
ui->commentButton->hide();
|
ui->commentButton->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,15 +476,15 @@ void GxsChannelPostItem::setReadStatus(bool isNew, bool isUnread)
|
|||||||
ui->newLabel->setVisible(isNew);
|
ui->newLabel->setVisible(isNew);
|
||||||
|
|
||||||
/* unpolish widget to clear the stylesheet's palette cache */
|
/* unpolish widget to clear the stylesheet's palette cache */
|
||||||
ui->frame->style()->unpolish(ui->frame);
|
ui->mainFrame->style()->unpolish(ui->mainFrame);
|
||||||
|
|
||||||
QPalette palette = ui->frame->palette();
|
QPalette palette = ui->mainFrame->palette();
|
||||||
palette.setColor(ui->frame->backgroundRole(), isNew ? COLOR_NEW : COLOR_NORMAL); // QScrollArea
|
palette.setColor(ui->mainFrame->backgroundRole(), isNew ? COLOR_NEW : COLOR_NORMAL); // QScrollArea
|
||||||
palette.setColor(QPalette::Base, isNew ? COLOR_NEW : COLOR_NORMAL); // QTreeWidget
|
palette.setColor(QPalette::Base, isNew ? COLOR_NEW : COLOR_NORMAL); // QTreeWidget
|
||||||
ui->frame->setPalette(palette);
|
ui->mainFrame->setPalette(palette);
|
||||||
|
|
||||||
ui->frame->setProperty("new", isNew);
|
ui->mainFrame->setProperty("new", isNew);
|
||||||
Rshare::refreshStyleSheet(ui->frame, false);
|
Rshare::refreshStyleSheet(ui->mainFrame, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelPostItem::setFileCleanUpWarning(uint32_t time_left)
|
void GxsChannelPostItem::setFileCleanUpWarning(uint32_t time_left)
|
||||||
|
@ -6,22 +6,31 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>757</width>
|
<width>840</width>
|
||||||
<height>177</height>
|
<height>180</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gxsChannelPostItem_GLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
<property name="horizontalSpacing">
|
<property name="horizontalSpacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="mainFrame">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -37,9 +46,9 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Sunken</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="mainFrameVLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
<layout class="QHBoxLayout" name="mainTopHLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="logoLabel">
|
<widget class="QLabel" name="logoLabel">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@ -69,9 +78,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="mainRTopVLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="tilteHLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="StyledLabel" name="titleLabel">
|
<widget class="StyledLabel" name="titleLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -114,7 +123,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="subjectHLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="subjectLabel">
|
<widget class="QLabel" name="subjectLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -153,7 +162,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="warningHLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="warn_image_label">
|
<widget class="QLabel" name="warn_image_label">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
@ -180,7 +189,31 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="newCommHLayout">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="newCommentLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>New Comment:</string>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="ElidedLabel" name="commLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Comment Value</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="buttonHLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>8</number>
|
<number>8</number>
|
||||||
</property>
|
</property>
|
||||||
@ -450,8 +483,17 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="expandFrame">
|
<widget class="QFrame" name="expandFrame">
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout" name="expandFrameVLayout">
|
||||||
<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>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -462,8 +504,17 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Sunken</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="msgFrameVLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -508,6 +559,12 @@
|
|||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>gui/common/StyledLabel.h</header>
|
<header>gui/common/StyledLabel.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ElidedLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header location="global">gui/common/ElidedLabel.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
|
@ -36,6 +36,8 @@ public:
|
|||||||
virtual ~GxsFeedItem();
|
virtual ~GxsFeedItem();
|
||||||
|
|
||||||
RsGxsMessageId messageId() { return mMessageId; }
|
RsGxsMessageId messageId() { return mMessageId; }
|
||||||
|
//To be able to update with thread message when comment is received.
|
||||||
|
void setMessageId( RsGxsMessageId id) {mMessageId = id;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* load message data */
|
/* load message data */
|
||||||
|
Loading…
Reference in New Issue
Block a user