Added attach picture for posted links

This commit is contained in:
defnax 2019-01-30 14:33:50 +01:00
parent d63655c9b6
commit 7cf17569c5
18 changed files with 993 additions and 363 deletions

View File

@ -25,10 +25,12 @@
#include <inttypes.h>
#include <string>
#include <list>
#include <functional>
#include "retroshare/rstokenservice.h"
#include "retroshare/rsgxsifacehelper.h"
#include "retroshare/rsgxscommon.h"
#include "serialiser/rsserializable.h"
/* The Main Interface Class - for information about your Posted */
class RsPosted;
@ -42,6 +44,7 @@ class RsPostedGroup
RsGroupMetaData mMeta;
std::string mDescription;
};
@ -52,7 +55,7 @@ class RsPostedGroup
#define RSPOSTED_PERIOD_YEAR 1
#define RSPOSTED_PERIOD_MONTH 2
#define RSPOSTED_PERIOD_WEEK 3
#define RSPOSTED_PERIOD_DAY 4
#define RSPOSTED_PERIOD_DAY 4
#define RSPOSTED_PERIOD_HOUR 5
#define RSPOSTED_VIEWMODE_LATEST 1
@ -102,7 +105,6 @@ virtual bool updateGroup(uint32_t &token, RsPostedGroup &group) = 0;
};
class RsPostedPost
{
public:
@ -137,6 +139,24 @@ class RsPostedPost
double mHotScore;
double mTopScore;
double mNewScore;
RsGxsImage mImage;
/// @see RsSerializable
/*virtual void serial_process( RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx )
{
RS_SERIAL_PROCESS(mImage);
RS_SERIAL_PROCESS(mMeta);
RS_SERIAL_PROCESS(mLink);
RS_SERIAL_PROCESS(mHaveVoted);
RS_SERIAL_PROCESS(mUpVotes);
RS_SERIAL_PROCESS(mDownVotes);
RS_SERIAL_PROCESS(mComments);
RS_SERIAL_PROCESS(mHotScore);
RS_SERIAL_PROCESS(mTopScore);
RS_SERIAL_PROCESS(mNewScore);
}*/
};

View File

@ -22,15 +22,18 @@
#include "rsitems/rsposteditems.h"
#include "serialiser/rstypeserializer.h"
void RsGxsPostedPostItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
{
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_LINK,mPost.mLink,"mPost.mLink") ;
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_MSG ,mPost.mNotes,"mPost.mNotes") ;
RsTypeSerializer::serial_process<RsTlvItem>(j,ctx,mImage,"mImage") ;
}
void RsGxsPostedGroupItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
{
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_DESCR ,mGroup.mDescription,"mGroup.mDescription") ;
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_DESCR ,mGroup.mDescription,"mGroup.mDescription") ;
}
RsItem *RsGxsPostedSerialiser::create_item(uint16_t service_id,uint8_t item_subtype) const
@ -47,12 +50,54 @@ RsItem *RsGxsPostedSerialiser::create_item(uint16_t service_id,uint8_t item_subt
}
}
bool RsGxsPostedPostItem::fromPostedPost(RsPostedPost &post, bool moveImage)
{
clear();
mPost = post;
meta = post.mMeta;
if (moveImage)
{
mImage.binData.bin_data = post.mImage.mData;
mImage.binData.bin_len = post.mImage.mSize;
post.mImage.shallowClear();
}
else
{
mImage.binData.setBinData(post.mImage.mData, post.mImage.mSize);
}
return true;
}
bool RsGxsPostedPostItem::toPostedPost(RsPostedPost &post, bool moveImage)
{
post = mPost;
post.mMeta = meta;
if (moveImage)
{
post.mImage.take((uint8_t *) mImage.binData.bin_data, mImage.binData.bin_len);
// mImage doesn't have a ShallowClear at the moment!
mImage.binData.TlvShallowClear();
}
else
{
post.mImage.copy((uint8_t *) mImage.binData.bin_data, mImage.binData.bin_len);
}
return true;
}
void RsGxsPostedPostItem::clear()
{
mPost.mLink.clear();
mPost.mNotes.clear();
mImage.TlvClear();
}
void RsGxsPostedGroupItem::clear()
{
mGroup.mDescription.clear();
}

View File

