Significant improvements to Forums:

* displays forums
 * displays thread list/msg
 * Threaded/Flat View.
 * Add new Forum / Add new Message.
 * new classes in src/gui/forums

Updated rank and forums interfaces.
Improvements to Link Cloud GUI.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@506 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-04-15 16:40:38 +00:00
parent 129c07a553
commit 5a27165353
15 changed files with 2051 additions and 504 deletions

View File

@ -65,6 +65,8 @@ HEADERS += rshare.h \
gui/PhotoShow.h \
gui/LinksDialog.h \
gui/ForumsDialog.h \
gui/forums/CreateForum.h \
gui/forums/CreateForumMsg.h \
gui/NetworkView.h \
gui/MessengerWindow.h \
gui/PeersDialog.h \
@ -160,6 +162,8 @@ FORMS += gui/ChatDialog.ui \
gui/PhotoShow.ui \
gui/LinksDialog.ui \
gui/ForumsDialog.ui \
gui/forums/CreateForum.ui \
gui/forums/CreateForumMsg.ui \
gui/NetworkView.ui \
gui/MessengerWindow.ui \
gui/PeersDialog.ui \
@ -225,6 +229,8 @@ SOURCES += main.cpp \
gui/PhotoShow.cpp \
gui/LinksDialog.cpp \
gui/ForumsDialog.cpp \
gui/forums/CreateForum.cpp \
gui/forums/CreateForumMsg.cpp \
gui/NetworkView.cpp \
gui/MessengerWindow.cpp \
gui/PeersDialog.cpp \

View File

