Finished most of Comment GUI side.

- Created GxsFeedItem to subclass all potential Gxs feeds.
 - Modified GxsChannelPostItem & PostedItem to use GxsFeedItem.
 - Added Posted and Channel Items to Comment Header.
 - Added Message Title to Comment Tab.
 - Added MessageBoxes for missing signatures in various places.
 - Changed Licence from GPL to LGPL for gxs, Posted, gxschannels.
 - Deleted Old Posted Classes that are no longer needed.
 - Added Comment Up/Down/Own Vote to CommentTree.
 - Tweaked FeedHolder fns to support GXS comments.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6225 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2013-03-15 21:02:43 +00:00
parent 1f6d6a4fc2
commit f1e23599da
55 changed files with 1200 additions and 1746 deletions

View File

@ -246,7 +246,7 @@ void ChannelFeed::openChat(std::string /*peerId*/)
{
}
void ChannelFeed::openComments(uint32_t /*type*/ , const RsGxsGroupId & /*grpId */, const RsGxsMessageId & /*msgId*/)
void ChannelFeed::openComments(uint32_t /*type*/ , const RsGxsGroupId & /*grpId */, const RsGxsMessageId & /*msgId*/, const QString & /* title */)
{
}

View File

@ -54,7 +54,7 @@ public:
virtual QScrollArea *getScrollArea();
virtual void deleteFeedItem(QWidget *item, uint32_t type);
virtual void openChat(std::string peerId);
virtual void openComments(uint32_t /*type*/ , const RsGxsGroupId & /*grpId */, const RsGxsMessageId & /*msgId*/);
virtual void openComments(uint32_t /*type*/ , const RsGxsGroupId & /*grpId */, const RsGxsMessageId & /*msgId*/, const QString & /*title */);
bool navigate(const std::string& channelId, const std::string& msgId);

View File

@ -811,7 +811,7 @@ void NewsFeed::openChat(std::string peerId)
}
void NewsFeed::openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId)
void NewsFeed::openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title)
{
std::cerr << "NewsFeed::openComments() Not Handled Yet";
std::cerr << std::endl;

View File

@ -47,7 +47,7 @@ public:
virtual QScrollArea *getScrollArea();
virtual void deleteFeedItem(QWidget *item, uint32_t type);
virtual void openChat(std::string peerId);
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId);
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title);
static void testFeeds(uint notifyFlags);
static void testFeed(FeedNotify *feedNotify);

View File