@ -25,6 +25,7 @@
#include "rsitems/rsserviceids.h"
#include "rsitems/rsgxscommentitems.h"
#include "rsitems/rsgxsitems.h"
#include "serialiser/rstlvimage.h"
#include "retroshare/rsposted.h"
@ -38,9 +39,12 @@ public:
virtual ~RsGxsPostedGroupItem() {}
void clear();
virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
RsPostedGroup mGroup;
};
class RsGxsPostedPostItem : public RsGxsMsgItem
@ -51,8 +55,14 @@ public:
void clear();
virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
// Slightly unusual structure.
// use conversion functions to transform:
bool fromPostedPost(RsPostedPost &post, bool moveImage);
bool toPostedPost(RsPostedPost &post, bool moveImage);
RsPostedPost mPost;
RsTlvImage mImage;
};
class RsGxsPostedSerialiser : public RsGxsCommentSerialiser

View File

@ -123,6 +123,7 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
{
RsPostedPost msg = postItem->mPost;
msg.mMeta = postItem->meta;
postItem->toPostedPost(msg, true);
msg.calculateScores(now);
msgs.push_back(msg);
@ -291,8 +292,10 @@ bool p3Posted::createPost(uint32_t &token, RsPostedPost &msg)
std::cerr << std::endl;
RsGxsPostedPostItem* msgItem = new RsGxsPostedPostItem();
msgItem->mPost = msg;
msgItem->meta = msg.mMeta;
//msgItem->mPost = msg;
//msgItem->meta = msg.mMeta;
msgItem->fromPostedPost(msg, true);
RsGenExchange::publishMsg(token, msgItem);
return true;

View File

@ -18,13 +18,16 @@
* *
*******************************************************************************/
#include <QBuffer>
#include <QMessageBox>
#include "PostedCreatePostDialog.h"
#include "ui_PostedCreatePostDialog.h"
#include "util/misc.h"
#include "util/TokenQueue.h"
#include "gui/settings/rsharesettings.h"
#include <QBuffer>
#include <iostream>
@ -37,6 +40,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos
Settings->loadWidgetInformation(this);
connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(ui->pushButton, SIGNAL(clicked() ), this , SLOT(addPicture()));
ui->headerFrame->setHeaderImage(QPixmap(":/images/posted_64.png"));
ui->headerFrame->setHeaderText(tr("Submit a new Post"));
@ -78,6 +82,18 @@ void PostedCreatePostDialog::createPost()
post.mMeta.mMsgName = std::string(ui->titleEdit->text().toUtf8());
post.mMeta.mAuthorId = authorId;
QByteArray ba;
QBuffer buffer(&ba);
if(!picture.isNull())
{
// send posted image
buffer.open(QIODevice::WriteOnly);
picture.save(&buffer, "PNG"); // writes image into ba in PNG format
post.mImage.copy((uint8_t *) ba.data(), ba.size());
}
if(ui->titleEdit->text().isEmpty()) {
/* error message */
QMessageBox::warning(this, "RetroShare", tr("Please add a Title"), QMessageBox::Ok, QMessageBox::Ok);
@ -90,3 +106,16 @@ void PostedCreatePostDialog::createPost()
accept();
}
void PostedCreatePostDialog::addPicture()
{
QPixmap img = misc::getOpenThumbnailedPicture(this, tr("Load thumbnail picture"), 800, 600);
if (img.isNull())
return;
picture = img;
// to show the selected
ui->imageLabel->setPixmap(picture);
}

View File

@ -41,9 +41,13 @@ public:
*/
explicit PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted* posted, const RsGxsGroupId& grpId, QWidget *parent = 0);
~PostedCreatePostDialog();
QPixmap picture;
private slots:
void createPost();
void addPicture();
private:
QString mLink;

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>575</width>
<height>371</height>
<height>467</height>
</rect>
</property>
<property name="windowTitle">
@ -47,7 +47,7 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="mainFrameGLayout">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="StyledLabel" name="info_label">
<property name="palette">
@ -128,75 +128,108 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QGridLayout" name="titleGLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="titleEdit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="linkLabel">
<property name="text">
<string>Link</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="linkEdit"/>
</item>
</layout>
</item>
<item row="2" column="0" colspan="3">
<layout class="QHBoxLayout" name="signedHLayout">
<item>
<spacer name="signedHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>78</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="signedLabel">
<property name="text">
<string>Signed by: </string>
</property>
</widget>
</item>
<item>
<widget class="GxsIdChooser" name="idChooser"/>
</item>
</layout>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Picture</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>447</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Add Picture</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Preview</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1">
<widget class="QLabel" name="imageLabel">
<property name="minimumSize">
<size>
<width>250</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>800</width>
<height>200</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<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 row="0" column="2">
<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>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Notes</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="MimeTextEdit" name="notesTextEdit"/>
</item>
</layout>
</widget>
</widget>
</item>
<item row="3" column="0" colspan="3">
<layout class="QVBoxLayout" name="notesLayout">
<item>
<widget class="QLabel" name="notesLabel">
<property name="text">
<string>Notes</string>
</property>
</widget>
</item>
<item>
<widget class="MimeTextEdit" name="notesTextEdit"/>
</item>
</layout>
</item>
<item row="4" column="0">
<item row="3" column="0">
<spacer name="buttonHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -209,14 +242,20 @@
</property>
</spacer>
</item>
<item row="4" column="1">
<item row="3" column="1">
<widget class="QPushButton" name="submitButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Submit</string>
</property>
</widget>
</item>
<item row="4" column="2">
<item row="3" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -232,12 +271,51 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QGridLayout" name="titleGLayout">
<item row="0" column="0">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="titleEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="linkLabel">
<property name="text">
<string>Link</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="linkEdit"/>
</item>
<item row="2" column="1">
<widget class="GxsIdChooser" name="idChooser"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="signedLabel">
<property name="text">
<string>Post as</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
<customwidget>
<class>HeaderFrame</class>
<extends>QFrame</extends>
@ -254,11 +332,6 @@
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>

