diff options
author | Ken Moore <ken@ixsystems.com> | 2017-09-26 23:52:33 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-09-26 23:52:33 -0400 |
commit | 38b182e7b07f2a2e436b77926ab6bcd8ff5e5d38 (patch) | |
tree | ad22ef99d551ad3a1deb3ff401077021c59dba6f /src-qt5/desktop-utils | |
parent | More updates for the GL widget set. (diff) | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-38b182e7b07f2a2e436b77926ab6bcd8ff5e5d38.tar.gz lumina-38b182e7b07f2a2e436b77926ab6bcd8ff5e5d38.tar.bz2 lumina-38b182e7b07f2a2e436b77926ab6bcd8ff5e5d38.zip |
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/desktop-utils')
-rw-r--r-- | src-qt5/desktop-utils/lumina-textedit/MainUI.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp index 4c2ce0bd..9e4ce499 100644 --- a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp @@ -496,11 +496,14 @@ void MainUI::closeEvent(QCloseEvent *ev){ unsaved << tmp->currentFile(); } } - bool savenow = unsaved.isEmpty(); + if(unsaved.isEmpty()){ QMainWindow::closeEvent(ev); return; } + bool savenow = false; if(!savenow && !ui->actionShow_Popups->isChecked()){ savenow = true; } if(!savenow){ - savenow = (QMessageBox::Yes == QMessageBox::question(this, tr("Save Changes before closing?"), QString(tr("There are unsaved changes.\nDo you want save them before you close the editor?\n\n%1")).arg(unsaved.join("\n")), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ); + QMessageBox::StandardButton but = QMessageBox::question(this, tr("Save Changes before closing?"), QString(tr("There are unsaved changes.\nDo you want save them before you close the editor?\n\n%1")).arg(unsaved.join("\n")), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::No); + savenow = (but == QMessageBox::Yes); + if(but == QMessageBox::Cancel){ ev->ignore(); return; } } - if(!savenow){ QMainWindow::closeEvent(ev); } - else{ ev->ignore(); SaveFile(); } + if(savenow){ SaveFile(); } + QMainWindow::closeEvent(ev); } |