Add force close option on tray menu
This commit is contained in:
@@ -75,6 +75,12 @@ namespace system_tray {
|
|||||||
platf::open_url("https://www.paypal.com/paypalme/ReenigneArcher");
|
platf::open_url("https://www.paypal.com/paypalme/ReenigneArcher");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tray_force_stop_cb(struct tray_menu *item) {
|
||||||
|
BOOST_LOG(info) << "Force stop from system tray"sv;
|
||||||
|
proc::proc.terminate();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tray_restart_cb(struct tray_menu *item) {
|
tray_restart_cb(struct tray_menu *item) {
|
||||||
BOOST_LOG(info) << "Restarting from system tray"sv;
|
BOOST_LOG(info) << "Restarting from system tray"sv;
|
||||||
@@ -106,16 +112,17 @@ namespace system_tray {
|
|||||||
(struct tray_menu[]) {
|
(struct tray_menu[]) {
|
||||||
// todo - use boost/locale to translate menu strings
|
// todo - use boost/locale to translate menu strings
|
||||||
{ .text = "Open Sunshine", .cb = tray_open_ui_cb },
|
{ .text = "Open Sunshine", .cb = tray_open_ui_cb },
|
||||||
{ .text = "-" },
|
// { .text = "-" },
|
||||||
{ .text = "Donate",
|
// { .text = "Donate",
|
||||||
.submenu =
|
// .submenu =
|
||||||
(struct tray_menu[]) {
|
// (struct tray_menu[]) {
|
||||||
{ .text = "GitHub Sponsors", .cb = tray_donate_github_cb },
|
// { .text = "GitHub Sponsors", .cb = tray_donate_github_cb },
|
||||||
{ .text = "MEE6", .cb = tray_donate_mee6_cb },
|
// { .text = "MEE6", .cb = tray_donate_mee6_cb },
|
||||||
{ .text = "Patreon", .cb = tray_donate_patreon_cb },
|
// { .text = "Patreon", .cb = tray_donate_patreon_cb },
|
||||||
{ .text = "PayPal", .cb = tray_donate_paypal_cb },
|
// { .text = "PayPal", .cb = tray_donate_paypal_cb },
|
||||||
{ .text = nullptr } } },
|
// { .text = nullptr } } },
|
||||||
{ .text = "-" },
|
// { .text = "-" },
|
||||||
|
{ .text = "Force Close", .cb = tray_force_stop_cb },
|
||||||
{ .text = "Restart", .cb = tray_restart_cb },
|
{ .text = "Restart", .cb = tray_restart_cb },
|
||||||
{ .text = "Quit", .cb = tray_quit_cb },
|
{ .text = "Quit", .cb = tray_quit_cb },
|
||||||
{ .text = nullptr } },
|
{ .text = nullptr } },
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ namespace system_tray {
|
|||||||
void
|
void
|
||||||
tray_donate_paypal_cb(struct tray_menu *item);
|
tray_donate_paypal_cb(struct tray_menu *item);
|
||||||
|
|
||||||
|
void
|
||||||
|
tray_force_stop_cb(struct tray_menu *item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Callback for restarting Sunshine from the system tray.
|
* @brief Callback for restarting Sunshine from the system tray.
|
||||||
* @param item The tray menu item.
|
* @param item The tray menu item.
|
||||||
|
|||||||
Reference in New Issue
Block a user