MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / CreateWelcomePage

Method CreateWelcomePage

TranslucentTB/application.cpp:26–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24HresultErrorCatch(spdlog::level::critical, L"Failed to create Xaml app");
25
26void Application::CreateWelcomePage()
27{
28 using winrt::TranslucentTB::Xaml::Pages::WelcomePage;
29 CreateXamlWindow<WelcomePage>(
30 xaml_startup_position::center,
31 [this](const WelcomePage &content, BaseXamlPageHost *host)
32 {
33 DispatchToMainThread([this, hwnd = host->handle()]
34 {
35 m_WelcomePage = hwnd;
36 });
37
38 auto closeRevoker = content.Closed(winrt::auto_revoke, [this]
39 {
40 DispatchToMainThread([this]
41 {
42 Shutdown();
43 });
44 });
45
46 content.LiberapayOpenRequested(OpenDonationPage);
47 content.DiscordJoinRequested(OpenDiscordServer);
48
49 content.ConfigEditRequested([this]
50 {
51 DispatchToMainThread([this]
52 {
53 m_Config.EditConfigFile();
54 });
55 });
56
57 content.LicenseApproved([this, revoker = std::move(closeRevoker)]() mutable
58 {
59 // remove the close handler because returning from the lambda will make the close event fire.
60 revoker.revoke();
61
62 DispatchToMainThread([this]
63 {
64 m_WelcomePage = nullptr;
65 m_Config.SaveConfig(); // create the config file, if not already present
66 m_AppWindow.RemoveHideTrayIconOverride();
67 m_AppWindow.SendNotification(IDS_WELCOME_NOTIFICATION, 0, NIIF_INFO);
68 });
69 });
70 });
71}
72
73Application::Application(HINSTANCE hInst, std::optional<std::filesystem::path> storageFolder, bool fileExists) :
74 m_Config(storageFolder, fileExists, ConfigurationChanged, this),

Callers

nothing calls this directly

Calls 5

handleMethod · 0.80
SaveConfigMethod · 0.80
SendNotificationMethod · 0.80
EditConfigFileMethod · 0.45

Tested by

no test coverage detected