@ -1,112 +0,0 @@
/*
* Retroshare Posted Comments
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "PostedComments.h"
#include "PostedCreateCommentDialog.h"
#include <retroshare/rsposted.h>
#include <iostream>
#include <sstream>
#include <QTimer>
#include <QMessageBox>
#include <QDateTime>
/****************************************************************
* New Photo Display Widget.
*
* This has two 'lists'.
* Top list shows Albums.
* Lower list is photos from the selected Album.
*
* Notes:
* Each Item will be an AlbumItem, which contains a thumbnail & random details.
* We will limit Items to < 100. With a 'Filter to see more message.
*
* Thumbnails will come from Service.
* Option to Share albums / pictures onward (if permissions allow).
* Option to Download the albums to a specified directory. (is this required if sharing an album?)
*
* Will introduce a FullScreen SlideShow later... first get basics happening.
*/
/** Constructor */
PostedComments::PostedComments(QWidget *parent)
:QWidget(parent)
{
ui.setupUi(this);
ui.postFrame->setVisible(false);
ui.treeWidget->setup(rsPosted->getTokenService());
}
void PostedComments::loadRequest(const TokenQueue *queue, const TokenRequest &req)
{
}
void PostedComments::loadComments(const RsPostedPost& post)
{
std::cerr << "PostedComments::loadComments(" << post.mMeta.mOrigMsgId << ")";
std::cerr << std::endl;
mCurrentPost = post;
setUpPostFrame();
RsGxsGrpMsgIdPair threadId;
threadId.first = post.mMeta.mGroupId;
threadId.second = post.mMeta.mOrigMsgId;
ui.treeWidget->requestComments(threadId);
}
void PostedComments::setUpPostFrame()
{
ui.postFrame->setVisible(true);
QDateTime qtime;
qtime.setTime_t(mCurrentPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
ui.dateLabel->setText(timestamp);
ui.fromLabel->setText(QString::fromUtf8(mCurrentPost.mMeta.mAuthorId.c_str()));
ui.titleLabel->setText("<a href=" + QString::fromStdString(mCurrentPost.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
QString::fromStdString(mCurrentPost.mMeta.mMsgName) + "</span></a>");
ui.siteLabel->setText("<a href=" + QString::fromStdString(mCurrentPost.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
QString::fromStdString(mCurrentPost.mLink) + "</span></a>");
ui.scoreLabel->setText(QString("0"));
ui.notesBrowser->setPlainText(QString::fromStdString(mCurrentPost.mNotes));
}

View File

@ -1,59 +0,0 @@
/*
* Retroshare Posted Comments
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef MRK_POSTED_COMMENTS_H
#define MRK_POSTED_COMMENTS_H
//#include "gui/mainpage.h"
#include "ui_PostedComments.h"
#include <retroshare/rsposted.h>
#include <map>
#include "util/TokenQueue.h"
class PostedComments: public QWidget, public TokenResponse
{
Q_OBJECT
public:
PostedComments(QWidget *parent = 0);
public slots:
void loadComments(const RsPostedPost& );
private:
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
void setUpPostFrame();
RsPostedPost mCurrentPost;
/* UI - from Designer */
Ui::PostedComments ui;
};
#endif

View File

@ -1,367 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PostedComments</class>
<widget class="QWidget" name="PostedComments">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>632</width>
<height>398</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<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">background-color: rgb(203, 203, 203);</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>
<widget class="QTextBrowser" name="notesBrowser">
<property name="styleSheet">
<string notr="true">background-color: rgb(203, 203, 203);</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QGroupBox" name="sortGroup">
<property name="checkable">
<bool>false</bool>
</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>
</item>
<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="QPushButton" name="pushButton_5">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="GxsCommentTreeWidget" name="treeWidget">
<column>
<property name="text">
<string>Comment</string>
</property>
</column>
<column>
<property name="text">
<string>Author</string>
</property>
</column>
<column>
<property name="text">
<string>Date</string>
</property>
</column>
<column>
<property name="text">
<string>Points</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>GxsCommentTreeWidget</class>
<extends>QTreeWidget</extends>
<header>gui/gxs/GxsCommentTreeWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -1,30 +0,0 @@
#include "PostedCreateCommentDialog.h"
#include "ui_PostedCreateCommentDialog.h"
PostedCreateCommentDialog::PostedCreateCommentDialog(TokenQueue *tokQ, const RsGxsGrpMsgIdPair &parentId, const RsGxsMessageId& threadId, QWidget *parent) :
QDialog(parent),
ui(new Ui::PostedCreateCommentDialog), mTokenQueue(tokQ), mParentId(parentId), mThreadId(threadId)
{
ui->setupUi(this);
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(createComment()));
}
void PostedCreateCommentDialog::createComment()
{
RsPostedComment comment;
comment.mComment = ui->commentTextEdit->document()->toPlainText().toStdString();
comment.mMeta.mParentId = mParentId.second;
comment.mMeta.mGroupId = mParentId.first;
comment.mMeta.mThreadId = mThreadId;
uint32_t token;
rsPosted->submitComment(token, comment);
mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
close();
}
PostedCreateCommentDialog::~PostedCreateCommentDialog()
{
delete ui;
}

View File

@ -1,31 +0,0 @@
#ifndef POSTEDCREATECOMMENTDIALOG_H
#define POSTEDCREATECOMMENTDIALOG_H
#include <QDialog>
#include "retroshare/rsposted.h"
#include "util/TokenQueue.h"
namespace Ui {
class PostedCreateCommentDialog;
}
class PostedCreateCommentDialog : public QDialog
{
Q_OBJECT
public:
explicit PostedCreateCommentDialog(TokenQueue* tokQ, const RsGxsGrpMsgIdPair& parentId, const RsGxsMessageId& threadId, QWidget *parent = 0);
~PostedCreateCommentDialog();
private slots:
void createComment();
private:
Ui::PostedCreateCommentDialog *ui;
TokenQueue* mTokenQueue;
RsGxsGrpMsgIdPair mParentId;
RsGxsMessageId mThreadId;
};
#endif // POSTEDCREATECOMMENTDIALOG_H

View File

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PostedCreateCommentDialog</class>
<widget class="QDialog" name="PostedCreateCommentDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>372</width>
<height>145</height>
</rect>
</property>
<property name="windowTitle">
<string>Make Comment</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Comment&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="commentTextEdit"/>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>PostedCreateCommentDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PostedCreateCommentDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,21 +1,65 @@
/*
* Retroshare Posted
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include <QMessageBox>
#include "PostedCreatePostDialog.h"
#include "ui_PostedCreatePostDialog.h"
#include <iostream>
PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *posted, const RsGxsGroupId& grpId, QWidget *parent):
QDialog(parent), mTokenQueue(tokenQ), mPosted(posted), mGrpId(grpId),
ui(new Ui::PostedCreatePostDialog)
{
ui->setupUi(this);
connect(this, SIGNAL(accepted()), this, SLOT(createPost()));
/* fill in the available OwnIds for signing */
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, "");
}
void PostedCreatePostDialog::createPost()
{
RsGxsId authorId;
if (!ui->idChooser->getChosenId(authorId))
{
std::cerr << "PostedCreatePostDialog::createPost() ERROR GETTING AuthorId!, Post Failed";
std::cerr << std::endl;
QMessageBox::warning(this, tr("RetroShare"),tr("Please reate or choose a Signing Id first"),
QMessageBox::Ok, QMessageBox::Ok);
return;
}
RsPostedPost post;
post.mMeta.mGroupId = mGrpId;
post.mLink = ui->linkEdit->text().toStdString();
post.mNotes = ui->notesTextEdit->toPlainText().toStdString();
post.mMeta.mMsgName = ui->titleEdit->text().toStdString();
post.mLink = std::string(ui->linkEdit->text().toUtf8());
post.mNotes = std::string(ui->notesTextEdit->toPlainText().toUtf8());
post.mMeta.mMsgName = std::string(ui->titleEdit->text().toUtf8());
post.mMeta.mAuthorId = authorId;
uint32_t token;
mPosted->createPost(token, post);

View File

@ -1,3 +1,26 @@
/*
* Retroshare Posted
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef POSTEDCREATEPOSTDIALOG_H
#define POSTEDCREATEPOSTDIALOG_H

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>406</width>
<height>195</height>
<width>593</width>
<height>371</height>
</rect>
</property>
<property name="windowTitle">
@ -40,8 +40,8 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Link&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;&quot;&gt;Link&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -50,6 +50,36 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="spacer_2">
<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="label_4">
<property name="text">
<string>Signed by: </string>
</property>
</widget>
</item>
<item>
<widget class="GxsIdChooser" name="idChooser"/>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@ -76,7 +106,16 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<resources/>
<customwidgets>
<customwidget>
<class>GxsIdChooser</class>
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>

View File

@ -1,85 +0,0 @@
/*
* Retroshare Posted List
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "PostedDialog.h"
#include "PostedListDialog.h"
#include "PostedComments.h"
#include <retroshare/rsposted.h>
#include <iostream>
#include <sstream>
#include <QTimer>
#include <QMessageBox>
/******
* #define PHOTO_DEBUG 1
*****/
/****************************************************************
* Posted Dialog
*
*/
PostedDialog::PostedDialog(QWidget *parent)
: MainPage(parent)
{
ui.setupUi(this);
mPostedList = new PostedListDialog(this, NULL);
mPostedComments = new PostedComments(NULL);
QString list(tr("List"));
ui.tabWidget->addTab(mPostedList, list);
QString comments(tr("Comments"));
ui.tabWidget->addTab(mPostedComments, comments);
connect(mPostedList, SIGNAL(loadComments( std::string ) ), mPostedComments, SLOT(loadComments( std::string ) ) );
}
void PostedDialog::commentLoad(const RsPostedPost &post)
{
mPostedComments->loadComments(post);
ui.tabWidget->setCurrentWidget(mPostedComments);
}

View File

@ -57,10 +57,11 @@ public:
return rsPosted;
}
virtual GxsCommentHeader *createHeaderWidget()
{
return NULL;
}
virtual QWidget *createHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId)
{
return new PostedItem(NULL, 0, grpId, msgId, true);
}
};
#endif

View File

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PostedDialog</class>
<widget class="QWidget" name="PostedDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>726</width>
<height>557</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QFrame" name="titleBarFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="Posted_images.qrc">:/images/posted_24.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Posted Links</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>573</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="Posted_images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Posted
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "PostedGroupDialog.h"

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Posted
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _POSTED_GROUP_DIALOG_H

