mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Add option to hibernate computer in Auto-Shutdown menu
This commit is contained in:
parent
273725d9dc
commit
00e09435b2
8 changed files with 59 additions and 13 deletions
|
@ -261,12 +261,15 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
|
|||
autoShutdownGroup->addAction(actionAutoExit_qBittorrent);
|
||||
autoShutdownGroup->addAction(actionAutoShutdown_system);
|
||||
autoShutdownGroup->addAction(actionAutoSuspend_system);
|
||||
autoShutdownGroup->addAction(actionAutoHibernate_system);
|
||||
#if (!defined(Q_OS_UNIX) || defined(Q_OS_MAC)) || defined(QT_DBUS_LIB)
|
||||
actionAutoShutdown_system->setChecked(pref.shutdownWhenDownloadsComplete());
|
||||
actionAutoSuspend_system->setChecked(pref.suspendWhenDownloadsComplete());
|
||||
actionAutoHibernate_system->setChecked(pref.hibernateWhenDownloadsComplete());
|
||||
#else
|
||||
actionAutoShutdown_system->setDisabled(true);
|
||||
actionAutoSuspend_system->setDisabled(true);
|
||||
actionAutoHibernate_system->setDisabled(true);
|
||||
#endif
|
||||
actionAutoExit_qBittorrent->setChecked(pref.shutdownqBTWhenDownloadsComplete());
|
||||
|
||||
|
@ -1414,6 +1417,12 @@ void MainWindow::on_actionAutoSuspend_system_toggled(bool enabled)
|
|||
Preferences().setSuspendWhenDownloadsComplete(enabled);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionAutoHibernate_system_toggled(bool enabled)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << enabled;
|
||||
Preferences().setHibernateWhenDownloadsComplete(enabled);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionAutoShutdown_system_toggled(bool enabled)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << enabled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue