Esempio n. 1
0
void AppearanceSettings::backgroundChanged(int index)
{
    Theme *theme = currentTheme();
    if (theme) {
        theme->setCurrentBackgroundIndex(index);
        QTimer::singleShot(0, this, SLOT(previewBackgroundChanges()));
    }
}
Esempio n. 2
0
void AppearanceSettings::loadSavedTheme()
{
    gConfig.beginGroup("Appearance");
    m_savedTheme = gConfig.value("Theme", "qtopia.conf").toString();
    m_savedColorScheme = gConfig.value("Scheme", "Qtopia").toString();
    m_savedBackground = gConfig.value("BackgroundImage", "").toString();
    gConfig.endGroup();

    gConfig.beginGroup("ContextMenu");
    m_savedLabelType = (QSoftMenuBar::LabelType)gConfig.value(
            "LabelType", QSoftMenuBar::TextLabel).toInt();
    gConfig.endGroup();
    m_softKeyIconCheck->setChecked(m_savedLabelType == QSoftMenuBar::IconLabel);

    for (int i=0; i<m_themes.size(); i++) {
        if (m_themes[i]->uniqueName() + ".conf" == m_savedTheme) {
            Theme *theme = m_themes[i];
            theme->setCurrentColorIndex(theme->colorSchemeFiles().indexOf(m_savedColorScheme));
            theme->setCurrentBackgroundIndex(theme->backgrounds().indexOf(m_savedBackground));
            m_themeCombo->setCurrentIndex(i);
            break;
        }
    }
}