@ -21,6 +21,8 @@
#include "ForumsDialog.h"
#include "gui/forums/CreateForum.h"
#include "gui/forums/CreateForumMsg.h"
#include "rsiface/rsiface.h"
#include "rsiface/rspeers.h"
@ -38,7 +40,7 @@
#include <QPrinter>
#include <QDateTime>
#include <QHeaderView>
#include <QTimer>
/* Images for context menu icons */
#define IMAGE_MESSAGE ":/images/folder-draft.png"
@ -60,6 +62,23 @@ ForumsDialog::ForumsDialog(QWidget *parent)
connect(ui.newForumButton, SIGNAL(clicked()), this, SLOT(newforum()));
connect( ui.forumTreeWidget, SIGNAL( currentItemChanged ( QTreeWidgetItem *, QTreeWidgetItem *) ), this,
SLOT( changedForum( QTreeWidgetItem *, QTreeWidgetItem * ) ) );
//connect( ui.threadTreeWidget, SIGNAL( currentItemChanged ( QTreeWidgetItem *, QTreeWidgetItem *) ), this,
// SLOT( changedThread( QTreeWidgetItem *, QTreeWidgetItem * ) ) );
connect( ui.threadTreeWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( changedThread2() ) );
connect( ui.viewBox, SIGNAL( currentIndexChanged ( int ) ), this, SLOT( changedThread2() ) );
connect(ui.expandButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
timer->start(1000);
#if 0
connect( ui.msgWidget, SIGNAL( itemClicked ( QTreeWidgetItem *, int) ), this, SLOT( updateMessages ( QTreeWidgetItem *, int) ) );
connect( ui.listWidget, SIGNAL( currentRowChanged ( int) ), this, SLOT( changeBox ( int) ) );
@ -70,7 +89,6 @@ ForumsDialog::ForumsDialog(QWidget *parent)
//connect(ui.actionPrint, SIGNAL(triggered()), this, SLOT(print()));
//connect(ui.actionPrintPreview, SIGNAL(triggered()), this, SLOT(printpreview()));
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
@ -155,10 +173,10 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *replyAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Reply" ), this );
connect( replyAct , SIGNAL( triggered() ), this, SLOT( removemessage() ) );
connect( replyAct , SIGNAL( triggered() ), this, SLOT( createmessage() ) );
QAction *viewAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "View Post" ), this );
connect( viewAct , SIGNAL( triggered() ), this, SLOT( removemessage() ) );
QAction *viewAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "View Whole Thread" ), this );
connect( viewAct , SIGNAL( triggered() ), this, SLOT( showthread() ) );
contextMnu.clear();
contextMnu.addAction( replyAct);
@ -192,7 +210,6 @@ void ForumsDialog::replytomessage()
void ForumsDialog::togglefileview()
{
#if 0
/* if msg header visible -> hide by changing splitter
* three widgets...
*/
@ -202,7 +219,6 @@ void ForumsDialog::togglefileview()
int listSize = 0;
int msgSize = 0;
int recommendSize = 0;
int i = 0;
for(it = sizeList.begin(); it != sizeList.end(); it++, i++)
@ -215,16 +231,12 @@ void ForumsDialog::togglefileview()
{
msgSize = (*it);
}
else if (i == 2)
{
recommendSize = (*it);
}
}
int totalSize = listSize + msgSize + recommendSize;
int totalSize = listSize + msgSize;
bool toShrink = true;
if (recommendSize < (int) totalSize / 10)
if (msgSize < (int) totalSize / 10)
{
toShrink = false;
}
@ -232,22 +244,40 @@ void ForumsDialog::togglefileview()
QList<int> newSizeList;
if (toShrink)
{
newSizeList.push_back(listSize + recommendSize / 3);
newSizeList.push_back(msgSize + recommendSize * 2 / 3);
newSizeList.push_back(totalSize);
newSizeList.push_back(0);
}
else
{
/* no change */
int nlistSize = (totalSize * 2 / 3) * listSize / (listSize + msgSize);
int nMsgSize = (totalSize * 2 / 3) - listSize;
int nlistSize = (totalSize / 2);
int nMsgSize = (totalSize / 2);
newSizeList.push_back(nlistSize);
newSizeList.push_back(nMsgSize);
newSizeList.push_back(totalSize * 1 / 3);
}
ui.msgSplitter->setSizes(newSizeList);
#endif
}
void ForumsDialog::checkUpdate()
{
std::list<std::string> forumIds;
std::list<std::string>::iterator it;
if (!rsForums)
return;
if (rsForums->forumsChanged(forumIds))
{
/* update Forums List */
insertForums();
it = std::find(forumIds.begin(), forumIds.end(), mCurrForumId);
if (it != forumIds.end())
{
/* update threads as well */
insertThreads();
}
}
}
@ -273,6 +303,9 @@ void ForumsDialog::insertForums()
rsForums->getForumList(forumList);
mCurrForumId = "";
mCurrPostId = "";
QList<QTreeWidgetItem *> AdminList;
QList<QTreeWidgetItem *> SubList;
QList<QTreeWidgetItem *> PopList;
@ -456,157 +489,179 @@ void ForumsDialog::insertForums()
return;
}
void ForumsDialog::changedForum( QTreeWidgetItem *curr, QTreeWidgetItem *prev )
{
insertThreads();
}
void ForumsDialog::changedThread( QTreeWidgetItem *curr, QTreeWidgetItem *prev )
{
/* just grab the ids of the current item */
if ((!curr) || (!curr->isSelected()))
{
mCurrPostId = "";
}
else
{
mCurrPostId = (curr->text(5)).toStdString();
insertPost();
}
}
void ForumsDialog::changedThread2()
{
QTreeWidgetItem *curr = ui.threadTreeWidget->currentItem();
/* just grab the ids of the current item */
if ((!curr) || (!curr->isSelected()))
{
mCurrPostId = "";
}
else
{
mCurrPostId = (curr->text(5)).toStdString();
insertPost();
}
}
void ForumsDialog::insertThreads()
{
#if 0
/* get the current Forum */
std::cerr << "ForumsDialog::insertThreads()" << std::endl;
virtual bool getForumList(std::list<ForumInfo> &forumList) = 0;
virtual bool getForumThreadList(std::string fId, std::list<ThreadInfoSummary> &msgs) = 0;
virtual bool getForumThreadMsgList(std::string fId, std::string tId, std::list<ThreadInfoSummary> &msgs) = 0;
virtual bool getForumMessage(std::string fId, std::string mId, ForumMsgInfo &msg) = 0;
std::list<MsgInfoSummary> msgList;
std::list<MsgInfoSummary>::const_iterator it;
rsMsgs -> getMessageSummaries(msgList);
/* get a link to the table */
QTreeWidget *msgWidget = ui.msgWidget;
/* get the MsgId of the current one ... */
std::string cid;
std::string mid;
bool oldSelected = getCurrentMsg(cid, mid);
QTreeWidgetItem *newSelected = NULL;
/* remove old items ??? */
int listrow = ui.listWidget -> currentRow();
//std::cerr << "ForumsDialog::insertMessages()" << std::endl;
//std::cerr << "Current Row: " << listrow << std::endl;
/* check the mode we are in */
unsigned int msgbox = 0;
switch(listrow)
QTreeWidgetItem *forumItem = ui.forumTreeWidget->currentItem();
if ((!forumItem) || (forumItem->parent() == NULL))
{
case 3:
msgbox = RS_MSG_SENTBOX;
break;
case 2:
msgbox = RS_MSG_DRAFTBOX;
break;
case 1:
msgbox = RS_MSG_OUTBOX;
break;
case 0:
default:
msgbox = RS_MSG_INBOX;
break;
/* not an actual forum - clear */
ui.threadTreeWidget->clear();
std::cerr << "ForumsDialog::insertThreads() Current Thread Invalid" << std::endl;
return;
}
QList<QTreeWidgetItem *> items;
for(it = msgList.begin(); it != msgList.end(); it++)
{
/* check the message flags, to decide which
* group it should go in...
*
* InBox
* OutBox
* Drafts
* Sent
*
* FLAGS = OUTGOING.
* -> Outbox/Drafts/Sent
* + SENT -> Sent
* + IN_PROGRESS -> Draft.
* + nuffing -> Outbox.
* FLAGS = INCOMING = (!OUTGOING)
* -> + NEW -> Bold.
*
*/
/* store forumId */
mCurrForumId = (forumItem->text(4)).toStdString();
ui.forumName->setText(forumItem->text(0));
mCurrPostId = "";
std::string fId = mCurrForumId;
if ((it -> msgflags & RS_MSG_BOXMASK) != msgbox)
bool flatView = false;
if (ui.viewBox->currentIndex() == 1)
{
flatView = true;
}
std::list<ThreadInfoSummary> threads;
std::list<ThreadInfoSummary>::iterator tit;
rsForums->getForumThreadList(mCurrForumId, threads);
QList<QTreeWidgetItem *> items;
for(tit = threads.begin(); tit != threads.end(); tit++)
{
std::cerr << "ForumsDialog::insertThreads() Adding TopLevel Thread: mId: ";
std::cerr << tit->msgId << std::endl;
/* add the top threads */
ForumMsgInfo msg;
if (!rsForums->getForumMessage(fId, tit->threadId, msg))
{
//std::cerr << "Msg from other box: " << it->msgflags;
//std::cerr << std::endl;
std::cerr << "ForumsDialog::insertThreads() Failed to Get TopLevel Msg";
std::cerr << std::endl;
continue;
}
/* make a widget per friend */
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
/* So Text should be:
* (1) Msg / Broadcast
* (1b) Person / Channel Name
* (2) Rank
* (3) Date
* (4) Title
* (5) Msg
* (6) File Count
* (7) File Total
/* add Msg */
/* setup
*
*/
// Date First.... (for sorting)
QTreeWidgetItem *item = new QTreeWidgetItem();
{
QDateTime qtime;
qtime.setTime_t(it->ts);
qtime.setTime_t(tit->ts);
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
item -> setText(3, timestamp);
item -> setText(0, timestamp);
}
item->setText(1, QString::fromStdWString(tit->title));
item->setText(2, "author");
item->setText(3, "signed");
item->setText(4, QString::fromStdString(tit->parentId));
item->setText(5, QString::fromStdString(tit->msgId));
// From ....
std::list<QTreeWidgetItem *> threadlist;
threadlist.push_back(item);
while (threadlist.size() > 0)
{
item -> setText(1, QString::fromStdString(rsPeers->getPeerName(it->srcId)));
}
/* get children */
QTreeWidgetItem *parent = threadlist.front();
threadlist.pop_front();
std::string pId = (parent->text(5)).toStdString();
// Subject
item -> setText(2, QString::fromStdWString(it->title));
item -> setIcon(2, (QIcon(":/images/message-mail-read.png")));
std::list<ThreadInfoSummary> msgs;
std::list<ThreadInfoSummary>::iterator mit;
// No of Files.
{
std::ostringstream out;
out << it -> count;
item -> setText(0, QString::fromStdString(out.str()));
}
std::cerr << "ForumsDialog::insertThreads() Getting Children of : " << pId;
std::cerr << std::endl;
item -> setText(4, QString::fromStdString(it->srcId));
item -> setText(5, QString::fromStdString(it->msgId));
if ((oldSelected) && (mid == it->msgId))
{
newSelected = item;
}
if (it -> msgflags & RS_MSG_NEW)
{
for(int i = 0; i < 10; i++)
if (rsForums->getForumThreadMsgList(fId, pId, msgs))
{
QFont qf = item->font(i);
qf.setBold(true);
item->setFont(i, qf);
item -> setIcon(2, (QIcon(":/images/message-mail.png")));
std::cerr << "ForumsDialog::insertThreads() #Children " << msgs.size();
std::cerr << std::endl;
//std::cerr << "Setting Item BOLD!" << std::endl;
/* iterate through child */
for(mit = msgs.begin(); mit != msgs.end(); mit++)
{
std::cerr << "ForumsDialog::insertThreads() adding " << mit->msgId;
std::cerr << std::endl;
QTreeWidgetItem *child = NULL;
if (flatView)
{
child = new QTreeWidgetItem(NULL);
}
else
{
child = new QTreeWidgetItem(parent);
}
{
QDateTime qtime;
qtime.setTime_t(mit->ts);
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
child -> setText(0, timestamp);
}
child->setText(1, QString::fromStdWString(mit->title));
child->setText(2, "author");
child->setText(3, "signed");
child->setText(4, QString::fromStdString(mit->parentId));
child->setText(5, QString::fromStdString(mit->msgId));
/* setup child */
threadlist.push_back(child);
if (flatView)
{
items.append(child);
}
}
}
}
/* add to the list */
/* add to list */
items.append(item);
}
/* add the items in! */
msgWidget->clear();
msgWidget->insertTopLevelItems(0, items);
/* add all messages in! */
ui.threadTreeWidget->clear();
ui.threadTreeWidget->insertTopLevelItems(0, items);
if (newSelected)
{
msgWidget->setCurrentItem(newSelected);
}
#endif
}
void ForumsDialog::updateMessages( QTreeWidgetItem * item, int column )
{
#if 0
@ -618,169 +673,29 @@ void ForumsDialog::updateMessages( QTreeWidgetItem * item, int column )
void ForumsDialog::insertPost()
{
#if 0
/* Locate the current Message */
QTreeWidget *msglist = ui.msgWidget;
std::cerr << "ForumsDialog::insertMsgTxtAndFiles()" << std::endl;
/* get its Ids */
std::string cid;
std::string mid;
QTreeWidgetItem *qtwi = msglist -> currentItem();
if (!qtwi)
if ((mCurrForumId == "") || (mCurrPostId == ""))
{
/* blank it */
ui.dateText-> setText("");
ui.toText->setText("");
ui.fromText->setText("");
ui.filesText->setText("");
/*
*/
ui.subjectText->setText("");
//ui.msgText->setText("");
ui.msgList->clear();
return;
}
else
{
cid = qtwi -> text(4).toStdString();
mid = qtwi -> text(5).toStdString();
}
std::cerr << "ForumsDialog::insertMsgTxtAndFiles() mid:" << mid << std::endl;
/* Save the Data.... for later */
mCurrCertId = cid;
mCurrMsgId = mid;
MessageInfo msgInfo;
if (!rsMsgs -> getMessage(mid, msgInfo))
{
std::cerr << "ForumsDialog::insertMsgTxtAndFiles() Couldn't find Msg" << std::endl;
ui.postText->setText("");
return;
}
const std::list<FileInfo> &recList = msgInfo.files;
std::list<FileInfo>::const_iterator it;
/* get a link to the table */
QTreeWidget *tree = ui.msgList;
/* get the MessageInfo */
tree->clear();
tree->setColumnCount(5);
QList<QTreeWidgetItem *> items;
for(it = recList.begin(); it != recList.end(); it++)
/* get the Post */
ForumMsgInfo msg;
if (!rsForums->getForumMessage(mCurrForumId, mCurrPostId, msg))
{
/* make a widget per person */
QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)0);
/* (0) Filename */
item -> setText(0, QString::fromStdString(it->fname));
//std::cerr << "Msg FileItem(" << it->fname.length() << ") :" << it->fname << std::endl;
/* (1) Size */
{
std::ostringstream out;
out << it->size;
item -> setText(1, QString::fromStdString(out.str()));
}
/* (2) Rank */
{
std::ostringstream out;
out << it->rank;
item -> setText(2, QString::fromStdString(out.str()));
}
item -> setText(3, QString::fromStdString(it->hash));
/* add to the list */
items.append(item);
ui.postText->setText("");
return;
}
/* add the items in! */
tree->insertTopLevelItems(0, items);
/* iterate through the sources */
std::list<std::string>::const_iterator pit;
QString msgTxt;
for(pit = msgInfo.msgto.begin(); pit != msgInfo.msgto.end(); pit++)
{
msgTxt += QString::fromStdString(*pit);
msgTxt += " <";
msgTxt += QString::fromStdString(rsPeers->getPeerName(*pit));
msgTxt += ">, ";
}
if (msgInfo.msgcc.size() > 0)
msgTxt += "\nCc: ";
for(pit = msgInfo.msgcc.begin(); pit != msgInfo.msgcc.end(); pit++)
{
msgTxt += QString::fromStdString(*pit);
msgTxt += " <";
msgTxt += QString::fromStdString(rsPeers->getPeerName(*pit));
msgTxt += ">, ";
}
if (msgInfo.msgbcc.size() > 0)
msgTxt += "\nBcc: ";
for(pit = msgInfo.msgbcc.begin(); pit != msgInfo.msgbcc.end(); pit++)
{
msgTxt += QString::fromStdString(*pit);
msgTxt += " <";
msgTxt += QString::fromStdString(rsPeers->getPeerName(*pit));
msgTxt += ">, ";
}
{
QDateTime qtime;
qtime.setTime_t(msgInfo.ts);
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
ui.dateText-> setText(timestamp);
}
ui.toText->setText(msgTxt);
ui.fromText->setText(QString::fromStdString(rsPeers->getPeerName(msgInfo.srcId)));
ui.subjectText->setText(QString::fromStdWString(msgInfo.title));
ui.msgText->setText(QString::fromStdWString(msgInfo.msg));
{
std::ostringstream out;
out << "(" << msgInfo.count << " Files)";
ui.filesText->setText(QString::fromStdString(out.str()));
}
std::cerr << "ForumsDialog::insertMsgTxtAndFiles() Msg Displayed OK!" << std::endl;
/* finally mark message as read! */
rsMsgs -> MessageRead(mid);
#endif
ui.postText->setHtml(QString::fromStdWString(msg.msg));
}
bool ForumsDialog::getCurrentMsg(std::string &cid, std::string &mid)
{
#if 0
/* Locate the current Message */
QTreeWidget *msglist = ui.msgWidget;
//std::cerr << "ForumsDialog::getCurrentMsg()" << std::endl;
/* get its Ids */
QTreeWidgetItem *qtwi = msglist -> currentItem();
if (qtwi)
{
cid = qtwi -> text(4).toStdString();
mid = qtwi -> text(5).toStdString();
return true;
}
#endif
return false;
}
@ -828,7 +743,36 @@ void ForumsDialog::markMsgAsRead()
void ForumsDialog::newforum()
{
insertForums();
CreateForum *cf = new CreateForum(NULL);
cf->show();
//insertForums();
}
void ForumsDialog::createmessage()
{
if (mCurrForumId == "")
{
return;
}
CreateForumMsg *cfm = new CreateForumMsg(mCurrForumId, mCurrPostId);
cfm->show();
}
void ForumsDialog::showthread()
{
if (mCurrForumId == "")
{
return;
}
CreateForumMsg *cfm = new CreateForumMsg(mCurrForumId, "");
cfm->show();
}

