mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Improved exit dialog. Fixes #36
This commit is contained in:
parent
097bffeb57
commit
f20033ebb6
@ -311,15 +311,25 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QMessageBox::StandardButton ret = QMessageBox::question(this, "Iaito",
|
||||
"Do you really want to exit?\nSave your project before closing!",
|
||||
QMessageBox::Ok | QMessageBox::Cancel);
|
||||
QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
||||
//qDebug() << ret;
|
||||
if (ret == QMessageBox::Ok) {
|
||||
if (ret == QMessageBox::Save) {
|
||||
QSettings settings("iaito", "iaito");
|
||||
settings.setValue("geometry", saveGeometry());
|
||||
settings.setValue("size", size());
|
||||
settings.setValue("pos", pos());
|
||||
settings.setValue("state", saveState());
|
||||
core->cmd("Ps " + QFileInfo(this->filename).fileName());
|
||||
QString notes = this->notepadDock->notesTextEdit->toPlainText().toUtf8().toBase64();
|
||||
//this->add_debug_output(notes);
|
||||
this->core->cmd("Pnj " + notes);
|
||||
QMainWindow::closeEvent(event);
|
||||
} else if (ret == QMessageBox::Discard) {
|
||||
QSettings settings("iaito", "iaito");
|
||||
settings.setValue("geometry", saveGeometry());
|
||||
settings.setValue("size", size());
|
||||
settings.setValue("pos", pos());
|
||||
settings.setValue("state", saveState());
|
||||
} else {
|
||||
event->ignore();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user