From c213b5de89ee4a11d1c6c94b8b142b24885a4323 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 28 Dec 2024 15:29:26 +0100 Subject: Add option to manage program startup directly in the program --- src/Overlay.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Overlay.cpp') diff --git a/src/Overlay.cpp b/src/Overlay.cpp index 3d6a603..1c7a54c 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -979,6 +979,15 @@ namespace gsr { button->set_icon(&get_theme().settings_small_texture); button->on_click = [&]() { auto settings_page = std::make_unique(&gsr_info, config, &page_stack); + settings_page->on_startup_changed = [&](bool enable, int exit_status) { + if(exit_status == 0) + return; + + if(enable) + show_notification("Failed to add GPU Screen Recorder to system startup", 3.0, mgl::Color(255, 0, 0), mgl::Color(255, 0, 0), NotificationType::NONE); + else + show_notification("Failed to remove GPU Screen Recorder from system startup", 3.0, mgl::Color(255, 0, 0), mgl::Color(255, 0, 0), NotificationType::NONE); + }; page_stack.push(std::move(settings_page)); }; front_page_ptr->add_widget(std::move(button)); -- cgit v1.2.3