Gui: Extend TaskDialog

* Add TaskDialog::autoClosedOnDeletedDocument()
* Add option to automatically close task dialog when document is deleted
* Expose autoClosedOnDeletedDocument() to Python
* Expose autoClosedOnTransactionChange() to Python
* Change ControlPy::showDialog() to directly return the task dialog wrapper
* Change TaskView::slotDeletedDocument() to close task dialog if requested
This commit is contained in:
wmayer
2024-07-02 14:18:18 +02:00
committed by wwmayer
parent af1f7385d4
commit 3f49779dae
6 changed files with 135 additions and 27 deletions

View File

@@ -93,10 +93,7 @@ bool TaskDialog::canClose() const
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
return true;
else
return false;
return (ret == QMessageBox::Yes);
}
//==== calls from the TaskView ===============================================================
@@ -116,6 +113,11 @@ void TaskDialog::autoClosedOnTransactionChange()
}
void TaskDialog::autoClosedOnDeletedDocument()
{
}
void TaskDialog::clicked(int)
{