View File

@ -44,6 +44,12 @@ private slots:
void newforum();
void checkUpdate();
void changedForum( QTreeWidgetItem *curr, QTreeWidgetItem *prev );
void changedThread( QTreeWidgetItem *curr, QTreeWidgetItem *prev );
void changedThread2();
void changeBox( int newrow );
void updateMessages ( QTreeWidgetItem * item, int column );
@ -59,6 +65,9 @@ void updateMessages ( QTreeWidgetItem * item, int column );
/* handle splitter */
void togglefileview();
void showthread();
void createmessage();
private:
bool getCurrentMsg(std::string &cid, std::string &mid);

View File

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>673</width>
<height>430</height>
<width>485</width>
<height>422</height>
</rect>
</property>
<property name="sizePolicy" >
@ -506,11 +506,11 @@
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QSplitter" name="splitter_2" >
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="" >
<widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" >
<item>
<widget class="QTreeWidget" name="forumTreeWidget" >
@ -538,61 +538,6 @@
<string>Posts</string>
</property>
</column>
<item>
<property name="text" >
<string>Subscribed Forums</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
<item>
<property name="text" >
<string>RS Forums</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
</item>
</item>
<item>
<property name="text" >
<string>Popular Forums</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
<item>
<property name="text" >
<string>Rs Forums</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
</item>
</item>
<item>
<property name="text" >
<string>Other Forums</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
</item>
</widget>
</item>
<item>
@ -604,7 +549,7 @@
</item>
</layout>
</widget>
<widget class="QSplitter" name="splitter" >
<widget class="QSplitter" name="msgSplitter" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
@ -645,7 +590,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="subjectText_2" >
<widget class="QLabel" name="forumName" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>2</horstretch>
@ -669,6 +614,20 @@
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="viewBox" >
<item>
<property name="text" >
<string>Threaded View</string>
</property>
</item>
<item>
<property name="text" >
<string>Flat View</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
@ -676,14 +635,17 @@
<property name="contextMenuPolicy" >
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled" >
<bool>true</bool>
</property>
<column>
<property name="text" >
<string>Title</string>
<string>Date</string>
</property>
</column>
<column>
<property name="text" >
<string>Date</string>
<string>Title</string>
</property>
</column>
<column>
@ -696,48 +658,6 @@
<string>Signed</string>
</property>
</column>
<item>
<property name="text" >
<string>Thread 1</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
<item>
<property name="text" >
<string>Thread 1 Post 2</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
</item>
<item>
<property name="text" >
<string>Thread 1 Post 3</string>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
<property name="text" >
<string/>
</property>
</item>
</item>
</widget>
</item>
<item>
@ -796,7 +716,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item row="0" column="0" >
<widget class="QPushButton" name="expandFilesButton_2" >
<widget class="QPushButton" name="expandButton" >
<property name="text" >
<string/>
</property>

