Improvements to UI to make behaviour more similar to twitter.

Add new UI elements.
Can show PulseFocus or GroupFocus at the moment.
WIP, Much more work to get this finalised.
This commit is contained in:
drbob 2020-05-15 22:36:50 +10:00
parent ccf849159a
commit 11ce959b2f
26 changed files with 3747 additions and 135 deletions

View File

@ -172,7 +172,7 @@ void PulseAddDialog::postOriginalPulse()
pulse.mMeta.mParentId.clear();
pulse.mMeta.mOrigMsgId.clear();
pulse.mPulseType = WIRE_PULSE_TYPE_ORIGINAL_MSG;
pulse.mPulseType = WIRE_PULSE_TYPE_ORIGINAL;
pulse.mReplySentiment = WIRE_PULSE_SENTIMENT_NO_SENTIMENT;
pulse.mPulseText = ui.textEdit_Pulse->toPlainText().toStdString();
// all mRefs should empty.
@ -219,7 +219,7 @@ void PulseAddDialog::postReplyPulse()
pulse.mMeta.mParentId.clear();
pulse.mMeta.mOrigMsgId.clear();
pulse.mPulseType = WIRE_PULSE_TYPE_REPLY_MSG;
pulse.mPulseType = WIRE_PULSE_TYPE_RESPONSE | WIRE_PULSE_TYPE_REPLY;
pulse.mReplySentiment = toPulseSentiment(ui.comboBox_sentiment->currentIndex());
pulse.mPulseText = ui.textEdit_Pulse->toPlainText().toStdString();
@ -254,7 +254,7 @@ void PulseAddDialog::postRefPulse(RsWirePulse &pulse)
refPulse.mMeta.mParentId = mReplyToPulse.mMeta.mOrigMsgId;
refPulse.mMeta.mOrigMsgId.clear();
refPulse.mPulseType = WIRE_PULSE_TYPE_REPLY_REFERENCE;
refPulse.mPulseType = WIRE_PULSE_TYPE_REFERENCE | WIRE_PULSE_TYPE_REPLY;
refPulse.mReplySentiment = toPulseSentiment(ui.comboBox_sentiment->currentIndex());
// Dont put parent PulseText into refPulse - it is available on Thread Msg.

View File

@ -93,7 +93,7 @@ void PulseDetails::setup()
frame_replies->setVisible(false);
mHasReplies = false;
toolButton_follow->setEnabled(false); // TODO
// TMP toolButton_follow->setEnabled(false); // TODO
toolButton_rate->setEnabled(false); // TODO
toolButton_reply->setEnabled(mActions != NULL);
}
@ -153,6 +153,7 @@ void PulseDetails::toggle()
}
}
const int SUMMARY_MAX_LEN = 50;
QString PulseDetails::getSummary()
{
std::string summary = mPulse.mPulseText;
@ -178,6 +179,13 @@ QString PulseDetails::getSummary()
in_whitespace = false;
}
}
if (SUMMARY_MAX_LEN < len)
{
summary = summary.substr(0,SUMMARY_MAX_LEN-3);
summary += "...";
}
std::cerr << "PulseDetails::getSummary() summary: " << summary;
std::cerr << std::endl;
@ -189,7 +197,10 @@ void PulseDetails::follow()
// follow group.
if (mActions)
{
mActions->follow(mPulse.mMeta.mGroupId);
// tmp hack for developing.
mActions->focus(mPulse.mMeta.mGroupId, mPulse.mMeta.mOrigMsgId);
//mActions->follow(mPulse.mMeta.mGroupId);
}
}

View File

