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

Method custom_lang_DefaultKey

Goldleaf/source/ui/ui_OwnSettingsLayout.cpp:80–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 void OwnSettingsLayout::custom_lang_DefaultKey() {
81 std::vector<std::string> lang_opts = { cfg::Strings.GetString(521) };
82 for(u32 i = 0; i < static_cast<u32>(Language::Count); i++) {
83 lang_opts.push_back(LanguageNameList[i]);
84 }
85 lang_opts.push_back(cfg::Strings.GetString(18));
86
87 const auto option = g_MainApplication->DisplayDialog(cfg::Strings.GetString(441), cfg::Strings.GetString(443), lang_opts, true);
88 if(option >= 0) {
89 if(option == 0) {
90 g_Settings.lang = Language::Auto;
91 }
92 else {
93 g_Settings.lang = static_cast<Language>(option - 1);
94 }
95 SaveChanges(true);
96 }
97 }
98
99 void OwnSettingsLayout::use_12h_time_DefaultKey() {
100 g_Settings.json_settings.general.value().use_12h_time.value() = !g_Settings.json_settings.general.value().use_12h_time.value();

Callers

nothing calls this directly

Calls 2

SaveChangesFunction · 0.85
DisplayDialogMethod · 0.80

Tested by

no test coverage detected