View File

@ -37,80 +37,127 @@
/** Constructor */
PostedItem::PostedItem(PostedHolder *postHolder, const RsPostedPost &post)
:QWidget(NULL), mPostHolder(postHolder), mPost(post)
PostedItem::PostedItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome)
:GxsFeedItem(parent, feedId, groupId, messageId, isHome, rsPosted, true)
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
setContent(mPost);
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
connect( voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote()));
connect( voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote()));
return;
setup();
}
PostedItem::PostedItem(FeedHolder *parent, uint32_t feedId, const RsPostedPost &post, bool isHome)
:GxsFeedItem(parent, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsPosted, false),
mPost(post)
{
setup();
setContent(mPost);
}
void PostedItem::setup()
{
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
connect( commentButton, SIGNAL( clicked() ), this, SLOT( loadComments() ) );
connect( voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote()));
connect( voteDownButton, SIGNAL(clicked()), this, SLOT( makeDownVote()));
return;
}
void PostedItem::loadMessage(const uint32_t &token)
{
std::vector<RsPostedPost> posts;
if (!rsPosted->getPostData(token, posts))
{
std::cerr << "GxsChannelPostItem::loadMessage() ERROR getting data";
std::cerr << std::endl;
return;
}
if (posts.size() != 1)
{
std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items";
std::cerr << std::endl;
return;
}
mPost = posts[0];
setContent(mPost);
return;
}
void PostedItem::setContent(const RsPostedPost &post)
{
mPost = post;
QDateTime qtime;
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()));
titleLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><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>");
mPost = post;
QDateTime qtime;
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()));
titleLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><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>");
uint32_t up, down, nComments;
uint32_t up, down, nComments;
#if 0
bool ok = rsPosted->retrieveScores(mPost.mMeta.mServiceString, up, down, nComments);
bool ok = rsPosted->retrieveScores(mPost.mMeta.mServiceString, up, down, nComments);
if(ok)
{
int32_t vote = up - down;
scoreLabel->setText(QString::number(vote));
if(ok)
{
int32_t vote = up - down;
scoreLabel->setText(QString::number(vote));
numCommentsLabel->setText("<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:10pt; font-weight:600;\">#</span><span "
"style=\" font-size:8pt; font-weight:600;\"> Comments: "
+ QString::number(nComments) + "</span></p>");
}
numCommentsLabel->setText("<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:10pt; font-weight:600;\">#</span><span "
"style=\" font-size:8pt; font-weight:600;\"> Comments: "
+ QString::number(nComments) + "</span></p>");
}
#endif
}
RsPostedPost PostedItem::getPost() const
{
return mPost;
return mPost;
}
void PostedItem::makeDownVote()
{
RsGxsGrpMsgIdPair msgId;
msgId.first = mPost.mMeta.mGroupId;
msgId.second = mPost.mMeta.mMsgId;
emit vote(msgId, false);
RsGxsGrpMsgIdPair msgId;
msgId.first = mPost.mMeta.mGroupId;
msgId.second = mPost.mMeta.mMsgId;
emit vote(msgId, false);
}
void PostedItem::makeUpVote()
{
RsGxsGrpMsgIdPair msgId;
msgId.first = mPost.mMeta.mGroupId;
msgId.second = mPost.mMeta.mMsgId;
emit vote(msgId, true);
RsGxsGrpMsgIdPair msgId;
msgId.first = mPost.mMeta.mGroupId;
msgId.second = mPost.mMeta.mMsgId;
emit vote(msgId, true);
}
void PostedItem::loadComments()
{
std::cerr << "PostedItem::loadComments() Requesting for " << mThreadId;
std::cerr << std::endl;
mPostHolder->showComments(mPost);
std::cerr << "PostedItem::loadComments()";
std::cerr << std::endl;
if (mParent)
{
QString title = QString::fromUtf8(mPost.mMeta.mMsgName.c_str());
mParent->openComments(0, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, title);
}
}

View File

@ -27,23 +27,17 @@
#include "ui_PostedItem.h"
#include <retroshare/rsposted.h>
#include "gui/feeds/FeedHolder.h"
#include "gui/gxs/GxsFeedItem.h"
class RsPostedPost;
class PostedItem;
class PostedHolder
{
public:
virtual void showComments(const RsPostedPost& post) = 0;
};
class PostedItem : public QWidget, private Ui::PostedItem
class PostedItem : public GxsFeedItem, private Ui::PostedItem
{
Q_OBJECT
public:
PostedItem(PostedHolder *parent, const RsPostedPost &post);
PostedItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome);
PostedItem(FeedHolder *parent, uint32_t feedId, const RsPostedPost &post, bool isHome);
RsPostedPost getPost() const;
void setContent(const RsPostedPost& post);
@ -56,12 +50,16 @@ private slots:
signals:
void vote(const RsGxsGrpMsgIdPair& msgId, bool up);
protected:
virtual void loadMessage(const uint32_t &token);
private:
void setup();
uint32_t mType;
bool mSelected;
std::string mThreadId;
PostedHolder *mPostHolder;
RsPostedPost mPost;
};

View File

