impr: Better experience when first starting ImHex (#1510)

This commit is contained in:
Nik
2024-01-21 18:39:51 +01:00
committed by GitHub
parent d005b5d2d9
commit 58603ed12a
33 changed files with 533 additions and 215 deletions

View File

@@ -24,13 +24,11 @@
#include <fonts/codicons_font.h>
#include <content/popups/popup_telemetry_request.hpp>
#include <content/recent.hpp>
#include <string>
#include <random>
#include <popups/popup_question.hpp>
#include <hex/api/tutorial_manager.hpp>
#include <hex/api/workspace_manager.hpp>
namespace hex::plugin::builtin {
@@ -497,29 +495,6 @@ 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) {
ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 0);
// Open the telemetry popup but only on desktop versions
#if !defined(OS_WEB)
PopupTelemetryRequest::open();
#endif
}
});
// Clear project context if we go back to the welcome screen
EventProviderChanged::subscribe([](const hex::prv::Provider *oldProvider, const hex::prv::Provider *newProvider) {
hex::unused(oldProvider);