MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / ShowPowerTasksDialog

Function ShowPowerTasksDialog

Goldleaf/source/ui/ui_Utils.cpp:44–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 }
43
44 void ShowPowerTasksDialog(const std::string &title, const std::string &msg) {
45 const auto option = g_MainApplication->DisplayDialog(title, msg, { cfg::Strings.GetString(233), cfg::Strings.GetString(232), cfg::Strings.GetString(18) }, true);
46 switch(option) {
47 case 0: {
48 const auto option_2 = g_MainApplication->DisplayDialog(title, cfg::Strings.GetString(483), { cfg::Strings.GetString(234), cfg::Strings.GetString(18) }, true);
49 if(option_2 == 0) {
50 hos::PowerOff();
51 }
52 break;
53 }
54 case 1: {
55 const auto option_2 = g_MainApplication->DisplayDialog(title, cfg::Strings.GetString(484), { cfg::Strings.GetString(234), cfg::Strings.GetString(18) }, true);
56 if(option_2 == 0) {
57 hos::Reboot();
58 }
59 break;
60 }
61 }
62 }
63
64 std::string ShowKeyboard(const std::string &guide_text, const std::string &initial_text, const u32 max_len, const size_t out_str_len) {
65 SwkbdConfig kbd;

Callers 1

OnInputMethod · 0.85

Calls 3

PowerOffFunction · 0.85
RebootFunction · 0.85
DisplayDialogMethod · 0.80

Tested by

no test coverage detected