View File

@ -80,6 +80,7 @@ LinksDialog::LinksDialog(QWidget *parent)
connect( ui.linkTreeWidget, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int ) ),
this, SLOT( openLink ( QTreeWidgetItem *, int ) ) );
connect( ui.anonBox, SIGNAL( stateChanged ( int ) ), this, SLOT( checkAnon ( void ) ) );
@ -237,6 +238,7 @@ void LinksDialog::changedSortFrom( int index )
updateLinks();
}
#define ENTRIES_PER_BLOCK 100
void LinksDialog::changedSortTop( int index )
{
@ -253,19 +255,19 @@ void LinksDialog::changedSortTop( int index )
case 0:
mStart = 0;
break;
case 1:
mStart = 1 * ENTRIES_PER_BLOCK;
break;
case 2:
mStart = 100;
mStart = 2 * ENTRIES_PER_BLOCK;
break;
case 3:
mStart = 200;
mStart = 3 * ENTRIES_PER_BLOCK;
break;
case 4:
mStart = 300;
mStart = 4 * ENTRIES_PER_BLOCK;
break;
case 5:
mStart = 400;
break;
case 6:
mStart = -1;
break;
}
@ -281,11 +283,13 @@ void LinksDialog::updateLinks()
std::list<std::string>::iterator rit;
std::list<RsRankComment>::iterator cit;
std::cerr << "LinksDialog::updateLinks()" << std::endl;
/* Work out the number/entries to show */
uint32_t count = rsRanks->getRankingsCount();
uint32_t start;
uint32_t entries = 100;
uint32_t entries = ENTRIES_PER_BLOCK;
if (count < entries)
{
entries = count;
@ -367,15 +371,44 @@ void LinksDialog::updateLinks()
/* create items */
QTreeWidgetItem *child = new QTreeWidgetItem((QTreeWidget*)0);
QString commentText;
QString peerScore;
if (cit->score > 1)
{
peerScore = "[+2] ";
//peerScore = "[+2 Great Link] ";
}
else if (cit->score == 1)
{
peerScore = "[+1] ";
//peerScore = "[+1 Good] ";
}
else if (cit->score == 0)
{
peerScore = "[+0] ";
//peerScore = "[+0 Okay] ";
}
else if (cit->score == -1)
{
peerScore = "[-1] ";
//peerScore = "[-1 Not Worth It] ";
}
else //if (cit->score < -1)
{
peerScore = "[-2 BAD] ";
//peerScore = "[-2 BAD Link] ";
}
/* (0) Comment */
if (cit->comment != L"")
{
child -> setText(0, QString::fromStdWString(cit->comment));
commentText = peerScore + QString::fromStdWString(cit->comment);
}
else
{
child -> setText(0, "No Comment");
commentText = peerScore + "No Comment";
}
child -> setText(0, commentText);
/* (2) Peer / Date */
{
@ -388,9 +421,10 @@ void LinksDialog::updateLinks()
{
peerLabel = "<";
peerLabel += QString::fromStdString(cit->id);
peerLabel = ">";
peerLabel += ">";
}
peerLabel += " ";
peerLabel += " ";
peerLabel += timestamp;
child -> setText(2, peerLabel);
@ -493,6 +527,27 @@ void LinksDialog::changedItem(QTreeWidgetItem *curr, QTreeWidgetItem *prev)
}
}
void LinksDialog::checkAnon()
{
changedItem(ui.linkTreeWidget->currentItem(), NULL);
}
int IndexToScore(int index)
{
if ((index == -1) || (index > 4))
return 0;
int score = 2 - index;
return score;
}
int ScoreToIndex(int score)
{
if ((score < -2) || (score > 2))
return 2;
int index = 2 - score;
return index;
}
/* get the list of Links from the RsRanks. */
@ -500,26 +555,43 @@ void LinksDialog::updateComments(std::string rid, std::string pid)
{
std::list<RsRankComment>::iterator cit;
if (rid == "")
if (ui.anonBox->isChecked())
{
/* empty everything */
ui.titleLineEdit->setText("");
ui.linkLineEdit->setText("");
ui.linkTextEdit->setText("");
ui.scoreBox->setCurrentIndex(ScoreToIndex(0));
mLinkId = "";
/* disable comment + score */
ui.scoreBox->setEnabled(false);
ui.linkTextEdit->setEnabled(false);
/* done! */
return;
}
else
{
/* enable comment + score */
ui.scoreBox->setEnabled(true);
ui.linkTextEdit->setEnabled(true);
}
RsRankDetails detail;
if ((rid == "") || (!rsRanks->getRankDetails(rid, detail)))
{
/* clear it up */
ui.titleLineEdit->setText("");
ui.linkLineEdit->setText("");
ui.linkTextEdit->setText("");
ui.scoreBox->setCurrentIndex(ScoreToIndex(0));
mLinkId = rid;
return;
}
RsRankDetails detail;
if (!rsRanks->getRankDetails(rid, detail))
{
/* clear it up */
ui.titleLineEdit->setText("");
ui.linkLineEdit->setText("");
ui.linkTextEdit->setText("");
mLinkId = "";
return;
}
/* set Link details */
ui.titleLineEdit->setText(QString::fromStdWString(detail.title));
@ -547,74 +619,16 @@ void LinksDialog::updateComments(std::string rid, std::string pid)
{
QString comment = QString::fromStdWString(cit->comment);
ui.linkTextEdit->setText(comment);
ui.scoreBox->setCurrentIndex(ScoreToIndex(cit->score));
}
else
{
ui.linkTextEdit->setText("");
ui.scoreBox->setCurrentIndex(ScoreToIndex(0));
}
return;
#if 0
for(cit = detail.comments.begin(); cit != detail.comments.end(); cit++)
{
if (cit->id == pid)
break;
}
if (cit != detail.comments.end())
{
/* one comment selected */
QString comment;
QDateTime qtime;
qtime.setTime_t(cit->timestamp);
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
comment += "Submitter: ";
comment += QString::fromStdString(rsPeers->getPeerName(cit->id));
comment += " Date: ";
comment += timestamp;
comment += "\n";
comment += QString::fromStdWString(cit->comment);
ui.linkTextEdit->setText(comment);
return;
}
QString comment;
for(cit = detail.comments.begin(); cit != detail.comments.end(); cit++)
{
/* add all comments */
QDateTime qtime;
qtime.setTime_t(cit->timestamp);
QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss");
comment += "Submitter: ";
comment += QString::fromStdString(rsPeers->getPeerName(cit->id));
comment += " Date: ";
comment += timestamp;
comment += "\n";
comment += QString::fromStdWString(cit->comment);
comment += "\n====================================================";
comment += "====================================================\n";
}
ui.linkTextEdit->setText(comment);
/* ....
* */
/**
mLinkId = rid;
mPeerId = pid;
mCommentFilled = true;
**/
#endif
}
void LinksDialog::addLinkComment( void )
@ -623,6 +637,7 @@ void LinksDialog::addLinkComment( void )
QString title = ui.titleLineEdit->text();
QString link = ui.linkLineEdit->text();
QString comment = ui.linkTextEdit->toPlainText();
int32_t score = IndexToScore(ui.scoreBox->currentIndex());
if (mLinkId == "")
{
@ -635,10 +650,19 @@ void LinksDialog::addLinkComment( void )
/* can't do anything */
return;
}
rsRanks->newRankMsg(
link.toStdWString(),
title.toStdWString(),
comment.toStdWString());
/* add it either way */
if (ui.anonBox->isChecked())
{
rsRanks->anonRankMsg(link.toStdWString(), title.toStdWString());
}
else
{
rsRanks->newRankMsg(
link.toStdWString(),
title.toStdWString(),
comment.toStdWString(), score);
}
updateLinks();
return;
@ -669,7 +693,8 @@ void LinksDialog::addLinkComment( void )
}
rsRanks->updateComment(mLinkId,
comment.toStdWString());
comment.toStdWString(),
score);
}
else
{
@ -689,7 +714,8 @@ void LinksDialog::addLinkComment( void )
rsRanks->newRankMsg(
link.toStdWString(),
title.toStdWString(),
comment.toStdWString());
comment.toStdWString(),
score);
}
}
updateLinks();

