void General::LoadSettings() { Settings *settings = Settings::Instance(); LanguageTranslator *lt = settings->Translator(); _startup.Checked(RunOnStartup()); _notifyIcon.Checked(settings->NotifyIconEnabled()); _sounds.Checked(settings->SoundEffectsEnabled()); /* Determine which skins are available */ std::list<std::wstring> skins = FindSkins(Settings::SkinDir().c_str()); for (std::wstring skin : skins) { _skin.AddItem(skin); } /* Update the combo box with the current skin */ std::wstring current = settings->CurrentSkin(); int idx = _skin.Select(current); if (idx == CB_ERR) { _skin.Select(Settings::DefaultSkin); } LoadSkinInfo(current); /* Populate the language box */ std::list<std::wstring> languages = FindLanguages( settings->LanguagesDir().c_str()); for (std::wstring language : languages) { _language.AddItem(language); } std::wstring currentLang = settings->LanguageName(); _language.Select(currentLang); }
void General::LoadSettings() { Settings *settings = Settings::Instance(); LanguageTranslator *lt = settings->Translator(); _startup->Checked(RunOnStartup()); _showStartup->Checked(settings->ShowOnStartup()); _sounds->Checked(settings->SoundEffectsEnabled()); _autoUpdate->Checked(settings->AutomaticUpdates()); /* Determine which skins are available */ std::list<std::wstring> skins = FindSkins(Settings::SkinDir().c_str()); for (std::wstring skin : skins) { _skin->AddItem(skin); } /* Update the combo box with the current skin */ std::wstring current = settings->CurrentSkin(); int idx = _skin->Select(current); if (idx == CB_ERR) { _skin->Select(Settings::DefaultSkin); } LoadSkinInfo(current); /* Populate the language box */ std::list<std::wstring> languages = FindLanguages( settings->LanguagesDir().c_str()); for (std::wstring language : languages) { int ext = language.find(L".xml"); if (ext == language.npos) { continue; } _language->AddItem(language.substr(0, ext)); } std::wstring currentLang = settings->LanguageName(); _language->Select(currentLang); }