mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-02 03:16:18 -05:00
Added Reply to Author feature for each Forum Message
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1987 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d549d8d144
commit
7017a35581
@ -23,6 +23,7 @@
|
||||
#include "gui/forums/CreateForum.h"
|
||||
#include "gui/forums/CreateForumMsg.h"
|
||||
#include "gui/forums/ForumDetails.h"
|
||||
#include "msgs/ChanMsgDialog.h"
|
||||
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "rsiface/rspeers.h"
|
||||
@ -169,10 +170,14 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
|
||||
|
||||
QAction *viewAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "Start New Thread" ), this );
|
||||
connect( viewAct , SIGNAL( triggered() ), this, SLOT( showthread() ) );
|
||||
|
||||
QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr( "Reply to Author" ), this );
|
||||
connect( replyauthorAct , SIGNAL( triggered() ), this, SLOT( replytomessage() ) );
|
||||
|
||||
contextMnu.clear();
|
||||
contextMnu.addAction( replyAct);
|
||||
contextMnu.addAction( viewAct);
|
||||
contextMnu.addAction( replyauthorAct);
|
||||
contextMnu.exec( mevent->globalPos() );
|
||||
|
||||
}
|
||||
@ -193,13 +198,6 @@ void ForumsDialog::newmessage()
|
||||
/* window will destroy itself! */
|
||||
}
|
||||
|
||||
void ForumsDialog::replytomessage()
|
||||
{
|
||||
/* put msg on msgBoard, and switch to it. */
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ForumsDialog::togglefileview()
|
||||
{
|
||||
/* if msg header visible -> hide by changing splitter
|
||||
@ -914,7 +912,6 @@ void ForumsDialog::createmessage()
|
||||
cfm->show();
|
||||
}
|
||||
|
||||
|
||||
void ForumsDialog::showthread()
|
||||
{
|
||||
if (mCurrForumId == "")
|
||||
@ -1030,4 +1027,41 @@ void ForumsDialog::loadForumEmoticons()
|
||||
}
|
||||
}
|
||||
|
||||
void ForumsDialog::replytomessage()
|
||||
{
|
||||
if (mCurrForumId == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fId = mCurrForumId;
|
||||
pId = mCurrPostId;
|
||||
|
||||
ForumMsgInfo msgInfo ;
|
||||
rsForums->getForumMessage(fId,pId,msgInfo) ;
|
||||
|
||||
|
||||
if (rsPeers->getPeerName(msgInfo.srcId) !="")
|
||||
{
|
||||
|
||||
ChanMsgDialog *nMsgDialog = new ChanMsgDialog(true);
|
||||
nMsgDialog->newMsg();
|
||||
nMsgDialog->insertTitleText( (QString("Re: ") + QString::fromStdWString(msgInfo.title)).toStdString()) ;
|
||||
nMsgDialog->setWindowTitle(tr("Re: ") + QString::fromStdWString(msgInfo.title) ) ;
|
||||
|
||||
QTextDocument doc ;
|
||||
doc.setHtml(QString::fromStdWString(msgInfo.msg)) ;
|
||||
std::string cited_text(doc.toPlainText().toStdString()) ;
|
||||
|
||||
nMsgDialog->insertPastedText(cited_text) ;
|
||||
nMsgDialog->addRecipient( msgInfo.srcId ) ;
|
||||
nMsgDialog->show();
|
||||
nMsgDialog->activateWindow();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(this, tr("RetroShare"),tr("You cant reply a Anonymous Author"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ public:
|
||||
void insertPost();
|
||||
|
||||
void loadForumEmoticons();
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
@ -88,6 +89,9 @@ private:
|
||||
QFont itemFont;
|
||||
|
||||
QHash<QString, QString> smileys;
|
||||
|
||||
std::string fId;
|
||||
std::string pId;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::ForumsDialog ui;
|
||||
|
Loading…
Reference in New Issue
Block a user