mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Rename enum
Change identifier from ShutdownAction to ShutdownDialogAction Change enum value from None to Exit
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
#include "base/utils/misc.h"
|
||||
|
||||
|
||||
ShutdownConfirmDlg::ShutdownConfirmDlg(const ShutdownAction &action)
|
||||
ShutdownConfirmDlg::ShutdownConfirmDlg(const ShutdownDialogAction &action)
|
||||
: ui(new Ui::confirmShutdownDlg)
|
||||
, m_timeout(15)
|
||||
, m_action(action)
|
||||
@@ -53,7 +53,7 @@ ShutdownConfirmDlg::ShutdownConfirmDlg(const ShutdownAction &action)
|
||||
QIcon warningIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning));
|
||||
ui->warningLabel->setPixmap(warningIcon.pixmap(32));
|
||||
|
||||
if (m_action == ShutdownAction::None)
|
||||
if (m_action == ShutdownDialogAction::Exit)
|
||||
ui->neverShowAgainCheckbox->setVisible(true);
|
||||
else
|
||||
ui->neverShowAgainCheckbox->setVisible(false);
|
||||
@@ -82,7 +82,7 @@ void ShutdownConfirmDlg::showEvent(QShowEvent *event)
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
bool ShutdownConfirmDlg::askForConfirmation(const ShutdownAction &action)
|
||||
bool ShutdownConfirmDlg::askForConfirmation(const ShutdownDialogAction &action)
|
||||
{
|
||||
ShutdownConfirmDlg dlg(action);
|
||||
return (dlg.exec() == QDialog::Accepted);
|
||||
@@ -109,25 +109,25 @@ void ShutdownConfirmDlg::initText()
|
||||
QPushButton *okButton = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
|
||||
switch (m_action) {
|
||||
case ShutdownAction::None:
|
||||
case ShutdownDialogAction::Exit:
|
||||
m_msg = tr("qBittorrent will now exit.");
|
||||
|
||||
okButton->setText(tr("E&xit Now"));
|
||||
setWindowTitle(tr("Exit confirmation"));
|
||||
break;
|
||||
case ShutdownAction::Shutdown:
|
||||
case ShutdownDialogAction::Shutdown:
|
||||
m_msg = tr("The computer is going to shutdown.");
|
||||
|
||||
okButton->setText(tr("&Shutdown Now"));
|
||||
setWindowTitle(tr("Shutdown confirmation"));
|
||||
break;
|
||||
case ShutdownAction::Suspend:
|
||||
case ShutdownDialogAction::Suspend:
|
||||
m_msg = tr("The computer is going to enter suspend mode.");
|
||||
|
||||
okButton->setText(tr("&Suspend Now"));
|
||||
setWindowTitle(tr("Suspend confirmation"));
|
||||
break;
|
||||
case ShutdownAction::Hibernate:
|
||||
case ShutdownDialogAction::Hibernate:
|
||||
m_msg = tr("The computer is going to enter hibernation mode.");
|
||||
|
||||
okButton->setText(tr("&Hibernate Now"));
|
||||
|
||||
@@ -45,10 +45,10 @@ class ShutdownConfirmDlg: public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ShutdownConfirmDlg(const ShutdownAction &action);
|
||||
ShutdownConfirmDlg(const ShutdownDialogAction &action);
|
||||
~ShutdownConfirmDlg();
|
||||
|
||||
static bool askForConfirmation(const ShutdownAction &action);
|
||||
static bool askForConfirmation(const ShutdownDialogAction &action);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
Ui::confirmShutdownDlg *ui;
|
||||
QTimer m_timer;
|
||||
int m_timeout;
|
||||
ShutdownAction m_action;
|
||||
ShutdownDialogAction m_action;
|
||||
QString m_msg;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user