View File

@ -57,6 +57,7 @@ void toggleWindows( void );
void openLink ( QTreeWidgetItem * item, int column );
void changedItem(QTreeWidgetItem *curr, QTreeWidgetItem *prev);
void checkAnon();
void checkUpdate();

View File

@ -5,23 +5,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>633</width>
<height>530</height>
<width>650</width>
<height>529</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QGridLayout" >
<property name="topMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="linksiconlabel" >
<property name="text" >
@ -326,12 +317,26 @@ p, li { white-space: pre-wrap; }
</property>
<property name="sizeHint" >
<size>
<width>441</width>
<height>20</height>
<width>311</width>
<height>32</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="anonBox" >
<property name="font" >
<font>
<pointsize>12</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text" >
<string>Add Anonymous Link</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addButton" >
<property name="font" >
@ -347,8 +352,8 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_6" >
<property name="font" >
<font>
@ -362,7 +367,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="1" >
<item>
<widget class="QLineEdit" name="titleLineEdit" >
<property name="font" >
<font>
@ -371,7 +376,54 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="0" >
<item>
<widget class="QLabel" name="label_8" >
<property name="font" >
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Score:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="scoreBox" >
<item>
<property name="text" >
<string>+2 Great!</string>
</property>
</item>
<item>
<property name="text" >
<string>+1 Good</string>
</property>
</item>
<item>
<property name="text" >
<string>0 Okay</string>
</property>
</item>
<item>
<property name="text" >
<string>-1 Sux</string>
</property>
</item>
<item>
<property name="text" >
<string>-2 Bad Link</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_7" >
<property name="font" >
<font>
@ -385,7 +437,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="1" >
<item>
<widget class="QLineEdit" name="linkLineEdit" >
<property name="font" >
<font>

