Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/system_tray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

// local includes
#include "confighttp.h"
#include "display_device.h"
#include "logging.h"
#include "platform/common.h"
#include "process.h"
Expand Down Expand Up @@ -70,6 +71,13 @@
platf::open_url("https://www.paypal.com/paypalme/ReenigneArcher");
}

void
tray_reset_display_device_config_cb(struct tray_menu *item) {

Check warning on line 75 in src/system_tray.cpp

View check run for this annotation

Codecov / codecov/patch

src/system_tray.cpp#L75

Added line #L75 was not covered by tests
BOOST_LOG(info) << "Resetting display device config from system tray"sv;

std::ignore = display_device::reset_persistence();

Check warning on line 78 in src/system_tray.cpp

View check run for this annotation

Codecov / codecov/patch

src/system_tray.cpp#L78

Added line #L78 was not covered by tests
}

void
tray_restart_cb(struct tray_menu *item) {
BOOST_LOG(info) << "Restarting from system tray"sv;
Expand Down Expand Up @@ -110,6 +118,10 @@
{ .text = "PayPal", .cb = tray_donate_paypal_cb },
{ .text = nullptr } } },
{ .text = "-" },
// Currently display device settings are only supported on Windows
#ifdef _WIN32
{ .text = "Reset Display Device Config", .cb = tray_reset_display_device_config_cb },
#endif
{ .text = "Restart", .cb = tray_restart_cb },
{ .text = "Quit", .cb = tray_quit_cb },
{ .text = nullptr } },
Expand Down
7 changes: 7 additions & 0 deletions src/system_tray.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ namespace system_tray {
void
tray_donate_paypal_cb(struct tray_menu *item);

/**
* @brief Callback for resetting display device configuration.
* @param item The tray menu item.
*/
void
tray_reset_display_device_config_cb(struct tray_menu *item);

/**
* @brief Callback for restarting Sunshine from the system tray.
* @param item The tray menu item.
Expand Down
Loading