2012-11-07 18:24:23 -05:00
|
|
|
#include "PostedCreatePostDialog.h"
|
|
|
|
#include "ui_PostedCreatePostDialog.h"
|
|
|
|
|
2012-11-17 16:43:21 -05:00
|
|
|
PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *posted, const RsGxsGroupId& grpId, QWidget *parent):
|
|
|
|
QDialog(parent), mTokenQueue(tokenQ), mPosted(posted), mGrpId(grpId),
|
2012-11-07 18:24:23 -05:00
|
|
|
ui(new Ui::PostedCreatePostDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2012-11-17 16:43:21 -05:00
|
|
|
connect(this, SIGNAL(accepted()), this, SLOT(createPost()));
|
2012-11-07 18:24:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void PostedCreatePostDialog::createPost()
|
|
|
|
{
|
2012-11-17 16:43:21 -05:00
|
|
|
RsPostedPost post;
|
|
|
|
post.mMeta.mGroupId = mGrpId;
|
|
|
|
post.mLink = ui->linkEdit->text().toStdString();
|
|
|
|
post.mNotes = ui->notesTextEdit->toPlainText().toStdString();
|
2012-11-22 17:40:31 -05:00
|
|
|
post.mMeta.mMsgName = ui->titleEdit->text().toStdString();
|
2012-11-07 18:24:23 -05:00
|
|
|
|
2012-11-17 16:43:21 -05:00
|
|
|
uint32_t token;
|
2013-03-11 16:53:15 -04:00
|
|
|
mPosted->createPost(token, post);
|
2012-12-05 17:45:44 -05:00
|
|
|
mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, TOKEN_USER_TYPE_POST);
|
2012-11-07 18:24:23 -05:00
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
|
|
|
PostedCreatePostDialog::~PostedCreatePostDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|