mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
Update display of WireGroup
This commit is contained in:
parent
bcd8f4b0de
commit
589bb65324
@ -42,6 +42,8 @@ typedef std::shared_ptr<const RsWireGroup> RsWireGroupConstSPtr;
|
||||
class RsWireGroup: public RsGxsGenericGroupData
|
||||
{
|
||||
public:
|
||||
RsWireGroup();
|
||||
|
||||
std::string mTagline;
|
||||
std::string mLocation;
|
||||
|
||||
|
@ -30,6 +30,12 @@
|
||||
|
||||
RsWire *rsWire = NULL;
|
||||
|
||||
RsWireGroup::RsWireGroup()
|
||||
:mGroupPulses(0),mGroupRepublishes(0),mGroupLikes(0),mGroupReplies(0)
|
||||
,mRefMentions(0),mRefRepublishes(0),mRefLikes(0),mRefReplies(0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t RsWirePulse::ImageCount()
|
||||
{
|
||||
@ -878,6 +884,19 @@ bool p3Wire::getPulsesForGroups(const std::list<RsGxsGroupId> &groupIds, std::li
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
std::cerr << "p3Wire::getPulsesForGroups() size = " << pulsePtrs.size();
|
||||
std::cerr << std::endl;
|
||||
{
|
||||
std::list<RsWirePulseSPtr>::iterator it;
|
||||
for (it = pulsePtrs.begin(); it != pulsePtrs.end(); it++)
|
||||
{
|
||||
std::cerr << "p3Wire::getPulsesForGroups() Flags: ";
|
||||
std::cerr << (*it)->mPulseType << " Msg: " << (*it)->mPulseText;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::cerr << "p3Wire::getPulsesForGroups() size = " << pulsePtrs.size();
|
||||
std::cerr << " sorting and trimming";
|
||||
std::cerr << std::endl;
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include "PulseViewGroup.h"
|
||||
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "util/DateTime.h"
|
||||
|
||||
/** Constructor */
|
||||
@ -40,8 +41,54 @@ PulseViewGroup::PulseViewGroup(PulseViewHolder *holder, RsWireGroupSPtr group)
|
||||
void PulseViewGroup::setup()
|
||||
{
|
||||
if (mGroup) {
|
||||
label_groupName->setText(QString::fromStdString(mGroup->mMeta.mGroupName));
|
||||
label_authorName->setText(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString()));
|
||||
label_groupName->setText("@" + QString::fromStdString(mGroup->mMeta.mGroupName));
|
||||
label_authorName->setText(BoldString(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString())));
|
||||
label_date->setText(DateTime::formatDateTime(mGroup->mMeta.mPublishTs));
|
||||
label_tagline->setText(QString::fromStdString(mGroup->mTagline));
|
||||
label_location->setText(QString::fromStdString(mGroup->mLocation));
|
||||
|
||||
// need to draw mGroup->mMasthead, as background to headshot.
|
||||
// TODO frame_headerBackground->setBackground()
|
||||
|
||||
if (mGroup->mHeadshot.mData)
|
||||
{
|
||||
QPixmap pixmap;
|
||||
if (GxsIdDetails::loadPixmapFromData(
|
||||
mGroup->mHeadshot.mData,
|
||||
mGroup->mHeadshot.mSize,
|
||||
pixmap,GxsIdDetails::ORIGINAL))
|
||||
{
|
||||
pixmap = pixmap.scaled(50,50);
|
||||
label_headshot->setPixmap(pixmap);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// default.
|
||||
QPixmap pixmap = QPixmap(":/icons/png/posted.png").scaled(50,50);
|
||||
label_headshot->setPixmap(pixmap);
|
||||
}
|
||||
|
||||
if (mGroup->mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
|
||||
{
|
||||
uint32_t pulses = mGroup->mGroupPulses + mGroup->mGroupReplies;
|
||||
uint32_t replies = mGroup->mRefReplies;
|
||||
uint32_t republishes = mGroup->mRefRepublishes;
|
||||
uint32_t likes = mGroup->mRefLikes;
|
||||
|
||||
label_extra_pulses->setText(BoldString(ToNumberUnits(pulses)));
|
||||
label_extra_replies->setText(BoldString(ToNumberUnits(replies)));
|
||||
label_extra_republishes->setText(BoldString(ToNumberUnits(republishes)));
|
||||
label_extra_likes->setText(BoldString(ToNumberUnits(likes)));
|
||||
|
||||
// hide follow.
|
||||
widget_actions->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// hide stats.
|
||||
widget_replies->setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ border-radius: 10px}</string>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QLabel" name="label_location">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@ -277,7 +277,7 @@ border-radius: 10px}</string>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="label_tagline">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
|
Loading…
Reference in New Issue
Block a user