From 1ed978f22ed7dcbde6077e4d5a380273c2f5c2ee Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 28 Dec 2023 13:24:31 +0100 Subject: [PATCH] impr: Remove telemetry checkboxes from settings in the web version They are disabled there and should not be enableable --- .../source/content/settings_entries.cpp | 7 +++++-- .../builtin/source/content/welcome_screen.cpp | 20 +++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 6cb0fff94..cd84b18a3 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -374,8 +374,11 @@ namespace hex::plugin::builtin { ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.patterns", "hex.builtin.setting.general.auto_load_patterns", true); ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.patterns", "hex.builtin.setting.general.sync_pattern_source", false); ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.network", "hex.builtin.setting.general.network_interface", false); - ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.network", "hex.builtin.setting.general.server_contact"); - ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.network", "hex.builtin.setting.general.upload_crash_logs", true); + + #if !defined(OS_WEB) + ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.network", "hex.builtin.setting.general.server_contact"); + ContentRegistry::Settings::add("hex.builtin.setting.general", "hex.builtin.setting.general.network", "hex.builtin.setting.general.upload_crash_logs", true); + #endif /* Interface */ diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index afd6f014d..77679125a 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -500,6 +500,16 @@ namespace hex::plugin::builtin { }); EventWindowInitialized::subscribe([] { + if (ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.prev_launch_version", "") == "") { + ui::PopupQuestion::open("hex.builtin.popup.play_tutorial.desc"_lang, + []{ + TutorialManager::startTutorial("hex.builtin.tutorial.introduction"); + }, + []{ }); + } + + ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.prev_launch_version", ImHexApi::System::getImHexVersion()); + // Documentation of the value above the setting definition auto allowServerContact = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 2); if (allowServerContact == 2) { @@ -510,16 +520,6 @@ namespace hex::plugin::builtin { PopupTelemetryRequest::open(); #endif } - - if (ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.prev_launch_version", "") == "") { - ui::PopupQuestion::open("hex.builtin.popup.play_tutorial.desc"_lang, - []{ - TutorialManager::startTutorial("hex.builtin.tutorial.introduction"); - }, - []{ }); - } - - ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.prev_launch_version", ImHexApi::System::getImHexVersion()); }); // Clear project context if we go back to the welcome screen