ft: Closing windows asks to save queries before closing the window.

fix: closetab did incorrectly close when cancel was choosen.
This commit is contained in:
eelke 2020-04-04 13:23:43 +02:00
parent adb44fc157
commit dea76e17c5
7 changed files with 59 additions and 10 deletions

View file

@ -23,7 +23,7 @@
QueryTool::QueryTool(IDatabaseWindow *context, QWidget *parent)
: QWidget(parent)
: ManagedPage(parent)
, m_context(context)
, ui(new Ui::QueryTab)
, m_dbConnection()
@ -61,11 +61,14 @@ QueryTool::~QueryTool()
delete ui;
}
bool QueryTool::canClose()
bool QueryTool::CanClose(bool prompt_user)
{
bool can_close;
if (m_queryTextChanged) {
can_close = continueWithoutSavingWarning();
if (prompt_user)
can_close = continueWithoutSavingWarning();
else
can_close = false;
}
else {
can_close = true;