View File

@ -24,6 +24,8 @@
#include "rshare.h"
#include "PostedItem.h"
#include "gui/feeds/FeedHolder.h"
#include "util/misc.h"
#include "ui_PostedItem.h"
#include <retroshare/rsposted.h>
@ -83,6 +85,7 @@ void PostedItem::setup()
ui->fromLabel->clear();
ui->siteLabel->clear();
ui->newCommentLabel->hide();
ui->frame_picture->hide();
ui->commLabel->hide();
/* general ones */
@ -94,6 +97,7 @@ void PostedItem::setup()
connect(ui->commentButton, SIGNAL( clicked()), this, SLOT(loadComments()));
connect(ui->voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote()));
connect(ui->voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote()));
connect(ui->expandButton, SIGNAL(clicked()), this, SLOT( toggle()));
connect(ui->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool)));
@ -206,7 +210,7 @@ void PostedItem::loadComment(const uint32_t &token)
if (comNb == 1) {
sComButText = sComButText.append("(1)");
} else if (comNb > 1) {
sComButText = tr("Comments").append("(%1)").arg(comNb);
sComButText = tr("Comments").append(" (%1)").arg(comNb);
}
ui->commentButton->setText(sComButText);
}
@ -219,11 +223,29 @@ void PostedItem::fill()
}
mInFill = true;
if(mPost.mImage.mData != NULL)
{
QPixmap pixmap;
pixmap.loadFromData(mPost.mImage.mData, mPost.mImage.mSize, "PNG");
// Wiping data - as its been passed to thumbnail.
QPixmap sqpixmap = pixmap.scaled(800, 600, Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->pictureLabel->setPixmap(sqpixmap);
ui->thumbnailLabel->setPixmap(pixmap);
}else
{
ui->expandButton->setDisabled(true);
}
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
ui->dateLabel->setText(timestamp);
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);
ui->dateLabel->setToolTip(timestamp);
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
// Use QUrl to check/parse our URL
@ -256,9 +278,14 @@ void PostedItem::fill()
QString siteurl = url.scheme() + "://" + url.host();
sitestr = QString("<a href=\"%1\" ><span style=\" text-decoration: underline; color:#2255AA;\"> %2 </span></a>").arg(siteurl).arg(siteurl);
ui->titleLabel->setText(urlstr);
}else
{
ui->titleLabel->setText(messageName());
}
ui->titleLabel->setText(urlstr);
ui->siteLabel->setText(sitestr);
//QString score = "Hot" + QString::number(post.mHotScore);
@ -451,3 +478,27 @@ void PostedItem::readAndClearItem()
readToggled(false);
removeItem();
}
void PostedItem::toggle()
{
expand(ui->frame_picture->isHidden());
}
void PostedItem::doExpand(bool open)
{
if (open)
{
ui->frame_picture->show();
ui->expandButton->setIcon(QIcon(QString(":/images/decrease.png")));
ui->expandButton->setToolTip(tr("Hide"));
}
else
{
ui->frame_picture->hide();
ui->expandButton->setIcon(QIcon(QString(":/images/expand.png")));
ui->expandButton->setToolTip(tr("Expand"));
}
emit sizeChanged(this);
}