@ -214,12 +214,34 @@ void PostedListDialog::submitVote(const RsGxsGrpMsgIdPair &msgId, bool up)
#endif
}
void PostedListDialog::showComments(const RsPostedPost& post)
/*****************************************************************************************/
// Overloaded from FeedHolder.
QScrollArea *PostedListDialog::getScrollArea()
{
commentLoad(post.mMeta.mGroupId, post.mMeta.mMsgId);
//mCommentHolder->commentLoad(post);
return ui.scrollArea;
}
void PostedListDialog::deleteFeedItem(QWidget *item, uint32_t type)
{
std::cerr << "PostedListDialog::deleteFeedItem() Nah";
std::cerr << std::endl;
return;
}
void PostedListDialog::openChat(std::string peerId)
{
std::cerr << "PostedListDialog::openChat() Nah";
std::cerr << std::endl;
return;
}
void PostedListDialog::openComments(uint32_t feed_type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title)
{
commentLoad(groupId, msgId, title);
}
/*****************************************************************************************/
void PostedListDialog::updateDisplay()
@ -500,7 +522,7 @@ void PostedListDialog::loadGroupThreadData_InsertThreads(const uint32_t &token)
void PostedListDialog::loadPost(const RsPostedPost &post)
{
PostedItem *item = new PostedItem(this, post);
PostedItem *item = new PostedItem(this, 0, post, true);
connect(item, SIGNAL(vote(RsGxsGrpMsgIdPair,bool)), this, SLOT(submitVote(RsGxsGrpMsgIdPair,bool)));
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
mPosts.insert(post.mMeta.mMsgId, item);

View File

@ -53,14 +53,18 @@
#define POSTEDDIALOG_INSERT_POST 5
#define POSTEDDIALOG_REPLY_MESSAGE 6
class PostedListDialog : public RsAutoUpdatePage, public PostedHolder, public TokenResponse, public GxsServiceDialog
class PostedListDialog : public RsAutoUpdatePage, public FeedHolder, public TokenResponse, public GxsServiceDialog
{
Q_OBJECT
public:
PostedListDialog(QWidget *parent = 0);
void showComments(const RsPostedPost& post);
// Overloaded from FeedHolder.
virtual QScrollArea *getScrollArea();
virtual void deleteFeedItem(QWidget *item, uint32_t type);
virtual void openChat(std::string peerId);
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title);
private slots:

View File

@ -220,8 +220,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>426</width>
<height>327</height>
<width>443</width>
<height>316</height>
</rect>
</property>
<property name="sizePolicy">
@ -230,24 +230,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<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>309</height>
</size>
</property>
</spacer>
</item>
</layout>
<layout class="QVBoxLayout" name="verticalLayout_2"/>
</widget>
</widget>
</item>

View File

@ -37,7 +37,7 @@ public:
virtual QScrollArea *getScrollArea() = 0;
virtual void deleteFeedItem(QWidget *item, uint32_t type) = 0;
virtual void openChat(std::string peerId) = 0;
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId) = 0;
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title) = 0;
// Workaround for QTBUG-3372
void lockLayout(QWidget *feedItem, bool lock);

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Feed Item
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include <QDateTime>
#include <QTimer>
@ -40,39 +42,41 @@
* #define DEBUG_ITEM 1
****/
#define DEBUG_ITEM 1
#define COLOR_NORMAL QColor(248, 248, 248)
#define COLOR_NEW QColor(220, 236, 253)
#define SELF_LOAD 1
#define DATA_PROVIDED 2
/** Constructor */
GxsChannelPostItem::GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const std::string &chanId, const std::string &msgId, bool isHome)
:QWidget(NULL), mParent(parent), mFeedId(feedId),
mChanId(chanId), mMsgId(msgId), mIsHome(isHome)
GxsChannelPostItem::GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome)
:GxsFeedItem(parent, feedId, groupId, messageId, isHome, rsGxsChannels, true)
{
mMode = SELF_LOAD;
mSubscribeFlags = 0;
setup();
// THIS IS JUST SO WE REMEMBER TO DO IT.
updateItemStatic();
updateItem();
}
/** Constructor */
GxsChannelPostItem::GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const RsGxsChannelPost &post, uint32_t subFlags, bool isHome)
:QWidget(NULL), mParent(parent), mFeedId(feedId),
mChanId(post.mMeta.mGroupId), mMsgId(post.mMeta.mMsgId), mIsHome(isHome)
:GxsFeedItem(parent, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsChannels, false)
{
std::cerr << "GxsChannelPostItem::GxsChannelPostItem() Direct Load";
std::cerr << std::endl;
mMode = DATA_PROVIDED;
mSubscribeFlags = subFlags;
mGroupMeta.mSubscribeFlags = subFlags;
m_inUpdateItemStatic = false;
setup();
// is it because we are in the constructor?
loadPost(post);
updateItem();
}
@ -95,7 +99,7 @@ void GxsChannelPostItem::setup()
connect( downloadButton, SIGNAL( clicked( void ) ), this, SLOT( download ( void ) ) );
// HACK FOR NOW.
connect( commentButton, SIGNAL( clicked( void ) ), this, SLOT( comments ( void ) ) );
connect( commentButton, SIGNAL( clicked( void ) ), this, SLOT( loadComments ( void ) ) );
connect( playButton, SIGNAL( clicked( void ) ), this, SLOT( play ( void ) ) );
connect( copyLinkButton, SIGNAL( clicked( void ) ), this, SLOT( copyLink ( void ) ) );
@ -121,153 +125,37 @@ void GxsChannelPostItem::setup()
}
void GxsChannelPostItem::updateItemStatic()
void GxsChannelPostItem::loadComments()
{
#if 0
/* fill in */
#ifdef DEBUG_ITEM
std::cerr << "GxsChannelPostItem::updateItemStatic()";
std::cerr << std::endl;
#endif
ChannelMsgInfo cmi;
if (!rsChannels)
return;
if (!rsChannels->getChannelMessage(mChanId, mMsgId, cmi))
return;
m_inUpdateItemStatic = true;
QString title;
ChannelInfo ci;
rsChannels->getChannelInfo(mChanId, ci);
if (!mIsHome)
{
title = tr("Channel Feed") + ": ";
RetroShareLink link;
link.createChannel(ci.channelId, "");
title += link.toHtml();
titleLabel->setText(title);
RetroShareLink msgLink;
msgLink.createChannel(cmi.channelId, cmi.msgId);
subjectLabel->setText(msgLink.toHtml());
if ((ci.channelFlags & RS_DISTRIB_SUBSCRIBED) || (ci.channelFlags & RS_DISTRIB_ADMIN)) {
unsubscribeButton->setEnabled(true);
} else {
unsubscribeButton->setEnabled(false);
}
readButton->hide();
newLabel->hide();
copyLinkButton->hide();
}
else
{
/* subject */
titleLabel->setText(QString::fromStdWString(cmi.subject));
subjectLabel->setText(RsHtml().formatText(NULL, QString::fromStdWString(cmi.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
/* disable buttons: deletion facility not enabled with cache services yet */
clearButton->setEnabled(false);
unsubscribeButton->setEnabled(false);
clearButton->hide();
readAndClearButton->hide();
unsubscribeButton->hide();
copyLinkButton->show();
if ((ci.channelFlags & RS_DISTRIB_SUBSCRIBED) || (ci.channelFlags & RS_DISTRIB_ADMIN)) {
readButton->setVisible(true);
uint32_t status = 0;
rsChannels->getMessageStatus(mChanId, mMsgId, status);
if ((status & CHANNEL_MSG_STATUS_READ) == 0 || (status & CHANNEL_MSG_STATUS_UNREAD_BY_USER)) {
readButton->setChecked(true);
readButton->setIcon(QIcon(":/images/message-state-unread.png"));
} else {
readButton->setChecked(false);
readButton->setIcon(QIcon(":/images/message-state-read.png"));
}
bool newState;
QColor color;
if (status & CHANNEL_MSG_STATUS_READ) {
newLabel->setVisible(false);
newState = false;
color = COLOR_NORMAL;
} else {
newLabel->setVisible(true);
newState = true;
color = COLOR_NEW;
}
/* unpolish widget to clear the stylesheet's palette cache */
frame->style()->unpolish(frame);
QPalette palette = frame->palette();
palette.setColor(frame->backgroundRole(), color);
frame->setPalette(palette);
frame->setProperty("new", newState);
Rshare::refreshStyleSheet(frame, false);
} else {
readButton->setVisible(false);
newLabel->setVisible(false);
}
}
msgLabel->setText(RsHtml().formatText(NULL, QString::fromStdWString(cmi.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
msgFrame->setVisible(!cmi.msg.empty());
datetimelabel->setText(DateTime::formatLongDateTime(cmi.ts));
filelabel->setText(QString("(%1 %2) %3").arg(cmi.count).arg(tr("Files")).arg(misc::friendlyUnit(cmi.size)));
if (mFileItems.empty() == false) {
std::list<SubFileItem *>::iterator it;
for(it = mFileItems.begin(); it != mFileItems.end(); it++)
{
delete(*it);
}
mFileItems.clear();
}
std::list<FileInfo>::iterator it;
for(it = cmi.files.begin(); it != cmi.files.end(); it++)
{
/* add file */
SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->path, it->size,
SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, "");
mFileItems.push_back(fi);
/* check if the file is a media file */
if (!misc::isPreviewable(QFileInfo(QString::fromUtf8(it->fname.c_str())).suffix()))
fi->mediatype();
QLayout *layout = expandFrame->layout();
layout->addWidget(fi);
}
if(cmi.thumbnail.image_thumbnail != NULL)
{
QPixmap thumbnail;
thumbnail.loadFromData(cmi.thumbnail.image_thumbnail, cmi.thumbnail.im_thumbnail_size, "PNG");
logoLabel->setPixmap(thumbnail);
}
m_inUpdateItemStatic = false;
#endif
QString title = QString::fromUtf8(mPost.mMeta.mMsgName.c_str());
comments(title);
}
void GxsChannelPostItem::loadMessage(const uint32_t &token)
{
std::cerr << "GxsChannelPostItem::loadMessage()";
std::cerr << std::endl;
std::vector<RsGxsChannelPost> posts;
if (!rsGxsChannels->getPostData(token, posts))
{
std::cerr << "GxsChannelPostItem::loadMessage() ERROR getting data";
std::cerr << std::endl;
return;
}
if (posts.size() != 1)
{
std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items";
std::cerr << std::endl;
return;
}
loadPost(posts[0]);
updateItem();
}
@ -279,6 +167,10 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
std::cerr << std::endl;
#endif
m_inUpdateItemStatic = true;
mPost = post;
QString title;
if (!mIsHome)
@ -318,10 +210,11 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
unsubscribeButton->hide();
copyLinkButton->show();
if (IS_GROUP_SUBSCRIBED(mSubscribeFlags) || IS_GROUP_ADMIN(mSubscribeFlags))
if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags))
{
readButton->setVisible(true);
#if 0
uint32_t status = 0;
rsChannels->getMessageStatus(mChanId, mMsgId, status);
@ -336,6 +229,7 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
readButton->setChecked(false);
readButton->setIcon(QIcon(":/images/message-state-read.png"));
}
#endif
bool newState;
QColor color;
@ -407,8 +301,11 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
{
QPixmap thumbnail;
thumbnail.loadFromData(post.mThumbnail.mData, post.mThumbnail.mSize, "PNG");
// Wiping data - as its been passed to thumbnail.
logoLabel->setPixmap(thumbnail);
}
m_inUpdateItemStatic = false;
}
void GxsChannelPostItem::setFileCleanUpWarning(uint32_t time_left)
@ -500,13 +397,16 @@ void GxsChannelPostItem::updateItem()
}
// HACK TO DISPLAY COMMENT BUTTON FOR NOW.
downloadButton->show();
downloadButton->setEnabled(true);
//downloadButton->show();
//downloadButton->setEnabled(true);
}
void GxsChannelPostItem::toggle()
{
mParent->lockLayout(this, true);
if (mParent)
{
mParent->lockLayout(this, true);
}
if (expandFrame->isHidden())
{
@ -523,37 +423,9 @@ void GxsChannelPostItem::toggle()
expandButton->setToolTip(tr("Expand"));
}
mParent->lockLayout(this, false);
}
void GxsChannelPostItem::removeItem()
{
#ifdef DEBUG_ITEM
std::cerr << "GxsChannelPostItem::removeItem()";
std::cerr << std::endl;
#endif
mParent->lockLayout(this, true);
hide();
mParent->lockLayout(this, false);
if (mParent)
{
mParent->deleteFeedItem(this, mFeedId);
}
}
void GxsChannelPostItem::comments()
{
#ifdef DEBUG_ITEM
std::cerr << "GxsChannelPostItem::comments()";
std::cerr << std::endl;
#endif
if (mParent)
{
mParent->openComments(mFeedId, mChanId, mMsgId);
mParent->lockLayout(this, false);
}
}
@ -577,10 +449,7 @@ void GxsChannelPostItem::unsubscribeChannel()
std::cerr << std::endl;
#endif
if (rsChannels)
{
rsChannels->channelSubscribe(mChanId, false, false);
}
unsubscribe();
updateItemStatic();
}
@ -609,6 +478,8 @@ void GxsChannelPostItem::play()
void GxsChannelPostItem::readToggled(bool checked)
{
#if 0
if (m_inUpdateItemStatic) {
return;
}
@ -630,10 +501,15 @@ void GxsChannelPostItem::readToggled(bool checked)
if (!mIsHome) {
connect( NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int)), Qt::QueuedConnection);
}
#endif
}
void GxsChannelPostItem::channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int status)
{
#if 0
if (channelId.toStdString() == mChanId && msgId.toStdString() == mMsgId) {
if (!mIsHome) {
if (status & CHANNEL_MSG_STATUS_READ) {
@ -643,10 +519,14 @@ void GxsChannelPostItem::channelMsgReadSatusChanged(const QString& channelId, co
}
updateItemStatic();
}
#endif
}
void GxsChannelPostItem::copyLink()
{
#if 0
if (mChanId.empty() || mMsgId.empty()) {
return;
}
@ -660,4 +540,6 @@ void GxsChannelPostItem::copyLink()
RSLinkClipboard::copyLinks(urls);
}
}
#endif
}

