diff --git a/src/app/application.cpp b/src/app/application.cpp index 62710688f..a289c8e36 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -366,7 +366,7 @@ void Application::allTorrentsFinished() // do nothing & skip confirm } else { - if (!ShutdownConfirmDlg::askForConfirmation(action)) return; + if (!ShutdownConfirmDlg::askForConfirmation(m_window, action)) return; } #endif // DISABLE_GUI diff --git a/src/gui/shutdownconfirmdlg.cpp b/src/gui/shutdownconfirmdlg.cpp index 3fbbe0c97..116c64776 100644 --- a/src/gui/shutdownconfirmdlg.cpp +++ b/src/gui/shutdownconfirmdlg.cpp @@ -42,8 +42,9 @@ #include "base/utils/misc.h" -ShutdownConfirmDlg::ShutdownConfirmDlg(const ShutdownDialogAction &action) - : ui(new Ui::confirmShutdownDlg) +ShutdownConfirmDlg::ShutdownConfirmDlg(QWidget *parent, const ShutdownDialogAction &action) + : QDialog(parent) + , ui(new Ui::confirmShutdownDlg) , m_timeout(15) , m_action(action) { @@ -82,9 +83,9 @@ void ShutdownConfirmDlg::showEvent(QShowEvent *event) m_timer.start(); } -bool ShutdownConfirmDlg::askForConfirmation(const ShutdownDialogAction &action) +bool ShutdownConfirmDlg::askForConfirmation(QWidget *parent, const ShutdownDialogAction &action) { - ShutdownConfirmDlg dlg(action); + ShutdownConfirmDlg dlg(parent, action); return (dlg.exec() == QDialog::Accepted); } diff --git a/src/gui/shutdownconfirmdlg.h b/src/gui/shutdownconfirmdlg.h index 88b7c48de..dafa1da86 100644 --- a/src/gui/shutdownconfirmdlg.h +++ b/src/gui/shutdownconfirmdlg.h @@ -45,10 +45,10 @@ class ShutdownConfirmDlg: public QDialog Q_OBJECT public: - ShutdownConfirmDlg(const ShutdownDialogAction &action); + ShutdownConfirmDlg(QWidget *parent, const ShutdownDialogAction &action); ~ShutdownConfirmDlg(); - static bool askForConfirmation(const ShutdownDialogAction &action); + static bool askForConfirmation(QWidget *parent, const ShutdownDialogAction &action); protected: void showEvent(QShowEvent *event) override;