@ -52,7 +52,7 @@ PulseItem::PulseItem(PulseHolder *holder, RsWirePulse *pulse_ptr, RsWireGroup *g
QWidget *pulse_widget = widget_parent; // default msg goes into widget_parent.
/* if it is a reply */
if (mPulse.mPulseType & WIRE_PULSE_TYPE_REPLY_MSG) {
if (mPulse.mPulseType & WIRE_PULSE_TYPE_RESPONSE) {
std::cerr << "Installing Reply Msg";
std::cerr << std::endl;

View File

@ -35,6 +35,7 @@ public:
virtual void notifyPulseSelection(PulseItem *item) = 0;
// Actions.
virtual void focus(RsGxsGroupId &groupId, RsGxsMessageId &msgId) = 0;
virtual void follow(RsGxsGroupId &groupId) = 0;
virtual void rate(RsGxsId &authorId) = 0;
virtual void reply(RsWirePulse &pulse, std::string &groupName) = 0;

View File

@ -0,0 +1,70 @@
/*******************************************************************************
* gui/TheWire/PulseMessage.cpp *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "PulseMessage.h"
/** Constructor */
PulseMessage::PulseMessage(QWidget *parent)
:QWidget(parent)
{
setupUi(this);
}
void PulseMessage::setup(RsWirePulseSPtr pulse)
{
if (!pulse) {
return;
}
setMessage(QString::fromStdString(pulse->mPulseText));
// setup images.
if (!pulse->mImage1.empty()) {
// install image.
} else {
// leave this visible for a bit.
// label_image1->setVisible(false);
}
if (!pulse->mImage2.empty()) {
// install image.
} else {
label_image2->setVisible(false);
}
if (!pulse->mImage3.empty()) {
// install image.
} else {
label_image3->setVisible(false);
}
if (!pulse->mImage4.empty()) {
// install image.
} else {
label_image4->setVisible(false);
}
}
void PulseMessage::setMessage(QString msg)
{
textBrowser->setPlainText(msg);
}

View File

@ -0,0 +1,39 @@
/*******************************************************************************
* gui/TheWire/PulseMessage.h *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef MRK_PULSE_MSG_H
#define MRK_PULSE_MSG_H
#include "ui_PulseMessage.h"
#include <retroshare/rswire.h>
class PulseMessage : public QWidget, private Ui::PulseMessage
{
Q_OBJECT
public:
PulseMessage(QWidget *parent);
void setup(RsWirePulseSPtr pulse);
void setMessage(QString msg);
};
#endif

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PulseMessage</class>
<widget class="QWidget" name="PulseMessage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>553</width>
<height>281</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="textBrowser"/>
</item>
<item>
<widget class="QFrame" name="frame_expand">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_image1">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Image</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_image2">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Image</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_image3">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Image</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_image4">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Image</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,142 @@
/*******************************************************************************
* gui/TheWire/PulseReply.cpp *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <QDateTime>
#include <QMessageBox>
#include <QMouseEvent>
#include <QBuffer>
#include "PulseReply.h"
#include <algorithm>
#include <iostream>
/** Constructor */
PulseReply::PulseReply(PulseViewHolder *holder, RsWirePulseSPtr pulse)
:PulseDataItem(holder, pulse)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setup();
if (mPulse) {
showPulse();
}
widget_prefix->setVisible(false);
}
void PulseReply::setup()
{
// connect(pushButton_tmpViewGroup, SIGNAL(clicked()), this, SLOT(actionViewGroup()));
// connect(pushButton_tmpViewParent, SIGNAL(clicked()), this, SLOT(actionViewParent()));
connect(toolButton_follow, SIGNAL(clicked()), this, SLOT(actionFollow()));
// connect(toolButton_rate, SIGNAL(clicked()), this, SLOT(rate()));
connect(toolButton_reply, SIGNAL(clicked()), this, SLOT(actionReply()));
connect(toolButton_republish, SIGNAL(clicked()), this, SLOT(actionRepublish()));
connect(toolButton_like, SIGNAL(clicked()), this, SLOT(actionLike()));
connect(toolButton_view, SIGNAL(clicked()), this, SLOT(actionViewPulse()));
}
void PulseReply::showReplyLine(bool enable)
{
line_replyLine->setVisible(enable);
}
// PulseDataInterface ===========
// Group
void PulseReply::setHeadshot(const QPixmap &pixmap)
{
label_headshot->setPixmap(pixmap);
}
void PulseReply::setGroupNameString(QString name)
{
label_groupName->setText("@" + name);
}
void PulseReply::setAuthorString(QString name)
{
label_authorName->setText(BoldString(name));
}
// Msg
void PulseReply::setRefMessage(QString msg, uint32_t image_count)
{
widget_message->setMessage(msg);
//, image_count);
}
void PulseReply::setMessage(RsWirePulseSPtr pulse)
{
widget_message->setup(pulse);
}
void PulseReply::setDateString(QString date)
{
label_date->setText(date);
}
// Refs
void PulseReply::setLikesString(QString likes)
{
label_likes->setText(likes);
}
void PulseReply::setRepublishesString(QString repub)
{
label_republishes->setText(repub);
}
void PulseReply::setRepliesString(QString reply)
{
label_replies->setText(reply);
}
void PulseReply::showResponseStats(bool enable)
{
widget_actions->setVisible(enable);
widget_follow->setVisible(!enable);
}
void PulseReply::setReferenceString(QString ref)
{
if (ref.size() == 0)
{
// appear to have duplicated here....
// widget_prefix->setVisible(false);
widget_reply_header->setVisible(false);
}
else
{
label_reference->setText(ref);
}
}
// PulseDataInterface ===========
void PulseReply::mousePressEvent(QMouseEvent *event)
{
}

View File

@ -0,0 +1,65 @@
/*******************************************************************************
* gui/TheWire/PulseReply.h *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef MRK_PULSE_REPLY_H
#define MRK_PULSE_REPLY_H
#include "ui_PulseReply.h"
#include "PulseViewItem.h"
#include <retroshare/rswire.h>
class PulseReply : public PulseDataItem, private Ui::PulseReply
{
Q_OBJECT
public:
PulseReply(PulseViewHolder *holder, RsWirePulseSPtr pulse);
void showReplyLine(bool enable);
protected:
void setup();
// PulseDataInterface ===========
// Group
virtual void setHeadshot(const QPixmap &pixmap) override;
virtual void setGroupNameString(QString name) override;
virtual void setAuthorString(QString name) override;
// Msg
virtual void setRefMessage(QString msg, uint32_t image_count) override;
virtual void setMessage(RsWirePulseSPtr pulse) override;
virtual void setDateString(QString date) override;
// Refs
virtual void setLikesString(QString likes) override;
virtual void setRepublishesString(QString repub) override;
virtual void setRepliesString(QString reply) override;
//
virtual void setReferenceString(QString ref) override;
virtual void showResponseStats(bool enable) override;
// PulseDataInterface ===========
void mousePressEvent(QMouseEvent *event);
};
#endif

View File

@ -0,0 +1,600 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PulseReply</class>
<widget class="QWidget" name="PulseReply">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>579</width>
<height>478</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{border: 2px solid #CCCCCC;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QWidget" name="widget_prefix" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>21</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>icn</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>retweeted</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>222</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="5" column="1">
<widget class="QWidget" name="widget_actions" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_reply">
<property name="text">
<string>RPL</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_replies">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_republish">
<property name="text">
<string>RET</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_republishes">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_like">
<property name="text">
<string>LIK</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_likes">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_view">
<property name="text">
<string>LNK</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_links">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="6" column="1">
<widget class="QWidget" name="widget_follow" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<spacer name="horizontalSpacer_422">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>104</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_follow">
<property name="text">
<string>FOLLOW</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string> for response statistics </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_322">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>104</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QWidget" name="widget_header" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="label_authorName">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_groupName">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;@sidler_here&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_18">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>19</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_date">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;· Apr 13 ·&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>64</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" rowspan="6">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_headshot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Head&lt;/p&gt;&lt;p&gt;Shot&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<spacer name="horizontalSpacer_16">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_replyLine">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget_reply_header" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QLabel" name="label_reference">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;Replying to @sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_20">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>215</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="3" column="1" rowspan="2">
<widget class="PulseMessage" name="widget_message" native="true"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PulseMessage</class>
<extends>QWidget</extends>
<header>gui/TheWire/PulseMessage.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="TheWire_images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,32 @@
/*******************************************************************************
* gui/TheWire/PulseReplySeperator.cpp *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include "PulseReplySeperator.h"
/** Constructor */
PulseReplySeperator::PulseReplySeperator()
:PulseViewItem(NULL)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
}

View File

@ -0,0 +1,35 @@
/*******************************************************************************
* gui/TheWire/PulseReplySeperator.h *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef MRK_PULSE_REPLY_SEPERATOR_H
#define MRK_PULSE_REPLY_SEPERATOR_H
#include "ui_PulseReplySeperator.h"
#include "PulseViewItem.h"
class PulseReplySeperator : public PulseViewItem, private Ui::PulseReplySeperator
{
Q_OBJECT
public:
PulseReplySeperator();
};
#endif

View File

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PulseReplySeperator</class>
<widget class="QWidget" name="PulseReplySeperator">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>781</width>
<height>57</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{border: 2px solid #CCCCCC;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="lineWidth">
<number>100</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>3</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>5</height>
</size>
</property>
<property name="lineWidth">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="TheWire_images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,132 @@
/*******************************************************************************
* gui/TheWire/PulseItem.cpp *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <QDateTime>
#include <QMessageBox>
#include <QMouseEvent>
#include <QBuffer>
#include "PulseTopLevel.h"
#include <algorithm>
#include <iostream>
/** Constructor */
PulseTopLevel::PulseTopLevel(PulseViewHolder *holder, RsWirePulseSPtr pulse)
:PulseDataItem(holder, pulse)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setup();
if (mPulse) {
showPulse();
}
}
void PulseTopLevel::setup()
{
connect(pushButton_tmpViewGroup, SIGNAL(clicked()), this, SLOT(actionViewGroup()));
connect(pushButton_tmpViewParent, SIGNAL(clicked()), this, SLOT(actionViewParent()));
// connect(toolButton_follow, SIGNAL(clicked()), this, SLOT(follow()));
// connect(toolButton_rate, SIGNAL(clicked()), this, SLOT(rate()));
connect(toolButton_reply, SIGNAL(clicked()), this, SLOT(actionReply()));
connect(toolButton_republish, SIGNAL(clicked()), this, SLOT(actionRepublish()));
connect(toolButton_like, SIGNAL(clicked()), this, SLOT(actionLike()));
connect(toolButton_view, SIGNAL(clicked()), this, SLOT(actionViewPulse()));
}
void PulseTopLevel::setRefMessage(QString msg, uint32_t image_count)
{
// This should never happen.
//widget_message->setRefMessage(msg, image_count);
}
void PulseTopLevel::setMessage(RsWirePulseSPtr pulse)
{
widget_message->setup(pulse);
}
// Set UI elements.
void PulseTopLevel::setHeadshot(const QPixmap &pixmap)
{
label_headshot->setPixmap(pixmap);
}
void PulseTopLevel::setGroupNameString(QString name)
{
label_groupName->setText("@" + name);
}
void PulseTopLevel::setAuthorString(QString name)
{
label_authorName->setText(BoldString(name));
}
void PulseTopLevel::setDateString(QString date)
{
label_date->setText(date);
}
void PulseTopLevel::setLikesString(QString likes)
{
label_extra_likes->setText(BoldString(likes));
label_likes->setText(likes);
}
void PulseTopLevel::setRepublishesString(QString repub)
{
label_extra_republishes->setText(BoldString(repub));
label_republishes->setText(repub);
}
void PulseTopLevel::setRepliesString(QString reply)
{
label_extra_replies->setText(BoldString(reply));
label_replies->setText(reply);
}
void PulseTopLevel::showResponseStats(bool enable)
{
widget_replies->setVisible(enable);
widget_actions->setVisible(enable);
}
void PulseTopLevel::setReferenceString(QString ref)
{
if (ref.size() == 0)
{
widget_prefix->setVisible(false);
}
else
{
label_reference->setText(ref);
}
}
void PulseTopLevel::mousePressEvent(QMouseEvent *event)
{
}

