Exemple #1
0
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);
}
Exemple #2
0
void General::SaveSettings() {
    if (_hWnd == NULL) {
        return;
    }

    CLOG(L"Saving: General");
    Settings *settings = Settings::Instance();

    RunOnStartup(_startup.Checked());
    settings->NotifyIconEnabled(_notifyIcon.Checked());
    settings->SoundEffectsEnabled(_sounds.Checked());

    settings->CurrentSkin(_skin.Selection());
}