mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 02:50:07 -05:00
use the comments ID to create new comment
This commit is contained in:
parent
c30c7a4dfe
commit
5e2f46a5fc
@ -44,7 +44,7 @@
|
|||||||
#define VIEW_IMAGE 2
|
#define VIEW_IMAGE 2
|
||||||
#define VIEW_LINK 3
|
#define VIEW_LINK 3
|
||||||
|
|
||||||
PostedCreatePostDialog::PostedCreatePostDialog(RsPosted *posted, const RsGxsGroupId& grpId, QWidget *parent):
|
PostedCreatePostDialog::PostedCreatePostDialog(RsPosted *posted, const RsGxsGroupId& grpId, const RsGxsId& default_author, QWidget *parent):
|
||||||
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint),
|
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint),
|
||||||
mPosted(posted), mGrpId(grpId),
|
mPosted(posted), mGrpId(grpId),
|
||||||
ui(new Ui::PostedCreatePostDialog)
|
ui(new Ui::PostedCreatePostDialog)
|
||||||
@ -69,7 +69,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(RsPosted *posted, const RsGxsGrou
|
|||||||
ui->sizeWarningLabel->setText(QString("Post size is limited to %1 KB, pictures will be downscaled.").arg(MAXMESSAGESIZE / 1024));
|
ui->sizeWarningLabel->setText(QString("Post size is limited to %1 KB, pictures will be downscaled.").arg(MAXMESSAGESIZE / 1024));
|
||||||
|
|
||||||
/* fill in the available OwnIds for signing */
|
/* fill in the available OwnIds for signing */
|
||||||
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, RsGxsId());
|
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, default_author);
|
||||||
|
|
||||||
QSignalMapper *signalMapper = new QSignalMapper(this);
|
QSignalMapper *signalMapper = new QSignalMapper(this);
|
||||||
connect(ui->postButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
|
connect(ui->postButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
|
||||||
@ -85,6 +85,15 @@ PostedCreatePostDialog::PostedCreatePostDialog(RsPosted *posted, const RsGxsGrou
|
|||||||
|
|
||||||
/* load settings */
|
/* load settings */
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
|
||||||
|
// Override the default ID, if supplied, since it is changed by processSettings
|
||||||
|
|
||||||
|
if(!default_author.isNull())
|
||||||
|
{
|
||||||
|
ui->idChooser->setChosenId(default_author);
|
||||||
|
|
||||||
|
// should we save the ID in the settings here? I'm not sure we want this.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PostedCreatePostDialog::~PostedCreatePostDialog()
|
PostedCreatePostDialog::~PostedCreatePostDialog()
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
* @param tokenQ parent callee token
|
* @param tokenQ parent callee token
|
||||||
* @param posted
|
* @param posted
|
||||||
*/
|
*/
|
||||||
explicit PostedCreatePostDialog(RsPosted* posted, const RsGxsGroupId& grpId, QWidget *parent = 0);
|
explicit PostedCreatePostDialog(RsPosted* posted, const RsGxsGroupId& grpId, const RsGxsId& default_author=RsGxsId(),QWidget *parent = 0);
|
||||||
~PostedCreatePostDialog();
|
~PostedCreatePostDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -741,8 +741,10 @@ void PostedListWidgetWithModel::createMsg()
|
|||||||
if (!IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags)) {
|
if (!IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
RsGxsId author_id;
|
||||||
PostedCreatePostDialog *msgDialog = new PostedCreatePostDialog(rsPosted,groupId());
|
ui->idChooser->getChosenId(author_id);
|
||||||
|
std::cerr << "Chosing default ID " << author_id<< std::endl;
|
||||||
|
PostedCreatePostDialog *msgDialog = new PostedCreatePostDialog(rsPosted,groupId(),author_id);
|
||||||
msgDialog->show();
|
msgDialog->show();
|
||||||
|
|
||||||
/* window will destroy itself! */
|
/* window will destroy itself! */
|
||||||
|
@ -313,7 +313,7 @@ void GxsIdChooser::setDefaultItem()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (def >= 0) {
|
if (def >= 0) {
|
||||||
setCurrentIndex(def);
|
whileBlocking(this)->setCurrentIndex(def);
|
||||||
#ifdef IDCHOOSER_DEBUG
|
#ifdef IDCHOOSER_DEBUG
|
||||||
std::cerr << "GxsIdChooser-002" << (void*)this << " setting current index to " << def << std::endl;
|
std::cerr << "GxsIdChooser-002" << (void*)this << " setting current index to " << def << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user