View File

@ -0,0 +1,90 @@
/****************************************************************
* 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.
****************************************************************/
#include "CreateForum.h"
#include "rsiface/rsforums.h"
/** Constructor */
CreateForum::CreateForum(QWidget *parent)
: QWidget(parent)
{
/* Invoke the Qt Designer generated object setup routine */
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( ) ) );
newForum();
}
void CreateForum::newForum()
{
/* clear all */
ui.forumTypePublic->setChecked(true);
ui.forumMsgAnon->setChecked(true);
}
void CreateForum::createForum()
{
QString name = ui.forumName->text();
QString desc = ui.forumDesc->toHtml();
uint32_t flags = 0;
if (ui.forumTypePublic->isChecked())
{
flags |= RS_FORUM_PUBLIC;
}
else if (ui.forumTypePrivate->isChecked())
{
flags |= RS_FORUM_PRIVATE;
}
else if (ui.forumTypeEncrypted->isChecked())
{
flags |= RS_FORUM_ENCRYPTED;
}
if (ui.forumMsgAuth->isChecked())
{
flags |= RS_FORUM_MSG_AUTH;
}
else if (ui.forumMsgAnon->isChecked())
{
flags |= RS_FORUM_MSG_ANON;
}
rsForums->createForum(name.toStdWString(), desc.toStdWString(), flags);
close();
return;
}
void CreateForum::cancelForum()
{
close();
return;
}

