mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed posted item serialisation (wrong way round)
cleaned up comments gui and added loading framework correctly initialisaed posted items git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5876 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4e63561473
commit
ebbe967402
@ -194,9 +194,8 @@ bool RsGxsPostedSerialiser::serialiseGxsPostedPostItem(RsGxsPostedPostItem* item
|
|||||||
|
|
||||||
/* GxsPhotoAlbumItem */
|
/* GxsPhotoAlbumItem */
|
||||||
|
|
||||||
ok &= SetTlvString(data, tlvsize, &offset, 1, item->mPost.mNotes);
|
|
||||||
ok &= SetTlvString(data, tlvsize, &offset, 1, item->mPost.mLink);
|
ok &= SetTlvString(data, tlvsize, &offset, 1, item->mPost.mLink);
|
||||||
|
ok &= SetTlvString(data, tlvsize, &offset, 1, item->mPost.mNotes);
|
||||||
|
|
||||||
if(offset != tlvsize)
|
if(offset != tlvsize)
|
||||||
{
|
{
|
||||||
|
@ -61,16 +61,13 @@
|
|||||||
PostedComments::PostedComments(QWidget *parent)
|
PostedComments::PostedComments(QWidget *parent)
|
||||||
:QWidget(parent)
|
:QWidget(parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
ui.postFrame->setVisible(false);
|
||||||
/* setup TokenQueue */
|
ui.treeWidget->setup(rsPosted->getTokenService());
|
||||||
//mPhotoQueue = new TokenQueue(rsPhoto, this);
|
|
||||||
|
|
||||||
ui.treeWidget->setup(rsPosted->getTokenService());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostedComments::loadComments( std::string threadId )
|
void PostedComments::loadComments(const RsGxsMessageId& threadId )
|
||||||
{
|
{
|
||||||
std::cerr << "PostedComments::loadComments(" << threadId << ")";
|
std::cerr << "PostedComments::loadComments(" << threadId << ")";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
@ -31,12 +31,9 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
//#include "gui/Posted/PostedItem.h"
|
#include "util/TokenQueue.h"
|
||||||
//#include "gui/PhotoShare/PhotoAddDialog.h"
|
|
||||||
//#include "gui/PhotoShare/PhotoSlideShow.h"
|
|
||||||
#include "util/TokenQueueVEG.h"
|
|
||||||
|
|
||||||
class PostedComments: public QWidget, public TokenResponseVEG
|
class PostedComments: public QWidget, public TokenResponse
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -44,75 +41,13 @@ public:
|
|||||||
PostedComments(QWidget *parent = 0);
|
PostedComments(QWidget *parent = 0);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void loadComments( std::string );
|
|
||||||
|
void loadComments(const RsGxsMessageId& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadRequest(const TokenQueueVEG *queue, const TokenRequestVEG &req) { return; }
|
void loadRequest(const TokenQueue *queue, const TokenRequest &req) { return; }
|
||||||
|
|
||||||
#if 0
|
TokenQueue *mPhotoQueue;
|
||||||
virtual void deletePhotoItem(PhotoItem *, uint32_t type);
|
|
||||||
virtual void notifySelection(PhotoItem *item, int ptype);
|
|
||||||
|
|
||||||
void notifyAlbumSelection(PhotoItem *item);
|
|
||||||
void notifyPhotoSelection(PhotoItem *item);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
void checkUpdate();
|
|
||||||
void OpenOrShowPhotoAddDialog();
|
|
||||||
void OpenPhotoEditDialog();
|
|
||||||
void OpenSlideShow();
|
|
||||||
private:
|
|
||||||
|
|
||||||
/* Request Response Functions for loading data */
|
|
||||||
void requestAlbumList();
|
|
||||||
void requestAlbumData(const std::list<std::string> &ids);
|
|
||||||
void requestPhotoList(const std::string &albumId);
|
|
||||||
void requestPhotoData(const std::list<std::string> &photoIds);
|
|
||||||
|
|
||||||
void loadAlbumList(const uint32_t &token);
|
|
||||||
bool loadAlbumData(const uint32_t &token);
|
|
||||||
void loadPhotoList(const uint32_t &token);
|
|
||||||
void loadPhotoData(const uint32_t &token);
|
|
||||||
|
|
||||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
|
||||||
|
|
||||||
|
|
||||||
/* TODO: These functions must be filled in for proper filtering to work
|
|
||||||
* and tied to the GUI input
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool matchesAlbumFilter(const RsPhotoAlbum &album);
|
|
||||||
double AlbumScore(const RsPhotoAlbum &album);
|
|
||||||
bool matchesPhotoFilter(const RsPhotoPhoto &photo);
|
|
||||||
double PhotoScore(const RsPhotoPhoto &photo);
|
|
||||||
|
|
||||||
/* Grunt work of setting up the GUI */
|
|
||||||
|
|
||||||
//bool FilterNSortAlbums(const std::list<std::string> &albumIds, std::list<std::string> &filteredAlbumIds, int count);
|
|
||||||
//bool FilterNSortPhotos(const std::list<std::string> &photoIds, std::list<std::string> &filteredPhotoIds, int count);
|
|
||||||
//void insertAlbums();
|
|
||||||
//void insertPhotosForAlbum(const std::list<std::string> &albumIds);
|
|
||||||
|
|
||||||
void insertPhotosForSelectedAlbum();
|
|
||||||
|
|
||||||
void addAlbum(const RsPhotoAlbum &album);
|
|
||||||
void addPhoto(const RsPhotoPhoto &photo);
|
|
||||||
|
|
||||||
void clearAlbums();
|
|
||||||
void clearPhotos();
|
|
||||||
|
|
||||||
PhotoAddDialog *mAddDialog;
|
|
||||||
PhotoSlideShow *mSlideShow;
|
|
||||||
|
|
||||||
PhotoItem *mAlbumSelected;
|
|
||||||
PhotoItem *mPhotoSelected;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TokenQueueVEG *mPhotoQueue;
|
|
||||||
|
|
||||||
/* UI - from Designer */
|
/* UI - from Designer */
|
||||||
Ui::PostedComments ui;
|
Ui::PostedComments ui;
|
||||||
|
@ -13,28 +13,294 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
|
<widget class="QFrame" name="postFrame">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</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_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="scoreLabel">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>20</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="voteUpButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>/\</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>score</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="voteDownButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>\/</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="titleLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Title this is a very very very very loooooooooooooooonnnnnnnnnnnnnnnnng title dont you think? yes it is and should wrap around I hope</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="dateBoldLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Date</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="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">You eyes only</string>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="_3">
|
||||||
|
<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>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>From</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="fromLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Signed by</string>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="fromBoldLabel_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<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="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Signed by</string>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_3">
|
<widget class="QGroupBox" name="sortGroup">
|
||||||
<property name="text">
|
<property name="checkable">
|
||||||
<string>Hot</string>
|
<bool>false</bool>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>New</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Top</string>
|
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="hotSortButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hot</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="newSortButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>New</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="topSortButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Top</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -59,46 +325,21 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="GxsCommentTreeWidget" name="treeWidget">
|
<widget class="GxsCommentTreeWidget" name="treeWidget">
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Stuff</string>
|
<string>Comment</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>New Column</string>
|
<string>Author</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Yes More</string>
|
<string>Points</string>
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>more, more, more</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>More Stuff</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Less Stuff</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>More</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>asdf</string>
|
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -15,6 +15,7 @@ void PostedCreatePostDialog::createPost()
|
|||||||
post.mMeta.mGroupId = mGrpId;
|
post.mMeta.mGroupId = mGrpId;
|
||||||
post.mLink = ui->linkEdit->text().toStdString();
|
post.mLink = ui->linkEdit->text().toStdString();
|
||||||
post.mNotes = ui->notesTextEdit->toPlainText().toStdString();
|
post.mNotes = ui->notesTextEdit->toPlainText().toStdString();
|
||||||
|
post.mMeta.mMsgName = ui->titleEdit->text().toStdString();
|
||||||
|
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
mPosted->submitPost(token, post);
|
mPosted->submitPost(token, post);
|
||||||
|
@ -7,13 +7,31 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>406</width>
|
<width>406</width>
|
||||||
<height>168</height>
|
<height>195</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Create Post</string>
|
<string>Create Post</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Title</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="titleEdit"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
|
@ -47,17 +47,22 @@
|
|||||||
PostedDialog::PostedDialog(QWidget *parent)
|
PostedDialog::PostedDialog(QWidget *parent)
|
||||||
: MainPage(parent)
|
: MainPage(parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
mPostedList = new PostedListDialog(NULL);
|
mPostedList = new PostedListDialog(NULL);
|
||||||
mPostedComments = new PostedComments(NULL);
|
mPostedComments = new PostedComments(NULL);
|
||||||
|
|
||||||
QString list("List");
|
QString list("List");
|
||||||
ui.tabWidget->addTab(mPostedList, list);
|
ui.tabWidget->addTab(mPostedList, list);
|
||||||
QString comments("Comments");
|
QString comments("Comments");
|
||||||
ui.tabWidget->addTab(mPostedComments, comments);
|
ui.tabWidget->addTab(mPostedComments, comments);
|
||||||
|
|
||||||
connect(mPostedList, SIGNAL(loadComments( std::string ) ), mPostedComments, SLOT(loadComments( std::string ) ) );
|
connect(mPostedList, SIGNAL(loadComments( std::string ) ), mPostedComments, SLOT(loadComments( std::string ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void PostedDialog::commentLoad(const RsGxsMessageId &msgId)
|
||||||
|
{
|
||||||
|
mPostedComments->loadComments(msgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,28 +31,27 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
//#include "gui/Posted/PostedList.h"
|
class CommentHolder
|
||||||
//#include "gui/Posted/PostedComments.h"
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
//#include "gui/PhotoShare/PhotoAddDialog.h"
|
/*!
|
||||||
//#include "gui/PhotoShare/PhotoSlideShow.h"
|
* This should be used for loading comments of a message on a main comment viewing page
|
||||||
//#include "util/TokenQueue.h"
|
* @param msgId the message id for which comments will be requested
|
||||||
|
*/
|
||||||
|
virtual void commentLoad(const RsGxsMessageId& msgId) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
class PostedListDialog;
|
class PostedListDialog;
|
||||||
class PostedComments;
|
class PostedComments;
|
||||||
|
|
||||||
class PostedDialog : public MainPage
|
class PostedDialog : public MainPage, public CommentHolder
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PostedDialog(QWidget *parent = 0);
|
PostedDialog(QWidget *parent = 0);
|
||||||
|
void commentLoad(const RsGxsMessageId &msgId);
|
||||||
//virtual void addTab(std::string item);
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
//void OpenSlideShow();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -35,55 +35,41 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
/****
|
|
||||||
* #define DEBUG_ITEM 1
|
|
||||||
****/
|
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
PostedItem::PostedItem(PostedHolder *parent, const RsPostedPost &post)
|
PostedItem::PostedItem(PostedHolder *postHolder, const RsPostedPost &post)
|
||||||
:QWidget(NULL)
|
:QWidget(NULL), mPostHolder(postHolder)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||||
|
|
||||||
titleLabel->setText(QString::fromUtf8(post.mMeta.mMsgName.c_str()));
|
QDateTime qtime;
|
||||||
//dateLabel->setText(QString("Whenever"));
|
qtime.setTime_t(mPost.mMeta.mPublishTs);
|
||||||
|
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
||||||
|
dateLabel->setText(timestamp);
|
||||||
fromLabel->setText(QString::fromUtf8(post.mMeta.mAuthorId.c_str()));
|
fromLabel->setText(QString::fromUtf8(post.mMeta.mAuthorId.c_str()));
|
||||||
//siteLabel->setText(QString::fromUtf8(post.mMeta.mAuthorId.c_str()));
|
titleLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
|
||||||
//scoreLabel->setText(QString("1140"));
|
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
|
||||||
|
QString::fromStdString(post.mMeta.mMsgName) + "</span></a>");
|
||||||
|
siteLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
|
||||||
|
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
|
||||||
|
QString::fromStdString(post.mLink) + "</span></a>");
|
||||||
|
|
||||||
// exposed for testing...
|
scoreLabel->setText(QString("1"));
|
||||||
float score = 0;
|
|
||||||
time_t now = time(NULL);
|
|
||||||
|
|
||||||
QString fromLabelTxt = QString(" Age: ") + QString::number(now - post.mMeta.mPublishTs);
|
|
||||||
fromLabelTxt += QString(" Score: ") + QString::number(score);
|
|
||||||
fromLabel->setText(fromLabelTxt);
|
|
||||||
|
|
||||||
uint32_t votes = 0;
|
|
||||||
uint32_t comments = 0;
|
|
||||||
//rsPosted->extractPostedCache(post.mMeta.mServiceString, votes, comments);
|
|
||||||
scoreLabel->setText(QString::number(votes));
|
|
||||||
QString commentLabel = QString("Comments: ") + QString::number(comments);
|
|
||||||
commentLabel += QString(" Votes: ") + QString::number(votes);
|
|
||||||
siteLabel->setText(commentLabel);
|
|
||||||
|
|
||||||
QDateTime ts;
|
|
||||||
ts.setTime_t(post.mMeta.mPublishTs);
|
|
||||||
dateLabel->setText(ts.toString(QString("yyyy/MM/dd hh:mm:ss")));
|
|
||||||
|
|
||||||
mThreadId = post.mMeta.mThreadId;
|
|
||||||
mParent = parent;
|
|
||||||
|
|
||||||
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
|
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsPostedPost PostedItem::getPost() const
|
||||||
|
{
|
||||||
|
return mPost;
|
||||||
|
}
|
||||||
|
|
||||||
void PostedItem::loadComments()
|
void PostedItem::loadComments()
|
||||||
{
|
{
|
||||||
std::cerr << "PostedItem::loadComments() Requesting for " << mThreadId;
|
std::cerr << "PostedItem::loadComments() Requesting for " << mThreadId;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
mParent->requestComments(mThreadId);
|
mPostHolder->showComments(mPost.mMeta.mMsgId);
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,8 @@ class PostedItem;
|
|||||||
class PostedHolder
|
class PostedHolder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void deletePostedItem(PostedItem *, uint32_t ptype) = 0;
|
|
||||||
virtual void notifySelection(PostedItem *item, int ptype) = 0;
|
|
||||||
|
|
||||||
virtual void requestComments(std::string threadId) = 0;
|
virtual void showComments(const RsGxsMessageId& threadId) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -48,15 +46,7 @@ class PostedItem : public QWidget, private Ui::PostedItem
|
|||||||
public:
|
public:
|
||||||
PostedItem(PostedHolder *parent, const RsPostedPost &item);
|
PostedItem(PostedHolder *parent, const RsPostedPost &item);
|
||||||
|
|
||||||
//void setDummyText();
|
RsPostedPost getPost() const;
|
||||||
//void updateParent(PhotoHolder *parent); // for external construction.
|
|
||||||
//void removeItem();
|
|
||||||
|
|
||||||
//void setSelected(bool on);
|
|
||||||
//bool isSelected();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
//void mousePressEvent(QMouseEvent *event);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void loadComments();
|
void loadComments();
|
||||||
@ -66,7 +56,8 @@ private:
|
|||||||
bool mSelected;
|
bool mSelected;
|
||||||
|
|
||||||
std::string mThreadId;
|
std::string mThreadId;
|
||||||
PostedHolder *mParent;
|
PostedHolder *mPostHolder;
|
||||||
|
RsPostedPost mPost;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ border-radius: 10px}</string>
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="toolButton_2">
|
<widget class="QToolButton" name="voteUpButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>/\</string>
|
<string>/\</string>
|
||||||
</property>
|
</property>
|
||||||
@ -74,7 +74,7 @@ border-radius: 10px}</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="toolButton">
|
<widget class="QToolButton" name="voteDownButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>\/</string>
|
<string>\/</string>
|
||||||
</property>
|
</property>
|
||||||
@ -278,8 +278,6 @@ border-radius: 10px}</string>
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="../../retroshare-gui/src/gui/images.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "gui/Posted/PostedGroupDialog.h"
|
#include "gui/Posted/PostedGroupDialog.h"
|
||||||
#include "gui/Posted/PostedCreatePostDialog.h"
|
#include "gui/Posted/PostedCreatePostDialog.h"
|
||||||
|
#include "gui/Posted/PostedDialog.h"
|
||||||
|
|
||||||
#include <retroshare/rsposted.h>
|
#include <retroshare/rsposted.h>
|
||||||
#include <gxs/rsgxsflags.h>
|
#include <gxs/rsgxsflags.h>
|
||||||
@ -63,8 +64,8 @@
|
|||||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
PostedListDialog::PostedListDialog(QWidget *parent)
|
PostedListDialog::PostedListDialog(CommentHolder *commentHolder, QWidget *parent)
|
||||||
: RsAutoUpdatePage(1000,parent)
|
: RsAutoUpdatePage(1000,parent), mCommentHolder(commentHolder)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
@ -93,7 +94,7 @@ void PostedListDialog::groupListCustomPopupMenu( QPoint /*point*/ )
|
|||||||
{
|
{
|
||||||
QMenu contextMnu( this );
|
QMenu contextMnu( this );
|
||||||
|
|
||||||
QAction *action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Create Topic"), this, SLOT(newPost()));
|
QAction *action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Submit Post"), this, SLOT(newPost()));
|
||||||
action->setDisabled (mCurrTopicId.empty());
|
action->setDisabled (mCurrTopicId.empty());
|
||||||
|
|
||||||
contextMnu.exec(QCursor::pos());
|
contextMnu.exec(QCursor::pos());
|
||||||
@ -105,6 +106,11 @@ void PostedListDialog::newPost()
|
|||||||
cp.exec();
|
cp.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PostedListDialog::showComments(const RsGxsMessageId &threadId)
|
||||||
|
{
|
||||||
|
mCommentHolder->commentLoad(threadId);
|
||||||
|
}
|
||||||
|
|
||||||
void PostedListDialog::updateDisplay()
|
void PostedListDialog::updateDisplay()
|
||||||
{
|
{
|
||||||
std::list<std::string> groupIds;
|
std::list<std::string> groupIds;
|
||||||
@ -121,16 +127,6 @@ void PostedListDialog::updateDisplay()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostedListDialog::requestComments(std::string threadId)
|
|
||||||
{
|
|
||||||
/* call a signal */
|
|
||||||
std::cerr << "PostedListDialog::requestComments(" << threadId << ")";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
loadComments(threadId);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PostedListDialog::changedTopic(const QString &id)
|
void PostedListDialog::changedTopic(const QString &id)
|
||||||
{
|
{
|
||||||
|
@ -35,9 +35,11 @@
|
|||||||
#include "gui/common/GroupTreeWidget.h"
|
#include "gui/common/GroupTreeWidget.h"
|
||||||
|
|
||||||
#include "util/TokenQueue.h"
|
#include "util/TokenQueue.h"
|
||||||
|
|
||||||
#include "retroshare-gui/RsAutoUpdatePage.h"
|
#include "retroshare-gui/RsAutoUpdatePage.h"
|
||||||
|
|
||||||
|
|
||||||
|
class CommentHolder;
|
||||||
|
|
||||||
/*********************** **** **** **** ***********************/
|
/*********************** **** **** **** ***********************/
|
||||||
/** Request / Response of Data ********************************/
|
/** Request / Response of Data ********************************/
|
||||||
/*********************** **** **** **** ***********************/
|
/*********************** **** **** **** ***********************/
|
||||||
@ -54,14 +56,9 @@ class PostedListDialog : public RsAutoUpdatePage, public PostedHolder, public To
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PostedListDialog(QWidget *parent = 0);
|
PostedListDialog(CommentHolder* commentHolder, QWidget *parent = 0);
|
||||||
|
|
||||||
virtual void deletePostedItem(PostedItem *, uint32_t ptype) { return; }
|
void showComments(const RsGxsMessageId &threadId);
|
||||||
virtual void notifySelection(PostedItem *item, int ptype) { return; }
|
|
||||||
virtual void requestComments(std::string threadId);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void loadComments( std::string );
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
@ -117,6 +114,8 @@ private:
|
|||||||
QMap<RsGxsGroupId, RsPostedGroup> mGroups;
|
QMap<RsGxsGroupId, RsPostedGroup> mGroups;
|
||||||
TokenQueue *mPostedQueue;
|
TokenQueue *mPostedQueue;
|
||||||
|
|
||||||
|
CommentHolder* mCommentHolder;
|
||||||
|
|
||||||
/* UI - from Designer */
|
/* UI - from Designer */
|
||||||
Ui::PostedListDialog ui;
|
Ui::PostedListDialog ui;
|
||||||
|
|
||||||
|
@ -43,7 +43,8 @@ GxsCommentTreeWidget::GxsCommentTreeWidget(QWidget *parent)
|
|||||||
:QTreeWidget(parent), mRsService(NULL), mTokenQueue(NULL)
|
:QTreeWidget(parent), mRsService(NULL), mTokenQueue(NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
return;
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsCommentTreeWidget::setup(RsTokenService *service)
|
void GxsCommentTreeWidget::setup(RsTokenService *service)
|
||||||
|
Loading…
Reference in New Issue
Block a user