Merge pull request #2146 from defnax/boardscomposer

[ Boards ] Added to show a message box when closing the boards post composer
This commit is contained in:
csoler 2020-12-05 16:17:53 +01:00 committed by GitHub
commit 8f5656433a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -54,7 +54,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(RsPosted *posted, const RsGxsGrou
Settings->loadWidgetInformation(this);
connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(ui->addPicButton, SIGNAL(clicked() ), this , SLOT(addPicture()));
connect(ui->RichTextEditWidget, SIGNAL(textSizeOk(bool)),ui->submitButton, SLOT(setEnabled(bool)));
@ -299,3 +299,11 @@ void PostedCreatePostDialog::on_removeButton_clicked()
ui->removeButton->hide();
ui->stackedWidgetPicture->setCurrentIndex(0);
}
void PostedCreatePostDialog::reject()
{
if(QMessageBox::warning(nullptr,tr("Close this window?"),tr("Do you really want to discard your post?"),QMessageBox::Yes,QMessageBox::No) == QMessageBox::No)
return;
QDialog::reject();
}

View File

@ -52,6 +52,7 @@ private slots:
void addPicture();
void on_removeButton_clicked();
void fileHashingFinished(QList<HashedFile> hashedFiles);
void reject();
void setPage(int viewMode);
private: