Browse Source

Fix shutdownconfirm position

adaptive-webui-19844
Chocobo1 9 years ago
parent
commit
6f6fe626a1
  1. 2
      src/app/application.cpp
  2. 9
      src/gui/shutdownconfirmdlg.cpp
  3. 4
      src/gui/shutdownconfirmdlg.h

2
src/app/application.cpp

@ -366,7 +366,7 @@ void Application::allTorrentsFinished()
// do nothing & skip confirm // do nothing & skip confirm
} }
else { else {
if (!ShutdownConfirmDlg::askForConfirmation(action)) return; if (!ShutdownConfirmDlg::askForConfirmation(m_window, action)) return;
} }
#endif // DISABLE_GUI #endif // DISABLE_GUI

9
src/gui/shutdownconfirmdlg.cpp

@ -42,8 +42,9 @@
#include "base/utils/misc.h" #include "base/utils/misc.h"
ShutdownConfirmDlg::ShutdownConfirmDlg(const ShutdownDialogAction &action) ShutdownConfirmDlg::ShutdownConfirmDlg(QWidget *parent, const ShutdownDialogAction &action)
: ui(new Ui::confirmShutdownDlg) : QDialog(parent)
, ui(new Ui::confirmShutdownDlg)
, m_timeout(15) , m_timeout(15)
, m_action(action) , m_action(action)
{ {
@ -82,9 +83,9 @@ void ShutdownConfirmDlg::showEvent(QShowEvent *event)
m_timer.start(); 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); return (dlg.exec() == QDialog::Accepted);
} }

4
src/gui/shutdownconfirmdlg.h

@ -45,10 +45,10 @@ class ShutdownConfirmDlg: public QDialog
Q_OBJECT Q_OBJECT
public: public:
ShutdownConfirmDlg(const ShutdownDialogAction &action); ShutdownConfirmDlg(QWidget *parent, const ShutdownDialogAction &action);
~ShutdownConfirmDlg(); ~ShutdownConfirmDlg();
static bool askForConfirmation(const ShutdownDialogAction &action); static bool askForConfirmation(QWidget *parent, const ShutdownDialogAction &action);
protected: protected:
void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *event) override;

Loading…
Cancel
Save