View File

@ -1,80 +1,77 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Feed Item
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_CHANNEL_POST_ITEM_H
#define _GXS_CHANNEL_POST_ITEM_H
#include <retroshare/rsgxschannels.h>
#include "gui/gxs/GxsFeedItem.h"
#include "ui_GxsChannelPostItem.h"
#include <stdint.h>
class FeedHolder;
class SubFileItem;
class GxsChannelPostItem : public QWidget, private Ui::GxsChannelPostItem
class GxsChannelPostItem : public GxsFeedItem, private Ui::GxsChannelPostItem
{
Q_OBJECT
public:
/** Default Constructor */
GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const std::string &chanId, const std::string &msgId, bool isHome);
GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome);
GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const RsGxsChannelPost &post, uint32_t subscribeFlags, bool isHome);
void updateItemStatic();
void setFileCleanUpWarning(uint32_t time_left);
const std::string &msgId() { return mMsgId; }
//const std::string &msgId() { return mMsgId; }
protected:
virtual void loadMessage(const uint32_t &token);
private slots:
/* default stuff */
void removeItem();
void toggle();
void readAndClearItem();
void unsubscribeChannel();
void download();
void play();
void copyLink();
void comments();
void loadComments();
void readToggled(bool checked);
void channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int status);
void unsubscribeChannel();
void updateItem();
private:
void setup();
void loadPost(const RsGxsChannelPost &post);
FeedHolder *mParent;
uint32_t mFeedId;
std::string mChanId;
std::string mMsgId;
bool mIsHome;
bool m_inUpdateItemStatic;
uint32_t mMode;
uint32_t mSubscribeFlags;
RsGxsChannelPost mPost;
std::list<SubFileItem *> mFileItems;
};

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "GxsCircleChooser.h"

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_CIRCLES_CHOOSER_H

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "GxsCircleLabel.h"

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_CIRCLE_LABEL_H

