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

Method optsFirmware_DefaultKey

Goldleaf/source/ui/ui_SettingsLayout.cpp:113–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 }
112
113 void SettingsLayout::optsFirmware_DefaultKey() {
114 SetSysFirmwareVersion fw_ver = {};
115 setsysGetFirmwareVersion(&fw_ver);
116
117 auto msg = cfg::Strings.GetString(362) + ":\n";
118 msg += std::string("\n") + cfg::Strings.GetString(363) + ": " + fw_ver.display_version + " (" + fw_ver.display_title + ")";
119 msg += std::string("\n") + cfg::Strings.GetString(364) + ": '" + fw_ver.version_hash + "'";
120 msg += std::string("\n") + cfg::Strings.GetString(95) + " " + std::to_string(hos::GetSystemKeyGeneration());
121 msg += "\n\n" + cfg::Strings.GetString(365) + ":\n";
122
123 upd::UpdateVersion pending_upd = {};
124 const auto is_pending_present = upd::GetPendingUpdateInfo(pending_upd);
125 const auto is_update_present = upd::GetUpdateFirmwareVersion(pending_upd);
126
127 if(is_pending_present) {
128 msg += std::string("\n") + cfg::Strings.GetString(363) + ": " + std::to_string(pending_upd.major) + "." + std::to_string(pending_upd.minor) + "." + std::to_string(pending_upd.micro) + " (" + std::to_string(pending_upd.relstep) + ")";
129 msg += "\n" + cfg::Strings.GetString(366);
130 }
131 else {
132 msg += "\n" + cfg::Strings.GetString(367);
133 }
134
135 std::vector<std::string> options = { cfg::Strings.GetString(234), cfg::Strings.GetString(368) };
136 if(is_pending_present) {
137 options.push_back(cfg::Strings.GetString(369));
138 options.push_back(cfg::Strings.GetString(370));
139 }
140
141 const auto option_1 = g_MainApplication->DisplayDialog(cfg::Strings.GetString(360), msg, options, false);
142 if(option_1 == 0) {
143 return;
144 }
145 else if(option_1 == 1) {
146 this->HandleUpdate("Contents/registered", fw_ver);
147 }
148 else if(option_1 == 2)
149 {
150 const auto option_2 = g_MainApplication->DisplayDialog(cfg::Strings.GetString(371), cfg::Strings.GetString(372) + "\n" + cfg::Strings.GetString(373), { cfg::Strings.GetString(111), cfg::Strings.GetString(18) }, true);
151 if(option_2 == 0) {
152 upd::CleanPendingUpdate();
153 g_MainApplication->ShowNotification(cfg::Strings.GetString(374));
154 }
155 }
156 else if(option_1 == 3) {
157 this->HandleUpdate("Contents/placehld", is_update_present);
158 }
159 }
160
161 void SettingsLayout::optsMemory_DefaultKey() {
162 g_MainApplication->LoadCommonIconMenuData(true, cfg::Strings.GetString(353), CommonIconKind::NAND, cfg::Strings.GetString(511));

Callers

nothing calls this directly

Calls 7

HandleUpdateMethod · 0.95
GetSystemKeyGenerationFunction · 0.85
GetPendingUpdateInfoFunction · 0.85
GetUpdateFirmwareVersionFunction · 0.85
CleanPendingUpdateFunction · 0.85
DisplayDialogMethod · 0.80
ShowNotificationMethod · 0.80

Tested by

no test coverage detected