From db74c9ef58858e985269e73a6c6b9ab6d6ffd5b8 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 2 Apr 2009 20:28:12 +0000 Subject: [PATCH] replaced doquit with normal QMessageBox git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1108 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 39 +++++++++------------------ 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 975a6d1ce..3fb2ee5fc 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -623,32 +623,17 @@ void MainWindow::createActions() turned off for future quit events. */ void MainWindow::doQuit() -{ - RshareSettings rsharesettings; - QString key (UI_PREF_PROMPT_ON_QUIT); - bool doConfirm = rsharesettings.value(key, QVariant(true)).toBool(); - if (doConfirm) - { - ConfirmQuitDialog * confirm = new ConfirmQuitDialog; - confirm->exec(); - // save configuration setting - if (confirm->reminderCheckBox->checkState() == Qt::Checked) - { - rsharesettings.setValue(key, QVariant(false)); - } - - if (confirm->result() == QDialog::Accepted) - { - rsicontrol->rsGlobalShutDown(); - qApp->quit(); - } else { - delete confirm; - } - - } else { - rsicontrol->rsGlobalShutDown(); - qApp->quit(); - } +{ + QString queryWrn; + queryWrn.clear(); + queryWrn.append("Do you really want to quit and stop all transfers?"); + + if ((QMessageBox::question(this, tr("Really quit ? "),queryWrn,QMessageBox::Ok|QMessageBox::No, QMessageBox::Ok))== QMessageBox::Ok) + { + qApp->quit(); + } + else + return; } void MainWindow::closeEvent(QCloseEvent *e) @@ -665,7 +650,7 @@ void MainWindow::closeEvent(QCloseEvent *e) firstTime = false; } hide(); - e->ignore(); + e->ignore();p } }