View File

@ -0,0 +1,65 @@
/*******************************************************************************
* gui/TheWire/PulseTopLevel.h *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef MRK_PULSE_TOP_LEVEL_H
#define MRK_PULSE_TOP_LEVEL_H
#include "ui_PulseTopLevel.h"
#include "PulseViewItem.h"
#include <retroshare/rswire.h>
class PulseTopLevel : public PulseDataItem, private Ui::PulseTopLevel
{
Q_OBJECT
public:
PulseTopLevel(PulseViewHolder *holder, RsWirePulseSPtr pulse);
protected:
void setup();
// PulseDataInterface ===========
// Group
virtual void setHeadshot(const QPixmap &pixmap) override;
virtual void setGroupNameString(QString name) override;
virtual void setAuthorString(QString name) override;
// Msg
virtual void setRefMessage(QString msg, uint32_t image_count) override;
virtual void setMessage(RsWirePulseSPtr pulse) override;
virtual void setDateString(QString date) override;
// Refs
virtual void setLikesString(QString likes) override;
virtual void setRepublishesString(QString repub) override;
virtual void setRepliesString(QString reply) override;
//
virtual void setReferenceString(QString ref) override;
virtual void showResponseStats(bool enable) override;
// PulseDataInterface ===========
protected:
void mousePressEvent(QMouseEvent *event);
};
#endif

View File

@ -0,0 +1,663 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PulseTopLevel</class>
<widget class="QWidget" name="PulseTopLevel">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>732</width>
<height>551</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{border: 2px solid #CCCCCC;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget_prefix" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>21</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_reficon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>icn</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_reference">
<property name="text">
<string>retweeted</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_tmpViewParent">
<property name="text">
<string>TMP VIEW PARENT</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>537</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_header" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_groupName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;@sidler_here&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_authorName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="3" rowspan="3">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>518</width>
<height>58</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="3">
<widget class="QLabel" name="label_headshot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Head&lt;/p&gt;&lt;p&gt;Shot&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_tmpViewGroup">
<property name="text">
<string>TMP VIEW</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="PulseMessage" name="widget_message" native="true"/>
</item>
<item>
<widget class="QWidget" name="widget_publish" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_date">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;3:58 AM · Apr 13, 2020 ·&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>505</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_replies" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_611">
<item>
<widget class="QLabel" name="label_extra_replies">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;1.2K&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_911">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;Replies&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_1011">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_extra_republishes">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;1.2K&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;Republishes&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_extra_likes">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;21.3K&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;Likes&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_actions" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_reply">
<property name="text">
<string>RPL</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_replies">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_republish">
<property name="text">
<string>RET</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_republishes">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_like">
<property name="text">
<string>LIK</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_likes">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_view">
<property name="text">
<string>LNK</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_links">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PulseMessage</class>
<extends>QWidget</extends>
<header>gui/TheWire/PulseMessage.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="TheWire_images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,47 @@
/*******************************************************************************
* gui/TheWire/PulseViewGroup.cpp *
* *
* Copyright (c) 2012-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <QDateTime>
#include <QMessageBox>
#include <QMouseEvent>
#include <QBuffer>
#include "PulseViewGroup.h"
#include "util/DateTime.h"
/** Constructor */
PulseViewGroup::PulseViewGroup(PulseViewHolder *holder, RsWireGroupSPtr group)
:PulseViewItem(holder), mGroup(group)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setup();
}
void PulseViewGroup::setup()
{
if (mGroup) {
label_groupName->setText(QString::fromStdString(mGroup->mMeta.mGroupName));
label_authorName->setText(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString()));
}
}