View File

@ -0,0 +1,52 @@
/****************************************************************
* 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.
****************************************************************/
#ifndef _CREATE_FORUM_DIALOG_H
#define _CREATE_FORUM_DIALOG_H
#include <QMainWindow>
#include "ui_CreateForum.h"
class CreateForum : public QWidget
{
Q_OBJECT
public:
CreateForum(QWidget *parent = 0);
void newForum(); /* cleanup */
private slots:
/* actions to take.... */
void createForum();
void cancelForum();
private:
/** Qt Designer generated object */
Ui::CreateForum ui;
};
#endif

View File

@ -0,0 +1,658 @@
<ui version="4.0" >
<class>CreateForum</class>
<widget class="QWidget" name="CreateForum" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>428</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette" >
<palette>
<active>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>192</red>
<green>192</green>
<blue>192</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font" >
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum>
</property>
<property name="windowTitle" >
<string>Create a Forum</string>
</property>
<property name="windowIcon" >
<iconset>../msgs</iconset>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Forum Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumName" />
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Forum Description</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="forumDesc" />
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<string>Forum Type:</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="forumTypePublic" >
<property name="text" >
<string>Public Forum (Shared Publish Key)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="forumTypePrivate" >
<property name="text" >
<string>Private Forum (Private Publish Key)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="forumTypeEncrypted" >
<property name="text" >
<string>Encrypted Forum (Private Publish Key required to view Messages)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Allowed Messages</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QRadioButton" name="forumMsgAuth" >
<property name="text" >
<string>Authemticated Messages</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="forumMsgAnon" >
<property name="text" >
<string>Anonymous Messages</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel Forum</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="createButton" >
<property name="text" >
<string>Create Forum</string>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>createButton</tabstop>
</tabstops>
<resources>
<include location="../images.qrc" />
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,76 @@
/****************************************************************
* 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.
****************************************************************/
#include "CreateForumMsg.h"
#include "rsiface/rsforums.h"
/** Constructor */
CreateForumMsg::CreateForumMsg(std::string fId, std::string pId)
: QWidget(NULL), mForumId(fId), mParentId(pId)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
// connect up the buttons.
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelMsg( ) ) );
connect( ui.postButton, SIGNAL( clicked ( bool ) ), this, SLOT( createMsg( ) ) );
newMsg();
}
void CreateForumMsg::newMsg()
{
/* clear all */
}
void CreateForumMsg::createMsg()
{
QString name = ui.forumSubject->text();
QString desc = ui.forumMessage->toHtml();
ForumMsgInfo msgInfo;
msgInfo.forumId = mForumId;
msgInfo.threadId = "";
msgInfo.parentId = mParentId;
msgInfo.msgId = "";
msgInfo.title = name.toStdWString();
msgInfo.msg = desc.toStdWString();
rsForums->ForumMessageSend(msgInfo);
close();
return;
}
void CreateForumMsg::cancelMsg()
{
close();
return;
}