View File

@ -1,5 +1,5 @@
/*
* Retroshare Posted List
* Retroshare Comment Container
*
* Copyright 2012-2012 by Robert Fernie.
*
@ -61,16 +61,23 @@ void GxsCommentContainer::setup()
}
void GxsCommentContainer::commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId)
#define MAX_COMMENT_TITLE 32
void GxsCommentContainer::commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId, const QString &title)
{
QString comments(tr("Comments"));
QString comments = title;
if (title.length() > MAX_COMMENT_TITLE)
{
comments.truncate(MAX_COMMENT_TITLE - 3);
comments += "...";
}
GxsCommentDialog *commentDialog = new GxsCommentDialog(this, getTokenService(), getCommentService());
GxsCommentHeader *commentHeader = createHeaderWidget();
QWidget *commentHeader = createHeaderWidget(grpId, msgId);
commentDialog->setCommentHeader(commentHeader);
commentDialog->commentLoad(grpId, msgId);
//commentHeader->commentLoad(grpId, msgId);
ui.tabWidget->addTab(commentDialog, comments);
}
@ -80,13 +87,18 @@ void GxsCommentContainer::commentLoad(const RsGxsGroupId &grpId, const RsGxsMess
void GxsCommentContainer::tabCloseRequested(int index)
{
std::cerr << "GxsCommentContainer::tabCloseRequested(" << index << ")";
std::cerr << std::endl;
if (index != 0)
{
QWidget *comments = ui.tabWidget->widget(index);
ui.tabWidget->removeTab(index);
delete comments;
}
std::cerr << "GxsCommentContainer::tabCloseRequested() Not closing First Tab";
else
{
std::cerr << "GxsCommentContainer::tabCloseRequested() Not closing First Tab";
std::cerr << std::endl;
}
}

View File

@ -32,20 +32,8 @@
#include <map>
class GxsCommentHeader
{
public:
/*!
* This should be used for loading comments of a message on a main comment viewing page
* @param msgId the message id for which comments will be requested
*/
virtual void commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId) = 0;
};
class GxsServiceDialog;
class GxsCommentContainer : public MainPage
{
Q_OBJECT
@ -54,13 +42,13 @@ public:
GxsCommentContainer(QWidget *parent = 0);
void setup();
void commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId);
void commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId, const QString &title);
virtual GxsServiceDialog *createServiceDialog() = 0;
virtual QString getServiceName() = 0;
virtual RsTokenService *getTokenService() = 0;
virtual RsGxsCommentService *getCommentService() = 0;
virtual GxsCommentHeader *createHeaderWidget() = 0;
virtual QWidget *createHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId) = 0;
private slots:
void tabCloseRequested(int index);
@ -85,9 +73,9 @@ public:
virtual ~GxsServiceDialog() { return; }
void commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId)
void commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId, const QString &title)
{
mContainer->commentLoad(grpId, msgId);
mContainer->commentLoad(grpId, msgId, title);
}
private:
GxsCommentContainer *mContainer;

View File

