mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-17 02:21:03 -04:00
Major improvements to Comments GUI for channels and posted.
- Split GxsIdWidgetTreeItem into two types. - Added Voter Id into Comment Dialog. - Expanded Comment display to show Votes and Score. - Expanded Comment Context Menu to include Voting and Reputation Options. - Fixed up CreateComment Dialog to include AuthorId, and enabled. - Completed Basic Comment Voting. - Made Comment Windows Closable. - Cleanup up Channel Posts before loading new ones. - Fixed up Channel Post Attachments, and Thumbnails. - Added View Comments button to Channel Posts - Misc other Bugs. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6219 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b9f2708927
commit
5ba4c8f7ff
19 changed files with 829 additions and 389 deletions
|
@ -2,6 +2,9 @@
|
|||
#include "GxsCreateCommentDialog.h"
|
||||
#include "ui_GxsCreateCommentDialog.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <iostream>
|
||||
|
||||
GxsCreateCommentDialog::GxsCreateCommentDialog(TokenQueue *tokQ, RsGxsCommentService *service,
|
||||
const RsGxsGrpMsgIdPair &parentId, const RsGxsMessageId& threadId, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
@ -9,17 +12,47 @@ GxsCreateCommentDialog::GxsCreateCommentDialog(TokenQueue *tokQ, RsGxsCommentSer
|
|||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(createComment()));
|
||||
|
||||
/* fill in the available OwnIds for signing */
|
||||
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, "");
|
||||
}
|
||||
|
||||
void GxsCreateCommentDialog::createComment()
|
||||
{
|
||||
RsGxsComment comment;
|
||||
|
||||
comment.mComment = ui->commentTextEdit->document()->toPlainText().toStdString();
|
||||
comment.mComment = std::string(ui->commentTextEdit->document()->toPlainText().toUtf8());
|
||||
comment.mMeta.mParentId = mParentId.second;
|
||||
comment.mMeta.mGroupId = mParentId.first;
|
||||
comment.mMeta.mThreadId = mThreadId;
|
||||
|
||||
std::cerr << "GxsCreateCommentDialog::createComment()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
std::cerr << "GroupId : " << comment.mMeta.mGroupId << std::endl;
|
||||
std::cerr << "ThreadId : " << comment.mMeta.mThreadId << std::endl;
|
||||
std::cerr << "ParentId : " << comment.mMeta.mParentId << std::endl;
|
||||
|
||||
|
||||
RsGxsId authorId;
|
||||
if (ui->idChooser->getChosenId(authorId))
|
||||
{
|
||||
comment.mMeta.mAuthorId = authorId;
|
||||
std::cerr << "AuthorId : " << comment.mMeta.mAuthorId << std::endl;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "GxsCreateCommentDialog::createComment() ERROR GETTING AuthorId!";
|
||||
std::cerr << std::endl;
|
||||
|
||||
int ret = QMessageBox::information(this, tr("Comment Signing Error"),
|
||||
tr("You need to create an Identity\n"
|
||||
"before you can comment"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t token;
|
||||
mCommentService->createComment(token, comment);
|
||||
mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue