replaced doquit with normal QMessageBox

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1108 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-04-02 20:28:12 +00:00
parent 8b36ac51e5
commit db74c9ef58

View File

@ -623,32 +623,17 @@ void MainWindow::createActions()
turned off for future quit events. turned off for future quit events.
*/ */
void MainWindow::doQuit() void MainWindow::doQuit()
{ {
RshareSettings rsharesettings; QString queryWrn;
QString key (UI_PREF_PROMPT_ON_QUIT); queryWrn.clear();
bool doConfirm = rsharesettings.value(key, QVariant(true)).toBool(); queryWrn.append("Do you really want to quit and stop all transfers?");
if (doConfirm)
{ if ((QMessageBox::question(this, tr("Really quit ? "),queryWrn,QMessageBox::Ok|QMessageBox::No, QMessageBox::Ok))== QMessageBox::Ok)
ConfirmQuitDialog * confirm = new ConfirmQuitDialog; {
confirm->exec(); qApp->quit();
// save configuration setting }
if (confirm->reminderCheckBox->checkState() == Qt::Checked) else
{ return;
rsharesettings.setValue(key, QVariant(false));
}
if (confirm->result() == QDialog::Accepted)
{
rsicontrol->rsGlobalShutDown();
qApp->quit();
} else {
delete confirm;
}
} else {
rsicontrol->rsGlobalShutDown();
qApp->quit();
}
} }
void MainWindow::closeEvent(QCloseEvent *e) void MainWindow::closeEvent(QCloseEvent *e)
@ -665,7 +650,7 @@ void MainWindow::closeEvent(QCloseEvent *e)
firstTime = false; firstTime = false;
} }
hide(); hide();
e->ignore(); e->ignore();p
} }
} }