View File

@ -50,7 +50,7 @@ public:
protected:
/* FeedItem */
virtual void doExpand(bool /*open*/) {}
virtual void doExpand(bool open);
private slots:
void loadComments();
@ -58,6 +58,7 @@ private slots:
void makeDownVote();
void readToggled(bool checked);
void readAndClearItem();
void toggle();
signals:
void vote(const RsGxsGrpMsgIdPair& msgId, bool up);

View File

@ -6,15 +6,33 @@
<rect>
<x>0</x>
<y>0</y>
<width>765</width>
<height>230</height>
<width>617</width>
<height>190</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="PostedItemVLayout">
<item>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="mainFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -23,7 +41,7 @@
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
@ -31,44 +49,178 @@
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QVBoxLayout" name="mainFrameVLayout">
<item>
<widget class="StyledLabel" name="titleLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<layout class="QGridLayout" name="gridLayout_2">
<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>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0" rowspan="2">
<widget class="QFrame" name="voteFrame">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string notr="true">This is a very very very very loooooooooooooooonnnnnnnnnnnnnnnnng title don't you think? Yes it is and should wrap around I hope</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QToolButton" name="voteUpButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Vote up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/up-arrow.png</normaloff>:/images/up-arrow.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="StyledLabel" name="scoreLabel">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="voteDownButton">
<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="toolTip">
<string>Vote down</string>
</property>
<property name="text">
<string>\/</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/down-arrow.png</normaloff>:/images/down-arrow.png</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="newCommHLayout">
<item row="0" column="1" rowspan="2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="topMargin">
<number>0</number>
<number>6</number>
</property>
<item>
<widget class="QLabel" name="newCommentLabel">
<widget class="QLabel" name="thumbnailLabel">
<property name="minimumSize">
<size>
<width>100</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>75</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>New Comment:</string>
<string/>
</property>
<property name="pixmap">
<pixmap resource="Posted_images.qrc">:/images/thumb-default.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
@ -76,255 +228,392 @@
</widget>
</item>
<item>
<widget class="ElidedLabel" name="commLabel">
<property name="text">
<string>Comment Value</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="buttonHLayout">
<item>
<widget class="StyledLabel" name="scoreLabel">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="voteUpButton">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Vote up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/vote_up.png</normaloff>:/images/vote_up.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="voteDownButton">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Vote down</string>
</property>
<property name="text">
<string>\/</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/vote_down.png</normaloff>:/images/vote_down.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="readButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Toggle Message Read Status</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/message-state-unread.png</normaloff>:/images/message-state-unread.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="newLabel">
<property name="text">
<string>New</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="commentButton">
<property name="text">
<string>Comments</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">You eyes only</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fromBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>By</string>
</property>
</widget>
</item>
<item>
<widget class="GxsIdLabel" name="fromLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">Signed by</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="siteBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Site</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="siteLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">Signed by</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>118</width>
<height>20</height>
<width>50</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="2">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="topMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="readAndClearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
<widget class="StyledLabel" name="titleLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Set as read and remove item</string>
<property name="text">
<string notr="true">This is a very very very very loooooooooooooooonnnnnnnnnnnnnnnnng title don't you think? Yes it is and should wrap around I hope</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/cancel.png</normaloff>:/images/cancel.png</iconset>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
<layout class="QHBoxLayout" name="newCommHLayout">
<property name="topMargin">
<number>0</number>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
<item>
<widget class="QLabel" name="newCommentLabel">
<property name="text">
<string>New Comment:</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ElidedLabel" name="commLabel">
<property name="text">
<string>Comment Value</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>3</number>
</property>
<property name="toolTip">
<string>Remove Item</string>
<property name="leftMargin">
<number>0</number>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
<property name="rightMargin">
<number>6</number>
</property>
</widget>
<item>
<widget class="QLabel" name="fromBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Posted by</string>
</property>
</widget>
</item>
<item>
<widget class="GxsIdLabel" name="fromLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">Signed by</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">You eyes only</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="siteBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Site</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="siteLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">site</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>70</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="buttonHLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QToolButton" name="expandButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/expand.png</normaloff>:/images/expand.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="readButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Toggle Message Read Status</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/message-state-unread.png</normaloff>:/images/message-state-unread.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="newLabel">
<property name="text">
<string>New</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="commentButton">
<property name="text">
<string>Comments</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/comments.png</normaloff>:/images/comments.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>118</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="readAndClearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Set as read and remove item</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/cancel.png</normaloff>:/images/cancel.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Remove Item</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/close_normal.png</normaloff>:/images/close_normal.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
<zorder>titleLabel</zorder>
</widget>
</item>
<item>
<item row="1" column="0">
<widget class="QFrame" name="frame_picture">
<property name="maximumSize">
<size>
<width>800</width>
<height>600</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>257</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="pictureLabel">
<property name="text">
<string>TextLabel</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>257</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="frame_notes">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@ -333,7 +622,16 @@
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<property name="spacing">
@ -374,6 +672,7 @@
</customwidgets>
<resources>
<include location="../images.qrc"/>
<include location="Posted_images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -11,5 +11,11 @@
<file>images/hot_24.png</file>
<file>images/new_24.png</file>
<file>images/posted_32_new.png</file>
<file>images/expand.png</file>
<file>images/decrease.png</file>
<file>images/down-arrow.png</file>
<file>images/up-arrow.png</file>
<file>images/comments.png</file>
<file>images/thumb-default.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -119,18 +119,9 @@ GxsCreateCommentDialog QFrame#frame {
/* Forums */
ForumsDialog QLabel#forumName, ForumsDialog QLabel#threadTitle
GxsForumThreadWidget QLabel#forumName
{
border: 2px solid #CCCCCC;
border-radius:6px;
background: white;
}
ForumsDialog2 QLabel#forumName, ForumsDialog2 QLabel#threadTitle
{
border: 2px solid #CCCCCC;
border-radius:6px;
background: white;
font: bold;
}
CreateForumMsg > QToolBar#toolBar, CreateForumV2Msg > QToolBar#toolBar {
@ -677,14 +668,6 @@ IdDialog QFrame#inviteFrame {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}
GxsChannelPostsWidget QFrame#infoFrame
{
border: 1px solid #DCDC41;
border-radius: 6px;
background: #FFFFD7;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}
IdEditDialog QLabel#info_label
{
border: 1px solid #DCDC41;
@ -822,3 +805,109 @@ PostedListWidget QToolButton#submitPostButton {
font: bold;
font-size: 15px;
}
PostedListWidget QToolButton#subscribeToolButton {
font: bold;
font-size: 15px;
color: white;
background: #0099cc;
border-radius: 4px;
}
PostedListWidget QToolButton#subscribeToolButton:hover {
background: #03b1f3;
border-radius: 4px;
}
PostedListWidget QFrame#headerFrame {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;
}
GxsForumThreadWidget QToolButton#subscribeToolButton {
font: bold;
font-size: 14px;
color: white;
background: #0099cc;
border-radius: 4px;
}
GxsForumThreadWidget QToolButton#subscribeToolButton:hover {
background: #03b1f3;
border-radius: 4px;
}
GxsChannelPostsWidget QFrame#infoFrame
{
border: 1px solid #DCDC41;
border-radius: 6px;
background: #FFFFD7;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}
GxsChannelPostsWidget QToolButton#subscribeToolButton {
font: bold;
font-size: 14px;
color: white;
background: #0099cc;
border-radius: 4px;
}
GxsChannelPostsWidget QToolButton#subscribeToolButton:hover {
background: #03b1f3;
border-radius: 4px;
}
GxsChannelPostsWidget QToolButton#subscribeToolButton:pressed {
background: #03b1f3;
border-radius: 4px;
border: 1px solid gray;
}
GxsChannelPostsWidget QToolButton#subscribeToolButton:disabled {
background: gray;
border-radius: 4px;
border: 1px solid gray;
color: lightgray;
}
/* only for MenuButtonPopup */
GxsChannelPostsWidget QToolButton#subscribeToolButton[popupMode="1"] {
padding-right: 0px;
}
GxsChannelPostsWidget QToolButton#subscribeToolButton::menu-arrow {
image: none;
}
GxsChannelPostsWidget QToolButton#subscribeToolButton::menu-button {
image: none;
}
PostedItem QFrame#voteFrame {
background: #f8f9fa;
}
PostedItem QFrame#mainFrame{
background: white;
}
PostedItem QFrame#frame_picture{
background: white;
}
PostedItem QLabel#thumbnailLabel{
border: 2px solid #CCCCCC;
border-radius: 3px;
}
PostedItem QLabel#fromBoldLabel, QLabel#fromLabel, QLabel#dateLabel, QLabel#siteBoldLabel {
color: #787c7e;
}
PostedItem QToolButton#commentButton{
font-size: 12px;
color: #878a8c;
font-weight: bold;
}