8000 Add reboot option when downloads complete by bacek97 · Pull Request #23525 · qbittorrent/qBittorrent · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@bacek97
Copy link
@bacek97 bacek97 commented Nov 21, 2025

This commit implements a new "Reboot System" option that allows users to automatically reboot the computer when all downloads are complete, similar to the existing shutdown, suspend, and hibernate options.

Changes include:

  • Add ShutdownDialogAction::Reboot enum value
  • Implement rebootWhenDownloadsComplete() preference methods
  • Add GUI menu action for reboot option
  • Implement OS-specific reboot functionality for Windows, macOS, and Linux (via DBus)
  • Add reboot confirmation dialog
  • Disable Hibernate option on macOS as it's not supported via Apple Events API

Platform support:

  • Windows: Uses InitiateSystemShutdownW with reboot flag
  • macOS: Uses kAERestart Apple Event
  • Linux: Uses systemd logind, ConsoleKit, or HAL DBus interfaces

Closes #10774.

This commit implements a new "Reboot System" option that allows
users to automatically reboot the computer when all downloads are
complete, similar to the existing shutdown, suspend, and hibernate
options.

Changes include:
- Add ShutdownDialogAction::Reboot enum value
- Implement rebootWhenDownloadsComplete() preference methods
- Add GUI menu action for reboot option
- Implement OS-specific reboot functionality for Windows, macOS,
  and Linux (via DBus)
- Add reboot confirmation dialog
- Disable Hibernate option on macOS as it's not supported via
  Apple Events API

Platform support:
- Windows: Uses InitiateSystemShutdownW with reboot flag
- macOS: Uses kAERestart Apple Event
- Linux: Uses systemd logind, ConsoleKit, or HAL DBus interfaces

Closes qbittorrent#10774.
@Chocobo1 Chocobo1 added the Core label Nov 21, 2025
@Chocobo1 Chocobo1 added this to the 5.2 milestone Nov 21, 2025
- Add const qualifier to immutable variables
- Remove debug logging from action toggle handlers
- Use explicit boolean literals instead of expressions
- Initialize AEEventID variable with empty braces
- Add parentheses for clarity in compound conditions
@bacek97 bacek97 requested a review from Chocobo1 November 22, 2025 10:40
@Chocobo1 Chocobo1 requested a review from a team November 22, 2025 14:37
Comment on lines 776 to +779
bool isShutdown = pref->shutdownWhenDownloadsComplete();
bool isSuspend = pref->suspendWhenDownloadsComplete();
bool isHibernate = pref->hibernateWhenDownloadsComplete();
bool isReboot = pref->rebootWhenDownloadsComplete();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OFFTOPIC:
I wonder why those mutually exclusive things are provided as separate options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On Downloads Complete Reboot

3 participants

0