View File

@ -0,0 +1,43 @@
/*******************************************************************************
* gui/TheWire/PulseViewGroup.h *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef MRK_PULSE_VIEW_GROUP_H
#define MRK_PULSE_VIEW_GROUP_H
#include "ui_PulseViewGroup.h"
#include "PulseViewItem.h"
#include <retroshare/rswire.h>
class PulseViewGroup : public PulseViewItem, private Ui::PulseViewGroup
{
Q_OBJECT
public:
PulseViewGroup(PulseViewHolder *holder, RsWireGroupSPtr group);
protected:
void setup();
protected:
RsWireGroupSPtr mGroup;
};
#endif

View File

@ -0,0 +1,542 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PulseViewGroup</class>
<widget class="QWidget" name="PulseViewGroup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>745</width>
<height>483</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{border: 2px solid #CCCCCC;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #EEEEEE, stop: 1 #CCCCCC);
border-radius: 10px}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="frame_headerBackground">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<spacer name="horizontalSpacer_16">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>283</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_headshot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>headshot</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>23</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_header" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1" rowspan="3">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>518</width>
<height>58</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_groupName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#555753;&quot;&gt;@sidler_here&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_authorName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Sidler&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_publish" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="2">
<widget class="QLabel" name="label_date">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;3:58 AM · Apr 13, 2020 ·&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Location</string>
</property>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>2000</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Tag Line</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_replies" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_622">
<item>
<widget class="QLabel" name="label_extra_pulses">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;1.2K&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_922">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;Pulses&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_1022">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_611">
<item>
<widget class="QLabel" name="label_extra_replies">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;1.2K&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_911">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;Replies&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_1011">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_extra_republishes">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;1.2K&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;Republishes&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_extra_likes">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;21.3K&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#2e3436;&quot;&gt;Likes&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_actions" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<spacer name="horizontalSpacer_20">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>298</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_like_2">
<property name="text">
<string>FOLLOW</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_21">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>297</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="TheWire_images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,364 @@
/*******************************************************************************
* gui/TheWire/PulseViewItem.cpp *
* *
* Copyright (c) 2012-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <QDateTime>
#include <QMessageBox>
#include <QMouseEvent>
#include <QBuffer>
#include "PulseViewItem.h"
#include "gui/gxs/GxsIdDetails.h"
#include "util/DateTime.h"
/** Constructor */
PulseViewItem::PulseViewItem(PulseViewHolder *holder)
:QWidget(NULL), mHolder(holder)
{
}
PulseDataItem::PulseDataItem(PulseViewHolder *holder, RsWirePulseSPtr pulse)
:PulseViewItem(holder), mPulse(pulse)
{
}
void PulseDataItem::actionReply()
{
std::cerr << "PulseDataItem::actionReply()";
std::cerr << std::endl;
if (mHolder) {
std::string groupName = "unknownGroupName";
mHolder->PVHreply(*mPulse, groupName);
}
}
void PulseDataItem::actionRepublish()
{
std::cerr << "PulseDataItem::actionRepublish()";
std::cerr << std::endl;
if (mHolder) {
std::string groupName = "unknownGroupName";
mHolder->PVHrepublish(*mPulse, groupName);
}
}
void PulseDataItem::actionLike()
{
std::cerr << "PulseDataItem::actionLike()";
std::cerr << std::endl;
if (mHolder) {
std::string groupName = "unknownGroupName";
mHolder->PVHlike(*mPulse, groupName);
}
}
void PulseDataItem::actionViewGroup()
{
std::cerr << "PulseDataItem::actionViewGroup()";
std::cerr << std::endl;
RsGxsGroupId groupId;
if (mPulse) {
if ((mPulse->mPulseType & WIRE_PULSE_TYPE_ORIGINAL) ||
(mPulse->mPulseType & WIRE_PULSE_TYPE_RESPONSE))
{
/* use pulse group */
groupId = mPulse->mMeta.mGroupId;
}
else
{
/* IS REF use pulse group */
groupId = mPulse->mRefGroupId;
}
}
if (mHolder) {
mHolder->PVHviewGroup(groupId);
}
}
void PulseDataItem::actionViewParent()
{
std::cerr << "PulseDataItem::actionViewParent()";
std::cerr << std::endl;
// TODO
RsGxsGroupId groupId;
RsGxsMessageId msgId;
if (mPulse) {
if (mPulse->mPulseType & WIRE_PULSE_TYPE_ORIGINAL)
{
std::cerr << "PulseDataItem::actionViewParent() Error ORIGINAL no parent";
std::cerr << std::endl;
}
else if (mPulse->mPulseType & WIRE_PULSE_TYPE_RESPONSE)
{
/* mRefs refer to parent */
groupId = mPulse->mRefGroupId;
msgId = mPulse->mRefOrigMsgId;
}
else
{
/* type = REF, group / thread ref to parent */
groupId = mPulse->mMeta.mGroupId;
msgId = mPulse->mMeta.mThreadId;
}
}
if (mHolder) {
mHolder->PVHviewPulse(groupId, msgId);
}
}
void PulseDataItem::actionViewPulse()
{
std::cerr << "PulseDataItem::actionViewPulse()";
std::cerr << std::endl;
// TODO
RsGxsGroupId groupId;
RsGxsMessageId msgId;
if (mPulse) {
if ((mPulse->mPulseType & WIRE_PULSE_TYPE_ORIGINAL) ||
(mPulse->mPulseType & WIRE_PULSE_TYPE_RESPONSE))
{
groupId = mPulse->mMeta.mGroupId;
msgId = mPulse->mMeta.mOrigMsgId;
}
else
{
/* type = REF, mRefs link to message */
std::cerr << "PulseDataItem::actionViewPulse() REF unlikely retrievable";
std::cerr << std::endl;
groupId = mPulse->mRefGroupId;
msgId = mPulse->mRefOrigMsgId;
}
}
if (mHolder) {
mHolder->PVHviewPulse(groupId, msgId);
}
}
void PulseDataItem::actionFollow()
{
std::cerr << "PulseDataItem::actionFollow()";
std::cerr << std::endl;
// TODO
RsGxsGroupId groupId;
if (mHolder) {
mHolder->PVHfollow(groupId);
}
}
void PulseDataItem::actionRate()
{
std::cerr << "PulseDataItem::actionRate()";
std::cerr << std::endl;
// TODO
RsGxsId authorId;
if (mHolder) {
mHolder->PVHrate(authorId);
}
}
void PulseDataItem::showPulse()
{
std::cerr << "PulseDataItem::showPulse()";
std::cerr << std::endl;
if (!mPulse) {
std::cerr << "PulseDataItem::showPulse() PULSE invalid - skipping";
std::cerr << std::endl;
return;
}
/* 3 Modes:
* ORIGINAL
* RESPONSE
* REFERENCE
*
* ORIG / RESPONSE are similar.
*/
if (mPulse->mPulseType & WIRE_PULSE_TYPE_REFERENCE)
{
// Group
setGroupName(mPulse->mRefGroupName);
setAuthor(mPulse->mRefAuthorId.toStdString());
// Msg
setRefMessage(QString::fromStdString(mPulse->mRefPulseText), mPulse->mRefImageCount);
setDate(mPulse->mRefPublishTs);
// References (unknown for a REFERENCE)
// should show FOLLOW button instead.
// setLikes(mPulse->mLikes.size());
// setReplies(mPulse->mReplies.size());
// setRepublishes(mPulse->mRepublishes.size());
showResponseStats(false);
//
setReference(mPulse->mPulseType & WIRE_PULSE_RESPONSE_MASK, mPulse->mMeta.mGroupId, "GroupName TODO");
}
else // ORIG / RESPONSE.
{
// Group
bool headshotOkay = false;
if (mPulse->mGroupPtr) {
setGroupName(mPulse->mGroupPtr->mMeta.mGroupName);
if (mPulse->mGroupPtr->mHeadshot.mData)
{
QPixmap pixmap;
if (GxsIdDetails::loadPixmapFromData(
mPulse->mGroupPtr->mHeadshot.mData,
mPulse->mGroupPtr->mHeadshot.mSize,
pixmap,GxsIdDetails::ORIGINAL))
{
headshotOkay = true;
pixmap = pixmap.scaled(50,50);
setHeadshot(pixmap);
}
}
} else {
setGroupName("GroupName UNKNOWN");
}
if (!headshotOkay)
{
// default.
QPixmap pixmap = QPixmap(":/icons/png/posted.png").scaled(50,50);
setHeadshot(pixmap); // QPixmap(":/icons/png/posted.png"));
}
setAuthor(mPulse->mMeta.mAuthorId.toStdString());
// Msg
setMessage(mPulse);
setDate(mPulse->mMeta.mPublishTs);
// References
showResponseStats(true);
setLikes(mPulse->mLikes.size());
setReplies(mPulse->mReplies.size());
setRepublishes(mPulse->mRepublishes.size());
if (mPulse->mPulseType & WIRE_PULSE_TYPE_RESPONSE)
{
setReference(mPulse->mPulseType & WIRE_PULSE_RESPONSE_MASK, mPulse->mRefGroupId, mPulse->mRefGroupName);
}
}
}
void PulseDataItem::setGroupName(std::string name)
{
setGroupNameString(QString::fromStdString(name));
}
void PulseDataItem::setAuthor(std::string name)
{
setAuthorString(QString::fromStdString(name));
}
void PulseDataItem::setDate(rstime_t date)
{
// could be more intelligent.
// eg. 3 Hr ago, if recent.
setDateString(DateTime::formatDateTime(date));
}
void PulseDataItem::setLikes(uint32_t count)
{
setLikesString(ToNumberUnits(count));
}
void PulseDataItem::setRepublishes(uint32_t count)
{
setRepublishesString(ToNumberUnits(count));
}
void PulseDataItem::setReplies(uint32_t count)
{
std::cerr << "PulseDataItem::setReplies(" << count << ")";
std::cerr << std::endl;
setRepliesString(ToNumberUnits(count));
}
void PulseDataItem::setReference(uint32_t response_type, RsGxsGroupId groupId, std::string groupName)
{
QString ref;
if (response_type == WIRE_PULSE_TYPE_REPLY) {
ref = "In reply to @" + QString::fromStdString(groupName);
}
else if (response_type == WIRE_PULSE_TYPE_REPUBLISH) {
ref = "retweeting @" + QString::fromStdString(groupName);
}
else if (response_type == WIRE_PULSE_TYPE_LIKE) {
ref = "liking @" + QString::fromStdString(groupName);
}
setReferenceString(ref);
}
// Utils.
QString BoldString(QString msg)
{
QString output = "<html><head/><body><p><span style=\" font-weight:600;\">";
output += msg;
output += "</span></p></body></html>";
return output;
}
QString ToNumberUnits(uint32_t count)
{
QString ans;
if (count > 1000000)
{
ans.sprintf("%6.2fm", count / 1000000.0);
}
else if (count > 1000)
{
ans.sprintf("%6.2fk", count / 1000.0);
}
else
{
ans.sprintf("%6d", count);
}
return ans;
}

