2011-02-05 17:51:31 +03:00
|
|
|
/*
|
2015-03-31 14:59:26 +03:00
|
|
|
* Bittorrent Client using Qt and libtorrent.
|
2017-06-15 15:40:59 +03:00
|
|
|
* Copyright (C) 2011 Christophe Dumez <chris@qbittorrent.org>
|
2011-02-05 17:51:31 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* In addition, as a special exception, the copyright holders give permission to
|
|
|
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
|
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
|
|
* and distribute the linked executables. You must obey the GNU General Public
|
|
|
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
|
|
* modify file(s), you may extend this exception to your version of the file(s),
|
|
|
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
|
|
* exception statement from your version.
|
|
|
|
*/
|
|
|
|
|
2020-12-10 20:56:37 +03:00
|
|
|
#pragma once
|
2011-02-05 17:51:31 +03:00
|
|
|
|
2015-12-09 11:01:48 +03:00
|
|
|
#include <QDialog>
|
2011-02-05 17:51:31 +03:00
|
|
|
#include <QTimer>
|
2017-06-15 15:40:59 +03:00
|
|
|
|
2016-04-11 11:00:09 +03:00
|
|
|
#include "base/types.h"
|
2016-03-21 00:54:07 +03:00
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
2018-06-14 12:54:23 +03:00
|
|
|
class ShutdownConfirmDialog;
|
2016-03-21 00:54:07 +03:00
|
|
|
}
|
2015-12-09 11:01:48 +03:00
|
|
|
|
2020-04-19 05:42:11 +03:00
|
|
|
class ShutdownConfirmDialog final : public QDialog
|
2015-03-31 14:59:26 +03:00
|
|
|
{
|
2015-02-25 12:48:40 +03:00
|
|
|
Q_OBJECT
|
2011-02-05 17:51:31 +03:00
|
|
|
|
|
|
|
public:
|
2018-06-14 12:54:23 +03:00
|
|
|
ShutdownConfirmDialog(QWidget *parent, const ShutdownDialogAction &action);
|
|
|
|
~ShutdownConfirmDialog();
|
2011-02-05 17:51:31 +03:00
|
|
|
|
2015-11-11 06:52:33 +03:00
|
|
|
static bool askForConfirmation(QWidget *parent, const ShutdownDialogAction &action);
|
2015-03-31 14:59:26 +03:00
|
|
|
|
2014-08-23 22:08:27 +04:00
|
|
|
protected:
|
2016-04-12 21:16:23 +03:00
|
|
|
void showEvent(QShowEvent *event) override;
|
2014-08-23 22:08:27 +04:00
|
|
|
|
|
|
|
private slots:
|
2015-02-25 12:48:40 +03:00
|
|
|
void updateSeconds();
|
2016-03-21 00:54:07 +03:00
|
|
|
void accept() override;
|
2014-08-23 22:08:27 +04:00
|
|
|
|
|
|
|
private:
|
2015-02-25 12:48:40 +03:00
|
|
|
// Methods
|
2016-04-12 21:16:23 +03:00
|
|
|
void initText();
|
2015-02-25 12:48:40 +03:00
|
|
|
void updateText();
|
2014-08-23 22:08:27 +04:00
|
|
|
|
2015-02-25 12:48:40 +03:00
|
|
|
// Vars
|
2018-06-14 12:54:23 +03:00
|
|
|
Ui::ShutdownConfirmDialog *m_ui;
|
2015-03-31 14:59:26 +03:00
|
|
|
QTimer m_timer;
|
|
|
|
int m_timeout;
|
2016-04-12 21:33:17 +03:00
|
|
|
ShutdownDialogAction m_action;
|
2016-04-12 21:16:23 +03:00
|
|
|
QString m_msg;
|
2011-02-05 17:51:31 +03:00
|
|
|
};
|