void AppearanceSettings::colorChanged(int index) { Theme *theme = currentTheme(); if (theme) { theme->setCurrentColorIndex(index); QTimer::singleShot(0, this, SLOT(previewColorChanges())); } }
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; } } }