@ -102,8 +102,23 @@ void GxsCommentDialog::voterSelectionChanged( int index )
void GxsCommentDialog::setCommentHeader(GxsCommentHeader *header)
void GxsCommentDialog::setCommentHeader(QWidget *header)
{
if (!header)
{
std::cerr << "GxsCommentDialog::setCommentHeader() NULL header!";
std::cerr << std::endl;
return;
}
std::cerr << "GxsCommentDialog::setCommentHeader() Adding header to ui,postFrame";
std::cerr << std::endl;
//header->setParent(ui.postFrame);
//ui.postFrame->setVisible(true);
QLayout *alayout = ui.postFrame->layout();
alayout->addWidget(header);
#if 0
ui.postFrame->setVisible(true);

View File

@ -35,7 +35,7 @@ class GxsCommentDialog: public QWidget
public:
GxsCommentDialog(QWidget *parent, RsTokenService *token_service, RsGxsCommentService *comment_service);
void setCommentHeader(GxsCommentHeader *header);
void setCommentHeader(QWidget *header);
void commentLoad(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId);
private slots:

View File

@ -22,222 +22,16 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(203, 203, 203);</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 class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
</layout>
</widget>
</item>
@ -364,6 +158,11 @@
<string>DownVotes</string>
</property>
</column>
<column>
<property name="text">
<string>OwnVote</string>
</property>
</column>
</widget>
</item>
</layout>

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2008 Robert Fernie
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
/*
* Retroshare Gxs Support
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include <QMimeData>
#include <QDateTime>
@ -35,11 +37,14 @@
#define PCITEM_COLUMN_SCORE 3
#define PCITEM_COLUMN_UPVOTES 4
#define PCITEM_COLUMN_DOWNVOTES 5
#define PCITEM_COLUMN_MSGID 6
#define PCITEM_COLUMN_PARENTID 7
#define PCITEM_COLUMN_OWNVOTE 6
#define PCITEM_COLUMN_MSGID 7
#define PCITEM_COLUMN_PARENTID 8
#define GXSCOMMENTS_LOADTHREAD 1
#define COMMENT_VOTE_ACK 0x001234
/* Images for context menu icons */
#define IMAGE_MESSAGE ":/images/folder-draft.png"
@ -164,7 +169,7 @@ void GxsCommentTreeWidget::vote(const RsGxsGroupId &groupId, const RsGxsMessageI
uint32_t token;
mCommentService->createVote(token, vote);
mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, COMMENT_VOTE_ACK);
}
@ -373,6 +378,17 @@ void GxsCommentTreeWidget::acknowledgeComment(const uint32_t &token)
}
void GxsCommentTreeWidget::acknowledgeVote(const uint32_t &token)
{
RsGxsGrpMsgIdPair msgId;
if (mCommentService->acknowledgeVote(token, msgId))
{
// reload data if vote was added.
service_requestComments(mThreadId);
}
}
void GxsCommentTreeWidget::service_loadThread(const uint32_t &token)
{
std::cerr << "GxsCommentTreeWidget::service_loadThread() ERROR must be overloaded!";
@ -416,6 +432,9 @@ void GxsCommentTreeWidget::service_loadThread(const uint32_t &token)
text = QString::number(comment.mDownVotes);
item->setText(PCITEM_COLUMN_DOWNVOTES, text);
text = QString::number(comment.mOwnVote);
item->setText(PCITEM_COLUMN_OWNVOTE, text);
text = QString::fromUtf8(comment.mMeta.mMsgId.c_str());
item->setText(PCITEM_COLUMN_MSGID, text);
@ -475,7 +494,14 @@ void GxsCommentTreeWidget::loadRequest(const TokenQueue *queue, const TokenReque
switch(req.mAnsType)
{
case RS_TOKREQ_ANSTYPE_ACK:
acknowledgeComment(req.mToken);
if (req.mUserType == COMMENT_VOTE_ACK)
{
acknowledgeVote(req.mToken);
}
else
{
acknowledgeComment(req.mToken);
}
break;
case RS_TOKREQ_ANSTYPE_DATA:
loadThread(req.mToken);

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2008 Robert Fernie
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
/*
* Retroshare Gxs Support
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_COMMENT_TREE_WIDGET_H
#define _GXS_COMMENT_TREE_WIDGET_H
@ -54,6 +56,8 @@ protected:
void completeItems();
void acknowledgeComment(const uint32_t& token);
void acknowledgeVote(const uint32_t &token);
void loadThread(const uint32_t &token);
void addItem(std::string itemId, std::string parentId, QTreeWidgetItem *item);

View File

@ -1,3 +1,26 @@
/*
* Retroshare Gxs Support
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "GxsCreateCommentDialog.h"
#include "ui_GxsCreateCommentDialog.h"

View File

@ -1,3 +1,26 @@
/*
* Retroshare Gxs Support
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _MRK_GXS_CREATE_COMMENT_DIALOG_H
#define _MRK_GXS_CREATE_COMMENT_DIALOG_H

View File

@ -0,0 +1,255 @@
/*
* Retroshare Gxs Feed Item
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "gui/gxs/GxsFeedItem.h"
#include "gui/feeds/FeedHolder.h"
#include <iostream>
/**
* #define DEBUG_ITEM 1
**/
#define DEBUG_ITEM 1
#define GXSFEEDITEM_GROUPMETA 5
#define GXSFEEDITEM_MESSAGE 6
void GxsFeedItem::removeItem()
{
#ifdef DEBUG_ITEM
std::cerr << "GxsFeedItem::removeItem()";
std::cerr << std::endl;
#endif
if (mParent)
{
mParent->lockLayout(this, true);
}
hide();
if (mParent)
{
mParent->lockLayout(this, false);
mParent->deleteFeedItem(this, mFeedId);
}
}
void GxsFeedItem::comments(const QString &title)
{
#ifdef DEBUG_ITEM
std::cerr << "GxsFeedItem::comments()";
std::cerr << std::endl;
#endif
if (mParent)
{
mParent->openComments(mFeedId, mGroupId, mMessageId, title);
}
}
void GxsFeedItem::unsubscribe()
{
#ifdef DEBUG_ITEM
std::cerr << "GxsFeedItem::unsubscribe()";
std::cerr << std::endl;
#endif
if (mGxsIface)
{
uint32_t token;
mGxsIface->subscribeToGroup(token, mGroupId, false);
}
}
void GxsFeedItem::subscribe()
{
#ifdef DEBUG_ITEM
std::cerr << "GxsFeedItem::subscribe()";
std::cerr << std::endl;
#endif
if (mGxsIface)
{
uint32_t token;
mGxsIface->subscribeToGroup(token, mGroupId, true);
}
}
void GxsFeedItem::updateItemStatic()
{
std::cerr << "GxsFeedItem::updateItemStatic()";
std::cerr << std::endl;
requestMessage();
}
void GxsFeedItem::updateItem()
{
std::cerr << "GxsFeedItem::updateItem() EMPTY";
std::cerr << std::endl;
}
/***********************************************************/
GxsFeedItem::GxsFeedItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, RsGxsIfaceHelper *iface, bool loadData)
:QWidget(NULL)
{
std::cerr << "GxsFeedItem::GxsFeedItem()";
std::cerr << std::endl;
/* this are just generally useful for all children */
mParent = parent;
mFeedId = feedId;
mIsHome = isHome;
/* load data if we can */
mGroupId = groupId;
mMessageId = messageId;
mGxsIface = iface;
if (loadData && iface)
{
mLoadQueue = new TokenQueue(iface->getTokenService(), this);
requestGroupMeta();
}
else
{
mLoadQueue = NULL;
}
}
GxsFeedItem::~GxsFeedItem()
{
std::cerr << "GxsFeedItem::~GxsFeedItem()";
std::cerr << std::endl;
if (mLoadQueue)
{
delete mLoadQueue;
}
}
void GxsFeedItem::requestGroupMeta()
{
std::cerr << "GxsFeedItem::requestGroup()";
std::cerr << std::endl;
if (!mLoadQueue)
{
return;
}
std::list<std::string> ids;
ids.push_back(mGroupId);
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
uint32_t token;
mLoadQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, ids, GXSFEEDITEM_GROUPMETA);
updateItemStatic();
}
void GxsFeedItem::requestMessage()
{
std::cerr << "GxsFeedItem::requestMessage()";
std::cerr << std::endl;
if (!mLoadQueue)
{
return;
}
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
GxsMsgReq msgIds;
std::vector<RsGxsMessageId> &vect_msgIds = msgIds[mGroupId];
vect_msgIds.push_back(mMessageId);
uint32_t token;
mLoadQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, GXSFEEDITEM_MESSAGE);
}
void GxsFeedItem::loadGroupMeta(const uint32_t &token)
{
std::cerr << "GxsFeedItem::loadGroupMeta()";
std::cerr << std::endl;
std::list<RsGroupMetaData> groupMeta;
if (!mGxsIface->getGroupSummary(token, groupMeta))
{
std::cerr << "GxsFeedItem::loadGroupMeta() Error getting GroupMeta";
std::cerr << std::endl;
return;
}
if (groupMeta.size() == 1)
{
mGroupMeta = *groupMeta.begin();
}
else
{
std::cerr << "GxsFeedItem::loadGroupMeta() ERROR Should be ONE GroupMeta";
std::cerr << std::endl;
}
}
void GxsFeedItem::loadRequest(const TokenQueue *queue, const TokenRequest &req)
{
std::cerr << "GxsFeedItem::loadRequest()";
std::cerr << std::endl;
if (queue == mLoadQueue)
{
switch(req.mUserType)
{
case GXSFEEDITEM_GROUPMETA:
loadGroupMeta(req.mToken);
break;
case GXSFEEDITEM_MESSAGE:
loadMessage(req.mToken);
break;
default:
std::cerr << "GxsFeedItem::loadRequest() ERROR: INVALID TYPE";
std::cerr << std::endl;
break;
}
}
}