View File

@ -0,0 +1,142 @@
/*******************************************************************************
* gui/TheWire/PulseViewItem.h *
* *
* Copyright (c) 2020-2020 Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef MRK_PULSE_VIEW_ITEM_H
#define MRK_PULSE_VIEW_ITEM_H
#include "ui_PulseItem.h"
#include <retroshare/rswire.h>
class PulseViewItem;
class PulseViewHolder
{
public:
virtual ~PulseViewHolder() {}
// Actions.
virtual void PVHreply(RsWirePulse &pulse, std::string &groupName) = 0;
virtual void PVHrepublish(RsWirePulse &pulse, std::string &groupName) = 0;
virtual void PVHlike(RsWirePulse &pulse, std::string &groupName) = 0;
virtual void PVHviewGroup(RsGxsGroupId &groupId) = 0;
virtual void PVHviewPulse(RsGxsGroupId &groupId, RsGxsMessageId &msgId) = 0;
virtual void PVHviewReply(RsGxsGroupId &groupId, RsGxsMessageId &msgId) = 0;
virtual void PVHfollow(RsGxsGroupId &groupId) = 0;
virtual void PVHrate(RsGxsId &authorId) = 0;
};
class PulseDataInterface
{
public:
virtual ~PulseDataInterface() {}
protected:
// Group
virtual void setHeadshot(const QPixmap &pixmap) = 0;
virtual void setGroupNameString(QString name) = 0;
virtual void setAuthorString(QString name) = 0;
// Msg
virtual void setRefMessage(QString msg, uint32_t image_count) = 0;
virtual void setMessage(RsWirePulseSPtr pulse) = 0;
virtual void setDateString(QString date) = 0;
// Refs
virtual void setLikesString(QString likes) = 0;
virtual void setRepublishesString(QString repub) = 0;
virtual void setRepliesString(QString reply) = 0;
//
virtual void setReferenceString(QString ref) = 0;
virtual void showResponseStats(bool enable) = 0;
};
class PulseViewItem : public QWidget
{
Q_OBJECT
public:
PulseViewItem(PulseViewHolder *holder);
protected:
PulseViewHolder *mHolder;
};
class PulseDataItem : public PulseViewItem, public PulseDataInterface
{
Q_OBJECT
public:
PulseDataItem(PulseViewHolder *holder, RsWirePulseSPtr pulse);
private slots:
// Action interfaces --------------------------
void actionReply();
void actionRepublish();
void actionLike();
void actionViewGroup();
void actionViewParent();
void actionViewPulse();
void actionFollow();
void actionRate();
// Action interfaces --------------------------
protected:
// top-level set data onto UI.
virtual void showPulse();
// UI elements.
// Group
void setGroupName(std::string name);
void setAuthor(std::string name);
// Msg
void setDate(rstime_t date);
// Refs
void setLikes(uint32_t count);
void setRepublishes(uint32_t count);
void setReplies(uint32_t count);
//
void setReference(uint32_t flags, RsGxsGroupId groupId, std::string groupName);
// DATA.
RsWirePulseSPtr mPulse;
};
// utilities.
QString BoldString(QString input);
QString ToNumberUnits(uint32_t count);
#endif

View File

@ -23,6 +23,11 @@
#include "WireGroupDialog.h"
#include "WireGroupItem.h"
#include "PulseViewGroup.h"
#include "PulseReplySeperator.h"
#include "util/qtthreadsutils.h"
#include <retroshare/rspeers.h>
#include <retroshare/rswire.h>
@ -74,6 +79,9 @@ WireDialog::WireDialog(QWidget *parent)
mWireQueue = new TokenQueue(rsWire->getTokenService(), this);
requestGroupData();
// just for testing
postTestTwitterView();
}
void WireDialog::refreshGroups()
@ -96,6 +104,18 @@ void WireDialog::deletePulseItem(PulseItem * /* item */, uint32_t /* type */)
// Actions from PulseHolder.
void WireDialog::focus(RsGxsGroupId &groupId, RsGxsMessageId &msgId)
{
std::cerr << "WireDialog::focus(";
std::cerr << groupId.toStdString() << ",";
std::cerr << msgId.toStdString();
std::cerr << ")";
std::cerr << std::endl;
showPulseFocus(groupId, msgId);
}
void WireDialog::follow(RsGxsGroupId &groupId)
{
std::cerr << "WireDialog::follow(";
@ -581,6 +601,9 @@ bool WireDialog::loadPulseData(const uint32_t &token)
std::vector<RsWirePulse> pulses;
rsWire->getPulseData(token, pulses);
std::cerr << "WireDialog::loadPulseData() pulses.size(): " << pulses.size();
std::cerr << std::endl;
std::list<RsWirePulse *> references;
std::map<RsGxsMessageId, PulseReplySet> pulseGrouping;
@ -596,7 +619,7 @@ bool WireDialog::loadPulseData(const uint32_t &token)
for(; vit != pulses.end(); vit++)
{
RsWirePulse& pulse = *vit;
if (pulse.mPulseType & WIRE_PULSE_TYPE_REPLY_REFERENCE)
if (pulse.mPulseType & WIRE_PULSE_TYPE_REFERENCE)
{
// store references to add in later.
std::cerr << "WireDialog::loadPulseData() REF: GroupId: " << pulse.mMeta.mGroupId;
@ -787,3 +810,299 @@ void WireDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
/**************************** Request / Response Filling of Data ************************/
/****************************************************************************************/
// TWITTER VIEW.
/****************************************************************************************/
// TODO
// - Handle Groups
// - Add GroupPtr to WirePulseSPtrs (DONE)
// - Add HeadShot to WireGroup
// - Add GxsIdLabel to Pulse UI elements.
//
// - Create Groups.
// - Add HeadShot
//
// - Create Pulse.
// - Add Images.
//
// - Link up Reply / Republish / Like.
//
// - showGroupFocus
// - TODO
//
// - showPulseFocus
// - Basics (DONE).
// - MoreReplies
// - Show Actual Message.
//
// - showReplyFocus
// - TODO
// PulseDataItem interface
// Actions.
void WireDialog::PVHreply(RsWirePulse &pulse, std::string &groupName)
{
std::cerr << "WireDialog::PVHreply() TODO";
std::cerr << std::endl;
}
void WireDialog::PVHrepublish(RsWirePulse &pulse, std::string &groupName)
{
std::cerr << "WireDialog::PVHrepublish() TODO";
std::cerr << std::endl;
}
void WireDialog::PVHlike(RsWirePulse &pulse, std::string &groupName)
{
std::cerr << "WireDialog::PVHlike() TODO";
std::cerr << std::endl;
}
void WireDialog::PVHviewGroup(RsGxsGroupId &groupId)
{
std::cerr << "WireDialog::PVHviewGroup(";
std::cerr << groupId.toStdString();
std::cerr << ")";
std::cerr << std::endl;
showGroupFocus(groupId);
}
void WireDialog::PVHviewPulse(RsGxsGroupId &groupId, RsGxsMessageId &msgId)
{
std::cerr << "WireDialog::PVHviewPulse(";
std::cerr << groupId.toStdString() << ",";
std::cerr << msgId.toStdString();
std::cerr << ")";
std::cerr << std::endl;
showPulseFocus(groupId, msgId);
}
void WireDialog::PVHviewReply(RsGxsGroupId &groupId, RsGxsMessageId &msgId)
{
std::cerr << "WireDialog::PVHviewReply(";
std::cerr << groupId.toStdString() << ",";
std::cerr << msgId.toStdString();
std::cerr << ")";
std::cerr << std::endl;
// showPulseFocus(groupId, msgId);
}
void WireDialog::PVHfollow(RsGxsGroupId &groupId)
{
std::cerr << "WireDialog::PVHfollow(";
std::cerr << groupId.toStdString();
std::cerr << ") TODO";
std::cerr << std::endl;
}
void WireDialog::PVHrate(RsGxsId &authorId)
{
std::cerr << "WireDialog::PVHrate(";
std::cerr << authorId.toStdString();
std::cerr << ") TODO";
std::cerr << std::endl;
}
void WireDialog::postTestTwitterView()
{
clearTwitterView();
addTwitterView(new PulseTopLevel(NULL,RsWirePulseSPtr()));
addTwitterView(new PulseReply(NULL,RsWirePulseSPtr()));
addTwitterView(new PulseReply(NULL,RsWirePulseSPtr()));
addTwitterView(new PulseReply(NULL,RsWirePulseSPtr()));
addTwitterView(new PulseReply(NULL,RsWirePulseSPtr()));
addTwitterView(new PulseReply(NULL,RsWirePulseSPtr()));
}
void WireDialog::clearTwitterView()
{
std::cerr << "WireDialog::clearTwitterView()";
std::cerr << std::endl;
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
QLayoutItem *item;
int i = 0;
while (i < alayout->count())
{
item = alayout->itemAt(i);
QWidget *widget = item->widget();
if (NULL != dynamic_cast<PulseViewItem *>(widget))
{
std::cerr << "WireDialog::clearTwitterView() Removing Item at: " << i;
std::cerr << std::endl;
item = alayout->takeAt(i);
delete item->widget();
delete item;
}
else
{
std::cerr << "WireDialog::clearTwitterView() Leaving Item at: " << i;
std::cerr << std::endl;
i++;
}
}
}
void WireDialog::addTwitterView(PulseViewItem *item)
{
std::cerr << "WireDialog::addTwitterView()";
std::cerr << std::endl;
/* ensure its a boxlayout */
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
QBoxLayout *boxlayout = dynamic_cast<QBoxLayout *>(alayout);
if (boxlayout == NULL) {
std::cerr << "WireDialog::addTwitterView() ERROR not boxlayout, not Inserting";
std::cerr << std::endl;
return;
}
// inserting as last item.
std::cerr << "WireDialog::addTwitterView() Inserting at end";
std::cerr << std::endl;
boxlayout->addWidget(item);
}
void WireDialog::showPulseFocus(const RsGxsGroupId groupId, const RsGxsMessageId msgId)
{
clearTwitterView();
// background thread for loading.
RsThread::async([this, groupId, msgId]()
{
// fetch data from backend.
RsWirePulseSPtr pPulse;
int type = 0;
bool success = rsWire->getPulseFocus(groupId, msgId, type, pPulse);
sleep(2);
/* now insert the pulse + children into the layput */
RsQThreadUtils::postToObject([pPulse,this]()
{
/* Here it goes any code you want to be executed on the Qt Gui
* thread, for example to update the data model with new information
* after a blocking call to RetroShare API complete */
postPulseFocus(pPulse);
}, this);
});
}
void WireDialog::postPulseFocus(RsWirePulseSPtr pPulse)
{
clearTwitterView();
if (!pPulse)
{
std::cerr << "WireDialog::postPulseFocus() Invalid pulse";
std::cerr << std::endl;
return;
}
addTwitterView(new PulseTopLevel(this, pPulse));
std::list<RsWirePulseSPtr>::iterator it;
for(it = pPulse->mReplies.begin(); it != pPulse->mReplies.end(); it++)
{
RsWirePulseSPtr reply = *it;
PulseReply *firstReply = new PulseReply(this, reply);
addTwitterView(firstReply);
if (reply->mReplies.size() > 0)
{
PulseReply *secondReply = new PulseReply(this, reply->mReplies.front());
addTwitterView(secondReply);
firstReply->showReplyLine(true);
secondReply->showReplyLine(false);
}
else
{
firstReply->showReplyLine(false);
}
if (reply->mReplies.size() > 1)
{
// addTwitterView(new PulseMoreReplies(NULL, reply));
}
addTwitterView(new PulseReplySeperator());
}
}
void WireDialog::showGroupFocus(const RsGxsGroupId groupId)
{
clearTwitterView();
// background thread for loading.
RsThread::async([this, groupId]()
{
// fetch data from backend.
RsWireGroupSPtr grp;
std::list<RsWirePulseSPtr> pulses;
bool success = rsWire->getWireGroup(groupId, grp);
std::list<RsGxsGroupId> groupIds = { groupId };
success = rsWire->getPulsesForGroups(groupIds, pulses);
sleep(2);
/* now insert the pulse + children into the layput */
RsQThreadUtils::postToObject([grp, pulses,this]()
{
/* Here it goes any code you want to be executed on the Qt Gui
* thread, for example to update the data model with new information
* after a blocking call to RetroShare API complete */
postGroupFocus(grp, pulses);
}, this);
});
}
void WireDialog::postGroupFocus(RsWireGroupSPtr group, std::list<RsWirePulseSPtr> pulses)
{
std::cerr << "WireDialog::postGroupFocus()";
std::cerr << std::endl;
if (!group)
{
std::cerr << "WireDialog::postGroupFocus() group is INVALID";
std::cerr << std::endl;
return;
}
addTwitterView(new PulseViewGroup(this, group));
std::list<RsWirePulseSPtr>::iterator it;
for(it = pulses.begin(); it != pulses.end(); it++)
{
RsWirePulseSPtr reply = *it;
PulseReply *firstReply = new PulseReply(this, reply);
addTwitterView(firstReply);
firstReply->showReplyLine(false);
addTwitterView(new PulseReplySeperator());
}
}

View File

@ -32,11 +32,16 @@
#include "gui/TheWire/WireGroupItem.h"
#include "gui/TheWire/PulseAddDialog.h"
#include "gui/TheWire/PulseViewItem.h"
#include "gui/TheWire/PulseTopLevel.h"
#include "gui/TheWire/PulseReply.h"
#include "util/TokenQueue.h"
#define IMAGE_WIRE ":/icons/wire.png"
class WireDialog : public MainPage, public TokenResponse, public PulseHolder, public WireGroupHolder
class WireDialog : public MainPage, public TokenResponse, public PulseHolder, public WireGroupHolder, public PulseViewHolder
{
Q_OBJECT
@ -51,15 +56,38 @@ public:
virtual void deletePulseItem(PulseItem *, uint32_t type);
virtual void notifyPulseSelection(PulseItem *item);
virtual void follow(RsGxsGroupId &groupId);
virtual void rate(RsGxsId &authorId);
virtual void reply(RsWirePulse &pulse, std::string &groupName);
virtual void focus(RsGxsGroupId &groupId, RsGxsMessageId &msgId) override;
virtual void follow(RsGxsGroupId &groupId) override;
virtual void rate(RsGxsId &authorId) override;
virtual void reply(RsWirePulse &pulse, std::string &groupName) override;
// WireGroupHolder interface.
virtual void subscribe(RsGxsGroupId &groupId);
virtual void unsubscribe(RsGxsGroupId &groupId);
virtual void notifyGroupSelection(WireGroupItem *item);
virtual void subscribe(RsGxsGroupId &groupId) override;
virtual void unsubscribe(RsGxsGroupId &groupId) override;
virtual void notifyGroupSelection(WireGroupItem *item) override;
// PulseViewItem interface
virtual void PVHreply(RsWirePulse &pulse, std::string &groupName) override;
virtual void PVHrepublish(RsWirePulse &pulse, std::string &groupName) override;
virtual void PVHlike(RsWirePulse &pulse, std::string &groupName) override;
virtual void PVHviewGroup(RsGxsGroupId &groupId) override;
virtual void PVHviewPulse(RsGxsGroupId &groupId, RsGxsMessageId &msgId) override;
virtual void PVHviewReply(RsGxsGroupId &groupId, RsGxsMessageId &msgId) override;
virtual void PVHfollow(RsGxsGroupId &groupId) override;
virtual void PVHrate(RsGxsId &authorId) override;
// New TwitterView
void postTestTwitterView();
void clearTwitterView();
void addTwitterView(PulseViewItem *item);
void showPulseFocus(const RsGxsGroupId groupId, const RsGxsMessageId msgId);
void postPulseFocus(RsWirePulseSPtr pulse);
void showGroupFocus(const RsGxsGroupId groupId);
void postGroupFocus(RsWireGroupSPtr group, std::list<RsWirePulseSPtr> pulses);
private slots:
@ -85,7 +113,7 @@ private:
void showSelectedGroups();
void updateGroups(std::vector<RsWireGroup> &groups);
// utils.
// utils.
rstime_t getFilterTimestamp();
// Loading Data.

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>726</width>
<height>557</height>
<width>804</width>
<height>586</height>
</rect>
</property>
<property name="sizePolicy">
@ -215,118 +215,24 @@
</item>
</layout>
</widget>
<widget class="QFrame" name="frame_2">
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>3</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<property name="currentIndex">
<number>0</number>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QWidget" name="widget_range" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Show Posts from </string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_filterTime">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string> All Time</string>
</property>
</item>
<item>
<property name="text">
<string>Last 24 hours</string>
</property>
</item>
<item>
<property name="text">
<string>Last 7 days</string>
</property>
</item>
<item>
<property name="text">
<string>Last 30 days</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<height>443</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<widget class="QWidget" name="tabWidget_Page1" native="true">
<attribute name="title">
<string>Orig View</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QWidget" name="widget_range" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
@ -343,23 +249,179 @@
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Show Posts from </string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_filterTime">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string> All Time</string>
</property>
</item>
<item>
<property name="text">
<string>Last 24 hours</string>
</property>
</item>
<item>
<property name="text">
<string>Last 7 days</string>
</property>
</item>
<item>
<property name="text">
<string>Last 30 days</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>508</width>
<height>435</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Fancy View</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QScrollArea" name="scrollArea_3">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>508</width>
<height>466</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QWidget#scrollAreaWidgetContents{border: none;}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>

View File

@ -95,9 +95,11 @@ QPixmap WireGroupDialog::serviceImage()
void WireGroupDialog::prepareWireGroup(RsWireGroup &group, const RsGroupMetaData &meta)
{
group.mMeta = meta;
group.mDescription = getDescription().toUtf8().constData();
#if 0
// To Add.
group.mTagline = "a Tagline";
group.mLocation = "here";
QPixmap pixmap = getLogo();
if (!pixmap.isNull()) {
@ -107,11 +109,12 @@ void WireGroupDialog::prepareWireGroup(RsWireGroup &group, const RsGroupMetaData
buffer.open(QIODevice::WriteOnly);
pixmap.save(&buffer, "PNG"); // writes image into ba in PNG format
group.mThumbnail.copy((uint8_t *) ba.data(), ba.size());
group.mHeadshot.copy((uint8_t *) ba.data(), ba.size());
group.mMasthead.copy((uint8_t *) ba.data(), ba.size());
} else {
group.mThumbnail.clear();
group.mHeadshot.clear();
group.mMasthead.clear();
}
#endif
}
@ -152,7 +155,7 @@ bool WireGroupDialog::service_loadGroup(const RsGxsGenericGroupData *data, Mode
}
const RsWireGroup &group = *pgroup;
description = QString::fromUtf8(group.mDescription.c_str());
// description = QString::fromUtf8(group.mDescription.c_str());
#if 0
if (group.mThumbnail.mData) {

View File

@ -1227,12 +1227,23 @@ gxsthewire {
gui/TheWire/WireGroupItem.h \
gui/TheWire/WireGroupDialog.h \
gui/TheWire/PulseAddDialog.h \
gui/TheWire/PulseViewItem.h \
gui/TheWire/PulseTopLevel.h \
gui/TheWire/PulseViewGroup.h \
gui/TheWire/PulseReply.h \
gui/TheWire/PulseReplySeperator.h \
gui/TheWire/PulseMessage.h \
FORMS += gui/TheWire/PulseItem.ui \
gui/TheWire/PulseDetails.ui \
gui/TheWire/WireGroupItem.ui \
gui/TheWire/WireDialog.ui \
gui/TheWire/PulseAddDialog.ui \
gui/TheWire/PulseTopLevel.ui \
gui/TheWire/PulseViewGroup.ui \
gui/TheWire/PulseReply.ui \
gui/TheWire/PulseReplySeperator.ui \
gui/TheWire/PulseMessage.ui \
SOURCES += gui/TheWire/PulseItem.cpp \
gui/TheWire/PulseDetails.cpp \
@ -1240,6 +1251,12 @@ gxsthewire {
gui/TheWire/WireGroupItem.cpp \
gui/TheWire/WireGroupDialog.cpp \
gui/TheWire/PulseAddDialog.cpp \
gui/TheWire/PulseViewItem.cpp \
gui/TheWire/PulseTopLevel.cpp \
gui/TheWire/PulseViewGroup.cpp \
gui/TheWire/PulseReply.cpp \
gui/TheWire/PulseReplySeperator.cpp \
gui/TheWire/PulseMessage.cpp \
RESOURCES += gui/TheWire/TheWire_images.qrc
}