From 234cc3391eba6be67964e5c98beeecd318b8e779 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 11 Sep 2024 01:49:10 +0200 Subject: Load settings from config file --- include/gui/List.hpp | 1 + include/gui/SettingsPage.hpp | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'include/gui') diff --git a/include/gui/List.hpp b/include/gui/List.hpp index 55a5b84..72c5353 100644 --- a/include/gui/List.hpp +++ b/include/gui/List.hpp @@ -29,6 +29,7 @@ namespace gsr { void add_widget(std::unique_ptr widget); void remove_widget(Widget *widget); + void clear(); // Return true from |callback| to continue void for_each_child_widget(std::function &widget)> callback); // Returns nullptr if index is invalid diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp index a9d79bc..ebbc98c 100644 --- a/include/gui/SettingsPage.hpp +++ b/include/gui/SettingsPage.hpp @@ -23,10 +23,11 @@ namespace gsr { STREAM }; - SettingsPage(Type type, const GsrInfo &gsr_info, const std::vector &audio_devices, std::optional &config, PageStack *page_stack); + SettingsPage(Type type, const GsrInfo &gsr_info, std::vector audio_devices, std::optional &config, PageStack *page_stack); SettingsPage(const SettingsPage&) = delete; SettingsPage& operator=(const SettingsPage&) = delete; + void load(); void save(); void on_navigate_away_from_page() override; private: @@ -41,13 +42,13 @@ namespace gsr { std::unique_ptr create_restore_portal_session_checkbox(); std::unique_ptr create_restore_portal_session_section(); std::unique_ptr create_capture_target(const GsrInfo &gsr_info); - std::unique_ptr create_audio_track_selection_checkbox(const std::vector &audio_devices); + std::unique_ptr create_audio_track_selection_checkbox(); std::unique_ptr