MCPcopy Create free account
hub / github.com/SpriteOvO/AirPodsDesktop / FirstTimeUse

Method FirstTimeUse

Source/Application.cpp:62–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void ApdApplication::FirstTimeUse()
63{
64 const auto &constMetaFields = Core::Settings::GetConstMetaFields();
65
66 QMessageBox::information(
67 nullptr, Config::ProgramName,
68 tr("Hello, welcome to %1!\n"
69 "\n"
70 "This seems to be your first time using this program.\n"
71 "Let's configure something together.")
72 .arg(Config::ProgramName));
73
74 auto current = Core::Settings::GetCurrent();
75
76 // Auto run
77 //
78 current.auto_run =
79 QMessageBox::question(
80 nullptr, Config::ProgramName,
81 tr("Do you want this program to launch when the system starts?\n"
82 "\n"
83 "If you frequently use AirPods with this computer, it is recommended that you click "
84 "\"Yes\"."),
85 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes;
86
87 // Low audio latency
88 //
89 current.low_audio_latency =
90 QMessageBox::question(
91 nullptr, Config::ProgramName,
92 tr("Do you want to enable the \"low audio latency\" feature?\n"
93 "\n%1")
94 .arg(constMetaFields.low_audio_latency.Description()),
95 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes;
96
97 Core::Settings::Save(std::move(current));
98
99 QMessageBox::information(
100 nullptr, Config::ProgramName,
101 tr("Great! Everything is ready!\n"
102 "\n"
103 "Enjoy it all."));
104
105 _trayIcon->ShowMessage(
106 tr("You can find me in the system tray"),
107 tr("Click the icon to view battery information, right-click to "
108 "customize settings or quit."));
109}
110
111ApdApplication::ApdApplication(int argc, char *argv[]) : SingleApplication{argc, argv} {}
112

Callers

nothing calls this directly

Calls 3

GetCurrentFunction · 0.85
SaveFunction · 0.85
ShowMessageMethod · 0.80

Tested by

no test coverage detected