Added to show a message box when closing the boards post composer

This commit is contained in:
defnax 2020-12-04 23:33:16 +01:00
parent f6c554807f
commit ef200fee47
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: