mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Updated forumV2 support forms to latest version (from forums/)
* Can now create new forum & post/reply messages. Flags have not been finished for these. * Edit/Details are not yet complete. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5347 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
17da89938f
commit
ceb4298208
@ -127,6 +127,18 @@ static int FilterColumnToComboBox(int nIndex)
|
|||||||
return FilterColumnToComboBox(COLUMN_THREAD_TITLE);
|
return FilterColumnToComboBox(COLUMN_THREAD_TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Transformation Notes:
|
||||||
|
* there are still a couple of things that the new forums differ from Old version.
|
||||||
|
* these will need to be addressed in the future.
|
||||||
|
* -> Missing Messages are not handled yet.
|
||||||
|
* -> Child TS (for sorting) is not handled by GXS, this will probably have to be done in the GUI.
|
||||||
|
* -> Need to handle IDs properly.
|
||||||
|
* -> Popularity not handled in GXS yet.
|
||||||
|
* -> Much more to do.
|
||||||
|
*/
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
ForumsV2Dialog::ForumsV2Dialog(QWidget *parent)
|
ForumsV2Dialog::ForumsV2Dialog(QWidget *parent)
|
||||||
: RsAutoUpdatePage(1000,parent)
|
: RsAutoUpdatePage(1000,parent)
|
||||||
@ -1484,14 +1496,11 @@ void ForumsV2Dialog::copyMessageLink()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//#define DISABLE_OTHERCLASSES 1
|
|
||||||
|
|
||||||
void ForumsV2Dialog::newforum()
|
void ForumsV2Dialog::newforum()
|
||||||
{
|
{
|
||||||
#ifndef DISABLE_OTHERCLASSES
|
|
||||||
CreateForumV2 cf (this);
|
CreateForumV2 cf (this);
|
||||||
cf.exec ();
|
cf.exec ();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ForumsV2Dialog::createmessage()
|
void ForumsV2Dialog::createmessage()
|
||||||
@ -1500,10 +1509,8 @@ void ForumsV2Dialog::createmessage()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_OTHERCLASSES
|
|
||||||
CreateForumV2Msg *cfm = new CreateForumV2Msg(mCurrForumId, mCurrThreadId);
|
CreateForumV2Msg *cfm = new CreateForumV2Msg(mCurrForumId, mCurrThreadId);
|
||||||
cfm->show();
|
cfm->show();
|
||||||
#endif
|
|
||||||
|
|
||||||
/* window will destroy itself! */
|
/* window will destroy itself! */
|
||||||
}
|
}
|
||||||
@ -1515,11 +1522,9 @@ void ForumsV2Dialog::createthread()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_OTHERCLASSES
|
|
||||||
CreateForumV2Msg *cfm = new CreateForumV2Msg(mCurrForumId, "");
|
CreateForumV2Msg *cfm = new CreateForumV2Msg(mCurrForumId, "");
|
||||||
cfm->setWindowTitle(tr("Start New Thread"));
|
cfm->setWindowTitle(tr("Start New Thread"));
|
||||||
cfm->show();
|
cfm->show();
|
||||||
#endif
|
|
||||||
|
|
||||||
/* window will destroy itself! */
|
/* window will destroy itself! */
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,9 @@ public:
|
|||||||
/* overloaded from RsAuthUpdatePage */
|
/* overloaded from RsAuthUpdatePage */
|
||||||
virtual void updateDisplay();
|
virtual void updateDisplay();
|
||||||
|
|
||||||
|
// Callback for all Loads.
|
||||||
|
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
|
|
||||||
@ -199,9 +202,6 @@ private:
|
|||||||
bool convertMsgToThreadWidget(const RsForumV2Msg &msgInfo, std::string authorName,
|
bool convertMsgToThreadWidget(const RsForumV2Msg &msgInfo, std::string authorName,
|
||||||
bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *item);
|
bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *item);
|
||||||
|
|
||||||
// Callback for all Loads.
|
|
||||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
|
||||||
|
|
||||||
TokenQueue *mForumQueue;
|
TokenQueue *mForumQueue;
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,34 +27,42 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <retroshare/rsforums.h>
|
#include <retroshare/rsforumsV2.h>
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#define CREATEFORUMSV2_NEWFORUMID 1
|
||||||
|
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
CreateForumV2::CreateForumV2(QWidget *parent)
|
CreateForumV2::CreateForumV2(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
// connect up the buttons.
|
|
||||||
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
|
|
||||||
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) );
|
|
||||||
connect( ui.pubKeyShare_cb, SIGNAL( clicked() ), this, SLOT( setShareList( ) ));
|
|
||||||
connect( ui.keyShareList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
|
|
||||||
this, SLOT(togglePersonItem( QTreeWidgetItem *, int ) ));
|
|
||||||
|
|
||||||
if(!ui.pubKeyShare_cb->isChecked()){
|
mForumQueue = new TokenQueue(rsForumsV2, this);
|
||||||
|
|
||||||
|
// connect up the buttons.
|
||||||
|
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
|
||||||
|
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) );
|
||||||
|
connect( ui.pubKeyShare_cb, SIGNAL( clicked() ), this, SLOT( setShareList( ) ));
|
||||||
|
|
||||||
|
if (!ui.pubKeyShare_cb->isChecked()) {
|
||||||
ui.contactsdockWidget->hide();
|
ui.contactsdockWidget->hide();
|
||||||
this->resize(this->size().width() - ui.contactsdockWidget->size().width(),
|
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
|
||||||
this->size().height());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newForum();
|
/* initialize key share list */
|
||||||
|
ui.keyShareList->setHeaderText(tr("Contacts:"));
|
||||||
|
ui.keyShareList->setModus(FriendSelectionWidget::MODUS_CHECK);
|
||||||
|
ui.keyShareList->start();
|
||||||
|
|
||||||
|
newForum();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateForumV2::newForum()
|
void CreateForumV2::newForum()
|
||||||
{
|
{
|
||||||
/* enforce Public for the moment */
|
/* enforce Public for the moment */
|
||||||
ui.typePublic->setChecked(true);
|
ui.typePublic->setChecked(true);
|
||||||
@ -72,156 +80,151 @@ void CreateForumV2::newForum()
|
|||||||
|
|
||||||
ui.forumName->clear();
|
ui.forumName->clear();
|
||||||
ui.forumDesc->clear();
|
ui.forumDesc->clear();
|
||||||
|
|
||||||
|
ui.forumName->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateForumV2::togglePersonItem( QTreeWidgetItem *item, int /*col*/ )
|
void CreateForumV2::createForum()
|
||||||
{
|
|
||||||
|
|
||||||
/* extract id */
|
|
||||||
std::string id = (item -> text(1)).toStdString();
|
|
||||||
|
|
||||||
/* get state */
|
|
||||||
bool checked = (Qt::Checked == item -> checkState(0)); /* alway column 0 */
|
|
||||||
|
|
||||||
/* call control fns */
|
|
||||||
std::list<std::string>::iterator lit = std::find(mShareList.begin(), mShareList.end(), id);
|
|
||||||
|
|
||||||
if(checked && (lit == mShareList.end())){
|
|
||||||
|
|
||||||
// make sure ids not added already
|
|
||||||
mShareList.push_back(id);
|
|
||||||
|
|
||||||
}else
|
|
||||||
if(lit != mShareList.end()){
|
|
||||||
|
|
||||||
mShareList.erase(lit);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CreateForumV2::createForum()
|
|
||||||
{
|
{
|
||||||
QString name = misc::removeNewLine(ui.forumName->text());
|
QString name = misc::removeNewLine(ui.forumName->text());
|
||||||
QString desc = ui.forumDesc->toPlainText(); //toHtml();
|
QString desc = ui.forumDesc->toPlainText(); //toHtml();
|
||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
|
|
||||||
if(name.isEmpty())
|
if(name.isEmpty()) {
|
||||||
{ /* error message */
|
/* error message */
|
||||||
QMessageBox::warning(this, "RetroShare",
|
QMessageBox::warning(this, "RetroShare", tr("Please add a Name"), QMessageBox::Ok, QMessageBox::Ok);
|
||||||
tr("Please add a Name"),
|
|
||||||
QMessageBox::Ok, QMessageBox::Ok);
|
|
||||||
return; //Don't add a empty name!!
|
return; //Don't add a empty name!!
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
|
||||||
if (ui.typePublic->isChecked())
|
if (ui.typePublic->isChecked()) {
|
||||||
{
|
|
||||||
flags |= RS_DISTRIB_PUBLIC;
|
flags |= RS_DISTRIB_PUBLIC;
|
||||||
}
|
} else if (ui.typePrivate->isChecked()) {
|
||||||
else if (ui.typePrivate->isChecked())
|
|
||||||
{
|
|
||||||
flags |= RS_DISTRIB_PRIVATE;
|
flags |= RS_DISTRIB_PRIVATE;
|
||||||
}
|
} else if (ui.typeEncrypted->isChecked()) {
|
||||||
else if (ui.typeEncrypted->isChecked())
|
|
||||||
{
|
|
||||||
flags |= RS_DISTRIB_ENCRYPTED;
|
flags |= RS_DISTRIB_ENCRYPTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ui.msgAuth->isChecked())
|
if (ui.msgAuth->isChecked()) {
|
||||||
{
|
|
||||||
flags |= RS_DISTRIB_AUTHEN_REQ;
|
flags |= RS_DISTRIB_AUTHEN_REQ;
|
||||||
}
|
} else if (ui.msgAnon->isChecked()) {
|
||||||
else if (ui.msgAnon->isChecked())
|
|
||||||
{
|
|
||||||
flags |= RS_DISTRIB_AUTHEN_ANON;
|
flags |= RS_DISTRIB_AUTHEN_ANON;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsForums)
|
if (rsForumsV2) {
|
||||||
{
|
|
||||||
std::string forumId = rsForums->createForum(name.toStdWString(),
|
|
||||||
desc.toStdWString(), flags);
|
uint32_t token;
|
||||||
|
RsForumV2Group grp;
|
||||||
if(ui.pubKeyShare_cb->isChecked())
|
grp.mMeta.mGroupName = std::string(name.toUtf8());
|
||||||
rsForums->forumShareKeys(forumId, mShareList);
|
grp.mDescription = std::string(desc.toUtf8());
|
||||||
|
grp.mMeta.mGroupFlags = flags;
|
||||||
|
|
||||||
|
rsForumsV2->createGroup(token, grp, true);
|
||||||
|
|
||||||
|
// get the Queue to handle response.
|
||||||
|
mForumQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_SUMMARY, CREATEFORUMSV2_NEWFORUMID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateForumV2::completeCreateNewForum(const RsGroupMetaData &newForumMeta)
|
||||||
|
{
|
||||||
|
sendShareList(newForumMeta.mGroupId);
|
||||||
|
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateForumV2::setShareList(){
|
|
||||||
|
|
||||||
if(ui.pubKeyShare_cb->isChecked()){
|
void CreateForumV2::sendShareList(std::string forumId)
|
||||||
this->resize(this->size().width() + ui.contactsdockWidget->size().width(),
|
{
|
||||||
this->size().height());
|
if (!rsForumsV2)
|
||||||
ui.contactsdockWidget->show();
|
{
|
||||||
|
std::cerr << "CreateForumV2::sendShareList() ForumsV2 not active";
|
||||||
|
std::cerr << std::endl;
|
||||||
if (!rsPeers)
|
return;
|
||||||
{
|
|
||||||
/* not ready yet! */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::list<std::string> peers;
|
|
||||||
std::list<std::string>::iterator it;
|
|
||||||
|
|
||||||
rsPeers->getFriendList(peers);
|
|
||||||
|
|
||||||
/* get a link to the table */
|
|
||||||
QTreeWidget *shareWidget = ui.keyShareList;
|
|
||||||
|
|
||||||
QList<QTreeWidgetItem *> items;
|
|
||||||
|
|
||||||
for(it = peers.begin(); it != peers.end(); it++)
|
|
||||||
{
|
|
||||||
|
|
||||||
RsPeerDetails detail;
|
|
||||||
if (!rsPeers->getPeerDetails(*it, detail))
|
|
||||||
{
|
|
||||||
continue; /* BAD */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* make a widget per friend */
|
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
|
|
||||||
|
|
||||||
item -> setText(0, PeerDefs::nameWithLocation(detail));
|
|
||||||
if (detail.state & RS_PEER_STATE_CONNECTED) {
|
|
||||||
item -> setTextColor(0,(Qt::darkBlue));
|
|
||||||
}
|
|
||||||
item -> setSizeHint(0, QSize( 17,17 ) );
|
|
||||||
|
|
||||||
item -> setText(1, QString::fromStdString(detail.id));
|
|
||||||
|
|
||||||
item -> setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
|
|
||||||
item -> setCheckState(0, Qt::Unchecked);
|
|
||||||
|
|
||||||
|
|
||||||
/* add to the list */
|
|
||||||
items.append(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* remove old items */
|
|
||||||
shareWidget->clear();
|
|
||||||
shareWidget->setColumnCount(1);
|
|
||||||
|
|
||||||
/* add the items in! */
|
|
||||||
shareWidget->insertTopLevelItems(0, items);
|
|
||||||
|
|
||||||
shareWidget->update(); /* update display */
|
|
||||||
|
|
||||||
}else{ // hide share widget
|
|
||||||
ui.contactsdockWidget->hide();
|
|
||||||
this->resize(this->size().width() - ui.contactsdockWidget->size().width(),
|
|
||||||
this->size().height());
|
|
||||||
mShareList.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ui.pubKeyShare_cb->isChecked())
|
||||||
|
{
|
||||||
|
std::list<std::string> shareList;
|
||||||
|
ui.keyShareList->selectedSslIds(shareList, false);
|
||||||
|
rsForumsV2->groupShareKeys(forumId, shareList);
|
||||||
|
}
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CreateForumV2::cancelForum()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CreateForumV2::setShareList()
|
||||||
|
{
|
||||||
|
if (ui.pubKeyShare_cb->isChecked()){
|
||||||
|
this->resize(this->size().width() + ui.contactsdockWidget->size().width(), this->size().height());
|
||||||
|
ui.contactsdockWidget->show();
|
||||||
|
} else { // hide share widget
|
||||||
|
ui.contactsdockWidget->hide();
|
||||||
|
this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateForumV2::cancelForum()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CreateForumV2::loadNewForumId(const uint32_t &token)
|
||||||
|
{
|
||||||
|
std::cerr << "CreateForumV2::loadNewForumId()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
std::list<RsGroupMetaData> groupInfo;
|
||||||
|
rsForumsV2->getGroupSummary(token, groupInfo);
|
||||||
|
|
||||||
|
if (groupInfo.size() == 1)
|
||||||
|
{
|
||||||
|
RsGroupMetaData fi = groupInfo.front();
|
||||||
|
completeCreateNewForum(fi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << "CreateForumV2::loadNewForumId() ERROR INVALID Number of Forums Created";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CreateForumV2::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||||
|
{
|
||||||
|
std::cerr << "CreateForumV2::loadRequest() UserType: " << req.mUserType;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
if (queue == mForumQueue)
|
||||||
|
{
|
||||||
|
/* now switch on req */
|
||||||
|
switch(req.mUserType)
|
||||||
|
{
|
||||||
|
|
||||||
|
case CREATEFORUMSV2_NEWFORUMID:
|
||||||
|
loadNewForumId(req.mToken);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
std::cerr << "CreateForumV2::loadRequest() UNKNOWN UserType ";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,36 +25,42 @@
|
|||||||
|
|
||||||
#include "ui_CreateForumV2.h"
|
#include "ui_CreateForumV2.h"
|
||||||
|
|
||||||
class CreateForumV2 : public QDialog
|
#include "util/TokenQueue.h"
|
||||||
|
|
||||||
|
class CreateForumV2 : public QDialog, public TokenResponse
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CreateForumV2(QWidget *parent = 0);
|
CreateForumV2(QWidget *parent = 0);
|
||||||
|
|
||||||
void newForum(); /* cleanup */
|
void newForum(); /* cleanup */
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
// Callback for all Loads.
|
||||||
Ui::CreateForumV2 ui;
|
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||||
|
|
||||||
QPixmap picture;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
/* actions to take.... */
|
/* actions to take.... */
|
||||||
void createForum();
|
void createForum();
|
||||||
void cancelForum();
|
void cancelForum();
|
||||||
|
|
||||||
// set private forum key share list
|
// set private forum key share list
|
||||||
void setShareList();
|
void setShareList();
|
||||||
|
|
||||||
// when user checks a person in share list checkboxes
|
|
||||||
void togglePersonItem(QTreeWidgetItem* item, int col);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void sendShareList(std::string forumId);
|
||||||
|
void completeCreateNewForum(const RsGroupMetaData &newForumMeta);
|
||||||
|
void loadNewForumId(const uint32_t &token);
|
||||||
|
|
||||||
std::list<std::string> mShareList;
|
|
||||||
|
|
||||||
|
std::list<std::string> mShareList;
|
||||||
|
|
||||||
|
QPixmap picture;
|
||||||
|
|
||||||
|
TokenQueue *mForumQueue;
|
||||||
|
|
||||||
|
/** Qt Designer generated object */
|
||||||
|
Ui::CreateForumV2 ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -160,7 +160,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTreeWidget" name="keyShareList">
|
<widget class="FriendSelectionWidget" name="keyShareList" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -191,14 +191,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="sortingEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Contacts:</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -267,7 +259,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="pubKeyShare_cb">
|
<widget class="QCheckBox" name="pubKeyShare_cb">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Key recipients can publish to restricted-type channels, and can view and publish for private-type channels </string>
|
<string>Key recipients can publish to restricted-type channels, and can view and publish for private-type channels</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Share Private Publish Key</string>
|
<string>Share Private Publish Key</string>
|
||||||
@ -367,6 +359,14 @@ p, li { white-space: pre-wrap; }
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>FriendSelectionWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/common/FriendSelectionWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -28,7 +28,8 @@
|
|||||||
#include <QDropEvent>
|
#include <QDropEvent>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
#include <retroshare/rsforums.h>
|
#include <retroshare/rsforumsV2.h>
|
||||||
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
@ -37,6 +38,11 @@
|
|||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
#define CREATEFORUMV2MSG_FORUMINFO 1
|
||||||
|
#define CREATEFORUMV2MSG_PARENTMSG 2
|
||||||
|
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
@ -47,6 +53,9 @@ CreateForumV2Msg::CreateForumV2Msg(std::string fId, std::string pId)
|
|||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
|
|
||||||
|
/* Setup Queue */
|
||||||
|
mForumQueue = new TokenQueue(rsForumsV2, this);
|
||||||
|
|
||||||
Settings->loadWidgetInformation(this);
|
Settings->loadWidgetInformation(this);
|
||||||
|
|
||||||
connect( ui.forumMessage, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( forumMessageCostumPopupMenu( QPoint ) ) );
|
connect( ui.forumMessage, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( forumMessageCostumPopupMenu( QPoint ) ) );
|
||||||
@ -64,6 +73,9 @@ CreateForumV2Msg::CreateForumV2Msg(std::string fId, std::string pId)
|
|||||||
ui.hashBox->setDropWidget(this);
|
ui.hashBox->setDropWidget(this);
|
||||||
ui.hashBox->setAutoHide(false);
|
ui.hashBox->setAutoHide(false);
|
||||||
|
|
||||||
|
mParentMsgLoaded = false;
|
||||||
|
mForumMetaLoaded = false;
|
||||||
|
|
||||||
newMsg();
|
newMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +87,7 @@ void CreateForumV2Msg::forumMessageCostumPopupMenu( QPoint /*point*/ )
|
|||||||
contextMnu->addSeparator();
|
contextMnu->addSeparator();
|
||||||
QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
||||||
QAction *pasteLinkFullAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste full RetroShare Link"), this, SLOT(pasteLinkFull()));
|
QAction *pasteLinkFullAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste full RetroShare Link"), this, SLOT(pasteLinkFull()));
|
||||||
|
contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste own certificate link"), this, SLOT(pasteOwnCertificateLink()));
|
||||||
|
|
||||||
if (RSLinkClipboard::empty()) {
|
if (RSLinkClipboard::empty()) {
|
||||||
pasteLinkAct->setDisabled (true);
|
pasteLinkAct->setDisabled (true);
|
||||||
@ -88,60 +101,126 @@ void CreateForumV2Msg::forumMessageCostumPopupMenu( QPoint /*point*/ )
|
|||||||
void CreateForumV2Msg::newMsg()
|
void CreateForumV2Msg::newMsg()
|
||||||
{
|
{
|
||||||
/* clear all */
|
/* clear all */
|
||||||
ForumInfo fi;
|
mParentMsgLoaded = false;
|
||||||
if (rsForums->getForumInfo(mForumId, fi))
|
mForumMetaLoaded = false;
|
||||||
{
|
|
||||||
ForumMsgInfo msg;
|
|
||||||
|
|
||||||
QString name = QString::fromStdWString(fi.forumName);
|
/* request Data */
|
||||||
QString subj;
|
{
|
||||||
if ((mParentId != "") && (rsForums->getForumMessage(mForumId, mParentId, msg)))
|
RsTokReqOptions opts;
|
||||||
{
|
|
||||||
QString title = QString::fromStdWString(msg.title);
|
std::list<std::string> groupIds;
|
||||||
name += " " + tr("In Reply to") + ": ";
|
groupIds.push_back(mForumId);
|
||||||
name += title;
|
|
||||||
|
std::cerr << "ForumsV2Dialog::newMsg() Requesting Group Summary(" << mForumId << ")";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
uint32_t token;
|
||||||
|
mForumQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, groupIds, CREATEFORUMV2MSG_FORUMINFO);
|
||||||
|
|
||||||
QString text = title;
|
}
|
||||||
|
|
||||||
|
if (mParentId != "")
|
||||||
|
{
|
||||||
|
|
||||||
|
RsTokReqOptions opts;
|
||||||
|
|
||||||
|
std::list<std::string> msgIds;
|
||||||
|
msgIds.push_back(mParentId);
|
||||||
|
|
||||||
|
std::cerr << "ForumsV2Dialog::newMsg() Requesting Parent Summary(" << mParentId << ")";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
uint32_t token;
|
||||||
|
mForumQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, CREATEFORUMV2MSG_PARENTMSG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (text.startsWith("Re:", Qt::CaseInsensitive))
|
|
||||||
{
|
|
||||||
subj = title;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
subj = "Re: " + title;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
void CreateForumV2Msg::saveForumInfo(const RsGroupMetaData &meta)
|
||||||
|
{
|
||||||
|
mForumMeta = meta;
|
||||||
|
mForumMetaLoaded = true;
|
||||||
|
|
||||||
|
loadFormInformation();
|
||||||
|
}
|
||||||
|
|
||||||
ui.forumName->setText(misc::removeNewLine(name));
|
void CreateForumV2Msg::saveParentMsg(const RsForumV2Msg &msg)
|
||||||
ui.forumSubject->setText(misc::removeNewLine(subj));
|
{
|
||||||
|
mParentMsg = msg;
|
||||||
|
mParentMsgLoaded = true;
|
||||||
|
|
||||||
|
loadFormInformation();
|
||||||
|
}
|
||||||
|
|
||||||
if (!ui.forumSubject->text().isEmpty())
|
void CreateForumV2Msg::loadFormInformation()
|
||||||
{
|
{
|
||||||
ui.forumMessage->setFocus();
|
if ((!mParentMsgLoaded) && (mParentId != ""))
|
||||||
}
|
{
|
||||||
else
|
std::cerr << "CreateForumV2Msg::loadMsgInformation() ParentMsg not Loaded Yet";
|
||||||
{
|
std::cerr << std::endl;
|
||||||
ui.forumSubject->setFocus();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fi.forumFlags & RS_DISTRIB_AUTHEN_REQ)
|
if (!mForumMetaLoaded)
|
||||||
{
|
{
|
||||||
ui.signBox->setChecked(true);
|
std::cerr << "CreateForumV2Msg::loadMsgInformation() ForumMeta not Loaded Yet";
|
||||||
ui.signBox->setEnabled(false);
|
std::cerr << std::endl;
|
||||||
}
|
return;
|
||||||
else
|
}
|
||||||
{
|
|
||||||
/* Uncheck sign box by default for anonymous forums */
|
std::cerr << "CreateForumV2Msg::loadMsgInformation() Data Available!";
|
||||||
ui.signBox->setChecked(false);
|
std::cerr << std::endl;
|
||||||
ui.signBox->setEnabled(true);
|
|
||||||
}
|
QString name = QString::fromUtf8(mForumMeta.mGroupName.c_str());
|
||||||
}
|
QString subj;
|
||||||
|
if (mParentId != "")
|
||||||
|
{
|
||||||
|
QString title = QString::fromUtf8(mParentMsg.mMeta.mMsgName.c_str());
|
||||||
|
name += " " + tr("In Reply to") + ": ";
|
||||||
|
name += title;
|
||||||
|
|
||||||
|
QString text = title;
|
||||||
|
|
||||||
|
if (text.startsWith("Re:", Qt::CaseInsensitive))
|
||||||
|
{
|
||||||
|
subj = title;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
subj = "Re: " + title;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.forumName->setText(misc::removeNewLine(name));
|
||||||
|
ui.forumSubject->setText(misc::removeNewLine(subj));
|
||||||
|
|
||||||
|
if (!ui.forumSubject->text().isEmpty())
|
||||||
|
{
|
||||||
|
ui.forumMessage->setFocus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.forumSubject->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mForumMeta.mGroupFlags & RS_DISTRIB_AUTHEN_REQ)
|
||||||
|
{
|
||||||
|
ui.signBox->setChecked(true);
|
||||||
|
ui.signBox->setEnabled(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Uncheck sign box by default for anonymous forums */
|
||||||
|
ui.signBox->setChecked(false);
|
||||||
|
ui.signBox->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
ui.forumMessage->setText("");
|
ui.forumMessage->setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CreateForumV2Msg::createMsg()
|
void CreateForumV2Msg::createMsg()
|
||||||
{
|
{
|
||||||
QString name = misc::removeNewLine(ui.forumSubject->text());
|
QString name = misc::removeNewLine(ui.forumSubject->text());
|
||||||
@ -158,30 +237,56 @@ void CreateForumV2Msg::createMsg()
|
|||||||
return; //Don't add a empty Subject!!
|
return; //Don't add a empty Subject!!
|
||||||
}
|
}
|
||||||
|
|
||||||
ForumMsgInfo msgInfo;
|
RsForumV2Msg msg;
|
||||||
|
msg.mMeta.mGroupId = mForumId;
|
||||||
msgInfo.forumId = mForumId;
|
msg.mMeta.mParentId = mParentId;
|
||||||
msgInfo.threadId = "";
|
msg.mMeta.mMsgId = "";
|
||||||
msgInfo.parentId = mParentId;
|
if (mParentMsgLoaded)
|
||||||
msgInfo.msgId = "";
|
{
|
||||||
|
msg.mMeta.mThreadId = mParentMsg.mMeta.mThreadId;
|
||||||
msgInfo.title = name.toStdWString();
|
}
|
||||||
msgInfo.msg = desc.toStdWString();
|
|
||||||
msgInfo.msgflags = 0;
|
msg.mMeta.mMsgName = std::string(name.toUtf8());
|
||||||
|
msg.mMsg = std::string(desc.toUtf8());
|
||||||
if (ui.signBox->isChecked())
|
msg.mMeta.mMsgFlags = RS_DISTRIB_AUTHEN_REQ;
|
||||||
{
|
|
||||||
msgInfo.msgflags = RS_DISTRIB_AUTHEN_REQ;
|
if ((msg.mMsg == "") && (msg.mMeta.mMsgName == ""))
|
||||||
}
|
|
||||||
|
|
||||||
if ((msgInfo.msg == L"") && (msgInfo.title == L""))
|
|
||||||
return; /* do nothing */
|
return; /* do nothing */
|
||||||
|
|
||||||
|
uint32_t token;
|
||||||
|
rsForumsV2->createMsg(token, msg, true);
|
||||||
|
close();
|
||||||
|
|
||||||
|
|
||||||
|
// Previous Info - for reference.
|
||||||
|
|
||||||
|
//ForumMsgInfo msgInfo;
|
||||||
|
|
||||||
if (rsForums->ForumMessageSend(msgInfo) == true) {
|
//msgInfo.forumId = mForumId;
|
||||||
close();
|
//msgInfo.threadId = "";
|
||||||
}
|
//msgInfo.parentId = mParentId;
|
||||||
|
//msgInfo.msgId = "";
|
||||||
|
|
||||||
|
//msgInfo.title = name.toStdWString();
|
||||||
|
//msgInfo.msg = desc.toStdWString();
|
||||||
|
//msgInfo.msgflags = 0;
|
||||||
|
|
||||||
|
//if (ui.signBox->isChecked())
|
||||||
|
//{
|
||||||
|
// msgInfo.msgflags = RS_DISTRIB_AUTHEN_REQ;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if ((msgInfo.msg == L"") && (msgInfo.title == L""))
|
||||||
|
// return; /* do nothing */
|
||||||
|
|
||||||
|
//if (rsForumsV2->ForumMessageSend(msgInfo) == true) {
|
||||||
|
// close();
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CreateForumV2Msg::closeEvent (QCloseEvent * /*event*/)
|
void CreateForumV2Msg::closeEvent (QCloseEvent * /*event*/)
|
||||||
{
|
{
|
||||||
Settings->saveWidgetInformation(this);
|
Settings->saveWidgetInformation(this);
|
||||||
@ -245,3 +350,75 @@ void CreateForumV2Msg::pasteLinkFull()
|
|||||||
{
|
{
|
||||||
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
|
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateForumV2Msg::pasteOwnCertificateLink()
|
||||||
|
{
|
||||||
|
RetroShareLink link ;
|
||||||
|
std::string ownId = rsPeers->getOwnId() ;
|
||||||
|
if( link.createCertificate(ownId) ) {
|
||||||
|
ui.forumMessage->insertHtml(link.toHtml() + " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CreateForumV2Msg::loadForumInfo(const uint32_t &token)
|
||||||
|
{
|
||||||
|
std::cerr << "CreateForumV2Msg::loadForumInfo()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
std::list<RsGroupMetaData> groupInfo;
|
||||||
|
rsForumsV2->getGroupSummary(token, groupInfo);
|
||||||
|
|
||||||
|
if (groupInfo.size() == 1)
|
||||||
|
{
|
||||||
|
RsGroupMetaData fi = groupInfo.front();
|
||||||
|
saveForumInfo(fi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << "CreateForumV2Msg::loadForumInfo() ERROR INVALID Number of Forums";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CreateForumV2Msg::loadParentMsg(const uint32_t &token)
|
||||||
|
{
|
||||||
|
std::cerr << "CreateForumV2Msg::loadParentMsg()";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
// Only grab one.... ignore more (shouldn't be any).
|
||||||
|
RsForumV2Msg msg;
|
||||||
|
rsForumsV2->getMsgData(token, msg);
|
||||||
|
saveParentMsg(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CreateForumV2Msg::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||||
|
{
|
||||||
|
std::cerr << "CreateForumV2::loadRequest() UserType: " << req.mUserType;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
if (queue == mForumQueue)
|
||||||
|
{
|
||||||
|
/* now switch on req */
|
||||||
|
switch(req.mUserType)
|
||||||
|
{
|
||||||
|
case CREATEFORUMV2MSG_FORUMINFO:
|
||||||
|
loadForumInfo(req.mToken);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CREATEFORUMV2MSG_PARENTMSG:
|
||||||
|
loadParentMsg(req.mToken);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
std::cerr << "CreateForumV2::loadRequest() UNKNOWN UserType ";
|
||||||
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,12 @@
|
|||||||
|
|
||||||
#include "ui_CreateForumV2Msg.h"
|
#include "ui_CreateForumV2Msg.h"
|
||||||
|
|
||||||
class CreateForumV2Msg : public QMainWindow
|
#include "util/TokenQueue.h"
|
||||||
|
|
||||||
|
#include <retroshare/rsforumsv2.h>
|
||||||
|
|
||||||
|
|
||||||
|
class CreateForumV2Msg : public QMainWindow, public TokenResponse
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -33,7 +38,8 @@ public:
|
|||||||
CreateForumV2Msg(std::string fId, std::string pId);
|
CreateForumV2Msg(std::string fId, std::string pId);
|
||||||
|
|
||||||
void newMsg(); /* cleanup */
|
void newMsg(); /* cleanup */
|
||||||
|
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void forumMessageCostumPopupMenu( QPoint point );
|
void forumMessageCostumPopupMenu( QPoint point );
|
||||||
@ -44,6 +50,7 @@ private slots:
|
|||||||
void cancelMsg();
|
void cancelMsg();
|
||||||
void pasteLink();
|
void pasteLink();
|
||||||
void pasteLinkFull();
|
void pasteLinkFull();
|
||||||
|
void pasteOwnCertificateLink();
|
||||||
|
|
||||||
void smileyWidgetForums();
|
void smileyWidgetForums();
|
||||||
void addSmileys();
|
void addSmileys();
|
||||||
@ -53,8 +60,23 @@ protected:
|
|||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
void saveForumInfo(const RsGroupMetaData &meta);
|
||||||
|
void saveParentMsg(const RsForumV2Msg &msg);
|
||||||
|
void loadFormInformation();
|
||||||
|
|
||||||
|
void loadForumInfo(const uint32_t &token);
|
||||||
|
void loadParentMsg(const uint32_t &token);
|
||||||
|
|
||||||
std::string mForumId;
|
std::string mForumId;
|
||||||
std::string mParentId;
|
std::string mParentId;
|
||||||
|
|
||||||
|
bool mParentMsgLoaded;
|
||||||
|
bool mForumMetaLoaded;
|
||||||
|
RsForumV2Msg mParentMsg;
|
||||||
|
RsGroupMetaData mForumMeta;
|
||||||
|
|
||||||
|
TokenQueue *mForumQueue;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::CreateForumV2Msg ui;
|
Ui::CreateForumV2Msg ui;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "EditForumV2Details.h"
|
#include "EditForumV2Details.h"
|
||||||
|
|
||||||
#include <retroshare/rsforums.h>
|
#include <retroshare/rsforumsV2.h>
|
||||||
|
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
|
||||||
@ -44,23 +44,27 @@ EditForumV2Details::EditForumV2Details(std::string forumId, QWidget *parent, Qt:
|
|||||||
|
|
||||||
void EditForumV2Details::loadForum()
|
void EditForumV2Details::loadForum()
|
||||||
{
|
{
|
||||||
if (!rsForums) {
|
if (!rsForumsV2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning "EditForumV2Details incomplete"
|
||||||
|
#if 0
|
||||||
ForumInfo info;
|
ForumInfo info;
|
||||||
rsForums->getForumInfo(m_forumId, info);
|
rsForumsV2->getForumInfo(m_forumId, info);
|
||||||
|
|
||||||
// set name
|
// set name
|
||||||
ui.nameline->setText(QString::fromStdWString(info.forumName));
|
ui.nameline->setText(QString::fromStdWString(info.forumName));
|
||||||
|
|
||||||
// set description
|
// set description
|
||||||
ui.DescriptiontextEdit->setText(QString::fromStdWString(info.forumDesc));
|
ui.DescriptiontextEdit->setText(QString::fromStdWString(info.forumDesc));
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditForumV2Details::applyDialog()
|
void EditForumV2Details::applyDialog()
|
||||||
{
|
{
|
||||||
if (!rsForums) {
|
if (!rsForumsV2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,13 +73,17 @@ void EditForumV2Details::applyDialog()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning "EditForumV2Details incomplete"
|
||||||
|
#if 0
|
||||||
|
|
||||||
ForumInfo info;
|
ForumInfo info;
|
||||||
|
|
||||||
info.forumName = misc::removeNewLine(ui.nameline->text()).toStdWString();
|
info.forumName = misc::removeNewLine(ui.nameline->text()).toStdWString();
|
||||||
info.forumDesc = ui.DescriptiontextEdit->document()->toPlainText().toStdWString();
|
info.forumDesc = ui.DescriptiontextEdit->document()->toPlainText().toStdWString();
|
||||||
|
|
||||||
rsForums->setForumInfo(m_forumId, info);
|
rsForumsV2->setForumInfo(m_forumId, info);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* close the Dialog after the Changes applied */
|
/* close the Dialog after the Changes applied */
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
@ -23,12 +23,11 @@
|
|||||||
#include <retroshare/rsiface.h>
|
#include <retroshare/rsiface.h>
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include <retroshare/rsdisc.h>
|
#include <retroshare/rsdisc.h>
|
||||||
#include <retroshare/rsforums.h>
|
#include <retroshare/rsforumsV2.h>
|
||||||
|
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -91,13 +90,15 @@ void ForumV2Details::showDetails(std::string mCurrForumId)
|
|||||||
|
|
||||||
void ForumV2Details::loadDialog()
|
void ForumV2Details::loadDialog()
|
||||||
{
|
{
|
||||||
if (!rsForums)
|
if (!rsForumsV2)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning "ForumV2Details Incomplete"
|
||||||
|
#if 0
|
||||||
ForumInfo fi;
|
ForumInfo fi;
|
||||||
rsForums->getForumInfo(fId, fi);
|
rsForumsV2->getForumInfo(fId, fi);
|
||||||
|
|
||||||
// Set Forum Name
|
// Set Forum Name
|
||||||
ui.nameline->setText(QString::fromStdWString(fi.forumName));
|
ui.nameline->setText(QString::fromStdWString(fi.forumName));
|
||||||
@ -129,6 +130,8 @@ void ForumV2Details::loadDialog()
|
|||||||
ui.radioButton_authd->setChecked(false);
|
ui.radioButton_authd->setChecked(false);
|
||||||
ui.radioButton_anonymous->setChecked(true);
|
ui.radioButton_anonymous->setChecked(true);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ForumV2Details::applyDialog()
|
void ForumV2Details::applyDialog()
|
||||||
|
@ -121,7 +121,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QRadioButton" name="radioButton_authd">
|
<widget class="QRadioButton" name="radioButton_authd">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Authemticated Messages</string>
|
<string>Authenticated Messages</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user