Implement restart support for all platforms

This commit is contained in:
Cameron Gutman 2023-04-23 18:09:13 -05:00
commit 50f689ff80
10 changed files with 128 additions and 82 deletions

View file

@ -123,6 +123,17 @@ namespace system_tray {
open_url("https://www.paypal.com/paypalme/ReenigneArcher");
}
/**
* @brief Callback for restarting Sunshine from the system tray.
* @param item The tray menu item.
*/
void
tray_restart_cb(struct tray_menu *item) {
BOOST_LOG(info) << "Restarting from system tray"sv;
platf::restart();
}
/**
* @brief Callback for exiting Sunshine from the system tray.
* @param item The tray menu item.
@ -162,6 +173,7 @@ namespace system_tray {
{ .text = "PayPal", .cb = tray_donate_paypal_cb },
{ .text = nullptr } } },
{ .text = "-" },
{ .text = "Restart", .cb = tray_restart_cb },
{ .text = "Quit", .cb = tray_quit_cb },
{ .text = nullptr } },
};