View File

@ -0,0 +1,83 @@
/*
* Retroshare Gxs Feed Item
*
* Copyright 2012-2013 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_GENERIC_FEED_ITEM_H
#define _GXS_GENERIC_FEED_ITEM_H
#include <retroshare/rsgxsifacehelper.h>
#include "util/TokenQueue.h"
#include <stdint.h>
class FeedHolder;
class GxsFeedItem : public QWidget, public TokenResponse
{
Q_OBJECT
public:
/** Note parent can = NULL */
GxsFeedItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, RsGxsIfaceHelper *iface, bool loadData);
virtual ~GxsFeedItem();
protected:
// generic Fns - to be overloaded.
virtual void updateItemStatic();
virtual void updateItem();
virtual void loadMessage(const uint32_t &token) = 0;
void requestMessage();
virtual void loadGroupMeta(const uint32_t &token);
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
// general fns that can be implemented here.
protected slots:
void comments(const QString &title);
void subscribe();
void unsubscribe();
void removeItem();
protected:
FeedHolder *mParent;
uint32_t mFeedId;
bool mIsHome;
RsGxsGroupId mGroupId;
RsGxsMessageId mMessageId;
RsGroupMetaData mGroupMeta;
private:
void requestGroupMeta();
RsGxsIfaceHelper *mGxsIface;
TokenQueue *mLoadQueue;
};
#endif

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include <QMessageBox>

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_GROUP_DIALOG_H
#define _GXS_GROUP_DIALOG_H

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "GxsIdChooser.h"

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_ID_CHOOSER_H

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "GxsIdLabel.h"

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_ID_LABEL_H

View File

@ -1,23 +1,26 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "GxsIdTreeWidgetItem.h"

View File

@ -1,24 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2012 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _GXS_ID_TREEWIDGETITEM_H
#define _GXS_ID_TREEWIDGETITEM_H

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#include "WikiGroupDialog.h"

View File

@ -1,23 +1,25 @@
/****************************************************************
* RetroShare is distributed under the following license:
/*
* Retroshare Gxs Support
*
* Copyright (C) 2008 Robert Fernie
* Copyright 2012-2013 by Robert Fernie.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* 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 General Public License for more details.
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef _WIKI_GROUP_DIALOG_H

View File

@ -29,6 +29,7 @@
#include "gui/gxs/GxsCommentContainer.h"
#include "gui/gxschannels/GxsChannelDialog.h"
#include "gui/feeds/GxsChannelPostItem.h"
class ChannelDialog : public GxsCommentContainer
@ -59,9 +60,9 @@ public:
return rsGxsChannels;
}
virtual GxsCommentHeader *createHeaderWidget()
virtual QWidget *createHeaderWidget(const RsGxsGroupId &grpId, const RsGxsMessageId &msgId)
{
return NULL;
return new GxsChannelPostItem(NULL, 0, grpId, msgId, true);
}
};

View File

@ -132,9 +132,9 @@ GxsChannelDialog::~GxsChannelDialog()
// Callback from Widget->FeedHolder->ServiceDialog->CommentContainer->CommentDialog,
void GxsChannelDialog::openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId)
void GxsChannelDialog::openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title)
{
commentLoad(groupId, msgId);
commentLoad(groupId, msgId, title);
}

View File

@ -61,7 +61,7 @@ public:
virtual QScrollArea *getScrollArea();
virtual void deleteFeedItem(QWidget *item, uint32_t type);
virtual void openChat(std::string peerId);
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId);
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title);
bool navigate(const std::string& channelId, const std::string& msgId);

View File

@ -298,12 +298,19 @@ void CreateGxsForumMsg::createMsg()
{
std::cerr << "CreateGxsForumMsg::createMsg() ERROR GETTING AuthorId!";
std::cerr << std::endl;
QMessageBox::warning(this, tr("RetroShare"),tr("Please choose Signing Id"),
QMessageBox::Ok, QMessageBox::Ok);
return;
}
}
else
{
std::cerr << "CreateGxsForumMsg::createMsg() No Signature (for now :)";
std::cerr << std::endl;
QMessageBox::warning(this, tr("RetroShare"),tr("Please choose Signing Id, it is required"),
QMessageBox::Ok, QMessageBox::Ok);
return;
}
uint32_t token;