From bd546e3d18e9f11af5981bc74ca39661544335d7 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 9 Dec 2007 16:39:55 +0000 Subject: [PATCH] - BUGFIX: Bypass exit confirmation on system shutdown --- TODO | 11 ++--------- src/GUI.cpp | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/TODO b/TODO index 556a98338..83d170111 100644 --- a/TODO +++ b/TODO @@ -53,12 +53,5 @@ TODO: - Check search engine cpu usage -rc9->rc10 changelog: -- FEATURE: Greatly improved ETA calculation algorithm (use GASA) -- BUGFIX: Fixed proxy host max length in preferences -- BUGFIX: Added a 3 minutes search engine timeout -- BUGFIX: Limit search engine plugins to 10 result pages -- BUGFIX: Fixed nbResults != 0 when clearing results while a search is running -- BUGFIX: Fixed possible problem when closing to systray and cancelling app exit -- BUGFIX: Fixed preview when path contains spaces -- COSMETIC: Use more skin colors instead of hard coded ones +rc10->? changelog: +- BUGFIX: Bypass exit confirmation on system shutdown diff --git a/src/GUI.cpp b/src/GUI.cpp index f02df6ecf..d56c71577 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -449,7 +449,7 @@ void GUI::on_actionAbout_triggered() { // Called when we close the program void GUI::closeEvent(QCloseEvent *e) { - qDebug("Mainwindow received closeEvent"); + QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool(); if(!force_exit && systrayIntegration && goToSystrayOnExit && !this->isHidden()) { @@ -461,14 +461,16 @@ void GUI::closeEvent(QCloseEvent *e) { show(); if(!isMaximized()) showNormal(); - if(QMessageBox::question(this, - tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"), - tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"), - tr("&Yes"), tr("&No"), - QString(), 0, 1)) { - e->ignore(); - force_exit = false; - return; + if(e->spontaneous() == true || force_exit == true) { + if(QMessageBox::question(this, + tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"), + tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"), + tr("&Yes"), tr("&No"), + QString(), 0, 1)) { + e->ignore(); + force_exit = false; + return; + } } } hide(); @@ -486,6 +488,7 @@ void GUI::closeEvent(QCloseEvent *e) { qApp->exit(); } + // Display window to create a torrent void GUI::on_actionCreate_torrent_triggered() { createtorrent *ct = new createtorrent(this);