View File

@ -0,0 +1,56 @@
/****************************************************************
* 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.
****************************************************************/
#ifndef _CREATE_FORUM_MSG_DIALOG_H
#define _CREATE_FORUM_MSG_DIALOG_H
#include <QWidget>
#include <string>
#include "ui_CreateForumMsg.h"
class CreateForumMsg : public QWidget
{
Q_OBJECT
public:
CreateForumMsg(std::string fId, std::string pId);
void newMsg(); /* cleanup */
private slots:
/* actions to take.... */
void createMsg();
void cancelMsg();
private:
std::string mForumId;
std::string mParentId;
/** Qt Designer generated object */
Ui::CreateForumMsg ui;
};
#endif

View File

@ -0,0 +1,643 @@
<ui version="4.0" >
<class>CreateForumMsg</class>
<widget class="QWidget" name="CreateForumMsg" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>358</width>
<height>435</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette" >
<palette>
<active>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>192</red>
<green>192</green>
<blue>192</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>139</red>
<green>139</green>
<blue>139</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>128</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>231</red>
<green>231</green>
<blue>231</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font" >
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum>
</property>
<property name="windowTitle" >
<string>Post Forum Msg</string>
</property>
<property name="windowIcon" >
<iconset>../msgs</iconset>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Forum</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumName" />
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Forum Post Subject</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="forumSubject" />
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Forum Post</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="signBox" >
<property name="text" >
<string>Sign Message</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="forumMessage" />
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>Cancel Msg</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="postButton" >
<property name="text" >
<string>Post Forum Msg</string>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>postButton</tabstop>
</tabstops>
<resources>
<include location="../images.qrc" />
</resources>
<connections/>
</ui>

View File

@ -37,6 +37,9 @@
#define RS_FORUM_PRIVATE 0x0002 /* anyone with key can publish */
#define RS_FORUM_ENCRYPTED 0x0004 /* need admin key */
#define RS_FORUM_MSG_AUTH 0x0010 /* you must sign messages */
#define RS_FORUM_MSG_ANON 0x0020 /* you can send anonymous messages */
#define RS_FORUM_ADMIN 0x0100 /* anyone can publish */
#define RS_FORUM_SUBSCRIBED 0x0200 /* anyone can publish */
@ -61,8 +64,11 @@ class ForumMsgInfo
ForumMsgInfo() {}
std::string forumId;
std::string threadId;
std::string parentId;
std::string msgId;
std::string srcId; /* if Authenticated -> signed here */
unsigned int msgflags;
std::wstring title;
@ -75,13 +81,15 @@ class ThreadInfoSummary
{
public:
ThreadInfoSummary() {}
std::string forumId;
std::string threadId;
std::string parentId;
std::string msgId;
std::string srcId;
uint32_t msgflags;
std::wstring title;
std::wstring msg;
int count; /* file count */
time_t ts;
@ -105,9 +113,12 @@ virtual ~RsForums() { return; }
virtual bool forumsChanged(std::list<std::string> &forumIds) = 0;
virtual std::string createForum(std::wstring forumName, std::wstring forumDesc, uint32_t forumFlags) = 0;
virtual bool getForumList(std::list<ForumInfo> &forumList) = 0;
virtual bool getForumThreadList(std::string fId, std::list<ThreadInfoSummary> &msgs) = 0;
virtual bool getForumThreadMsgList(std::string fId, std::string tId, std::list<ThreadInfoSummary> &msgs) = 0;
virtual bool getForumThreadMsgList(std::string fId, std::string pId, std::list<ThreadInfoSummary> &msgs) = 0;
virtual bool getForumMessage(std::string fId, std::string mId, ForumMsgInfo &msg) = 0;
virtual bool ForumMessageSend(ForumMsgInfo &info) = 0;

View File

@ -40,6 +40,7 @@ class RsRankComment
std::string id;
std::wstring comment;
int32_t score;
time_t timestamp;
};
@ -85,8 +86,10 @@ virtual bool getRankings(uint32_t first, uint32_t count, std::list<std::string>
virtual bool getRankDetails(std::string rid, RsRankDetails &details) = 0;
/* Add New Comment / Msg */
virtual std::string newRankMsg(std::wstring link, std::wstring title, std::wstring comment) = 0;
virtual bool updateComment(std::string rid, std::wstring comment) = 0;
virtual std::string newRankMsg(std::wstring link, std::wstring title, std::wstring comment, int32_t score) = 0;
virtual bool updateComment(std::string rid, std::wstring comment, int32_t score) = 0;
virtual std::string anonRankMsg(std::wstring link, std::wstring title) = 0;
};