| 152 | } |
| 153 | |
| 154 | void OwnSettingsLayout::UpdateSettings(const bool reset_selected_idx) { |
| 155 | g_Settings.ApplyToMenu(this->settings_menu); |
| 156 | const auto old_idx = this->settings_menu->GetSelectedIndex(); |
| 157 | this->settings_menu->ClearItems(); |
| 158 | |
| 159 | const auto view_logs_item_name = cfg::Strings.GetString(509); |
| 160 | this->view_logs_item = pu::ui::elm::MenuItem::New(view_logs_item_name); |
| 161 | this->view_logs_item->SetIcon(GetCommonIcon(CommonIconKind::Settings)); |
| 162 | this->view_logs_item->SetColor(g_Settings.GetColorScheme().text); |
| 163 | this->view_logs_item->AddOnKey(std::bind(&OwnSettingsLayout::view_logs_DefaultKey, this)); |
| 164 | |
| 165 | const auto clear_logs_item_name = cfg::Strings.GetString(514); |
| 166 | this->clear_logs_item = pu::ui::elm::MenuItem::New(clear_logs_item_name); |
| 167 | this->clear_logs_item->SetIcon(GetCommonIcon(CommonIconKind::Settings)); |
| 168 | this->clear_logs_item->SetColor(g_Settings.GetColorScheme().text); |
| 169 | this->clear_logs_item->AddOnKey(std::bind(&OwnSettingsLayout::clear_logs_DefaultKey, this)); |
| 170 | |
| 171 | this->settings_menu->AddItem(this->view_logs_item); |
| 172 | this->settings_menu->AddItem(this->clear_logs_item); |
| 173 | |
| 174 | auto custom_lang_item_name = cfg::Strings.GetString(441) + ": "; |
| 175 | if(g_Settings.lang == Language::Auto) { |
| 176 | custom_lang_item_name += cfg::Strings.GetString(521); |
| 177 | } |
| 178 | else { |
| 179 | custom_lang_item_name += LanguageNameList[static_cast<u32>(g_Settings.lang)]; |
| 180 | } |
| 181 | this->custom_lang_item = pu::ui::elm::MenuItem::New(custom_lang_item_name); |
| 182 | this->custom_lang_item->SetIcon(GetCommonIcon(CommonIconKind::Settings)); |
| 183 | this->custom_lang_item->SetColor(g_Settings.GetColorScheme().text); |
| 184 | this->custom_lang_item->AddOnKey(std::bind(&OwnSettingsLayout::custom_lang_DefaultKey, this)); |
| 185 | |
| 186 | const auto use_12h_time_name = cfg::Strings.GetString(452) + ": " + (g_Settings.json_settings.general.value().use_12h_time.value() ? cfg::Strings.GetString(111) : cfg::Strings.GetString(112)); |
| 187 | this->use_12h_time_item = pu::ui::elm::MenuItem::New(use_12h_time_name); |
| 188 | this->use_12h_time_item->SetIcon(GetCommonIcon(CommonIconKind::Settings)); |
| 189 | this->use_12h_time_item->SetColor(g_Settings.GetColorScheme().text); |
| 190 | this->use_12h_time_item->AddOnKey(std::bind(&OwnSettingsLayout::use_12h_time_DefaultKey, this)); |
| 191 | |
| 192 | const auto ignore_hidden_files_name = cfg::Strings.GetString(474) + ": " + (g_Settings.json_settings.fs.value().ignore_hidden_files.value() ? cfg::Strings.GetString(111) : cfg::Strings.GetString(112)); |
| 193 | this->ignore_hidden_files_item = pu::ui::elm::MenuItem::New(ignore_hidden_files_name); |
| 194 | this->ignore_hidden_files_item->SetIcon(GetCommonIcon(CommonIconKind::Settings)); |
| 195 | this->ignore_hidden_files_item->SetColor(g_Settings.GetColorScheme().text); |
| 196 | this->ignore_hidden_files_item->AddOnKey(std::bind(&OwnSettingsLayout::ignore_hidden_files_DefaultKey, this)); |
| 197 | |
| 198 | this->settings_menu->AddItem(this->custom_lang_item); |
| 199 | this->settings_menu->AddItem(this->use_12h_time_item); |
| 200 | this->settings_menu->AddItem(this->ignore_hidden_files_item); |
| 201 | |
| 202 | const auto compute_directory_sizes_name = cfg::Strings.GetString(510) + ": " + (g_Settings.json_settings.fs.value().compute_directory_sizes.value() ? cfg::Strings.GetString(111) : cfg::Strings.GetString(112)); |
| 203 | this->compute_directory_sizes_item = pu::ui::elm::MenuItem::New(compute_directory_sizes_name); |
| 204 | this->compute_directory_sizes_item->SetIcon(GetCommonIcon(CommonIconKind::Settings)); |
| 205 | this->compute_directory_sizes_item->SetColor(g_Settings.GetColorScheme().text); |
| 206 | this->compute_directory_sizes_item->AddOnKey(std::bind(&OwnSettingsLayout::compute_directory_sizes_DefaultKey, this)); |
| 207 | |
| 208 | this->settings_menu->AddItem(this->compute_directory_sizes_item); |
| 209 | |
| 210 | const auto ignore_required_fw_version_item_name = cfg::Strings.GetString(444) + ": " + (g_Settings.json_settings.installs.value().ignore_required_fw_version.value() ? cfg::Strings.GetString(111) : cfg::Strings.GetString(112)); |
| 211 | this->ignore_required_fw_version_item = pu::ui::elm::MenuItem::New(ignore_required_fw_version_item_name); |
no test coverage detected