mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Fix previous commit.
This commit is contained in:
parent
2b8327c807
commit
18ee87f586
6 changed files with 185 additions and 59 deletions
|
@ -287,12 +287,12 @@ void Application::allTorrentsFinished()
|
|||
Preferences *const pref = Preferences::instance();
|
||||
|
||||
bool will_shutdown = (pref->shutdownWhenDownloadsComplete()
|
||||
|| pref->shutdownqBTWhenDownloadsComplete()
|
||||
|| pref->suspendWhenDownloadsComplete()
|
||||
|| pref->hibernateWhenDownloadsComplete());
|
||||
bool will_exit_only = pref->shutdownqBTWhenDownloadsComplete();
|
||||
|
||||
// Auto-Shutdown
|
||||
if (will_exit_only || will_shutdown) {
|
||||
if (will_shutdown) {
|
||||
bool suspend = pref->suspendWhenDownloadsComplete();
|
||||
bool hibernate = pref->hibernateWhenDownloadsComplete();
|
||||
bool shutdown = pref->shutdownWhenDownloadsComplete();
|
||||
|
@ -306,20 +306,13 @@ void Application::allTorrentsFinished()
|
|||
else if (shutdown)
|
||||
action = ShutdownAction::Shutdown;
|
||||
|
||||
if (will_exit_only) {
|
||||
if (!pref->dontConfirmAutoExit()) {
|
||||
bool exitConfirmed = false;
|
||||
bool neverAskForExitConfirmationAgain = false;
|
||||
ShutdownConfirmDlg::askForConfirmation(action, &exitConfirmed, &neverAskForExitConfirmationAgain);
|
||||
if (neverAskForExitConfirmationAgain && exitConfirmed/*discard the request to never show again if dialog not accepted*/)
|
||||
pref->setDontConfirmAutoExit(true);
|
||||
if (!exitConfirmed) return;
|
||||
}
|
||||
if ((action == ShutdownAction::None) && (!pref->dontConfirmAutoExit())) {
|
||||
if (!ShutdownConfirmDlg::askForConfirmation(action))
|
||||
return;
|
||||
}
|
||||
else { //exit and shutdown
|
||||
bool shutdownConfirmed = false;
|
||||
ShutdownConfirmDlg::askForConfirmation(action, &shutdownConfirmed);
|
||||
if (!shutdownConfirmed) return;
|
||||
if (!ShutdownConfirmDlg::askForConfirmation(action))
|
||||
return;
|
||||
}
|
||||
|
||||
// Actually shut down
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue