void KPluginSelectionWidget::save() { kdDebug(702) << k_funcinfo << endl; for(QMap< QCheckListItem *, KPluginInfo * >::Iterator it = d->pluginInfoMap.begin(); it != d->pluginInfoMap.end(); ++it) { KPluginInfo *info = it.data(); bool checked = it.key()->isOn(); info->setPluginEnabled(checked); info->save(d->config); d->plugincheckedchanged[info] = false; } QStringList updatedModules; for(QValueList< KCModuleProxy * >::Iterator it = d->modulelist.begin(); it != d->modulelist.end(); ++it) if((*it)->changed()) { (*it)->save(); QStringList *names = d->moduleParentComponents[*it]; if(names->size() == 0) names->append(QString::null); for(QStringList::ConstIterator nameit = names->begin(); nameit != names->end(); ++nameit) if(updatedModules.find(*nameit) == updatedModules.end()) updatedModules.append(*nameit); } for(QStringList::ConstIterator it = updatedModules.begin(); it != updatedModules.end(); ++it) emit configCommitted((*it).latin1()); updateConfigPage(); kdDebug(702) << "syncing config file" << endl; d->config->sync(); d->changed = 0; emit changed(false); }
KRunnerConfigWidget::KRunnerConfigWidget(Plasma::RunnerManager *manager, QWidget *parent) : QWidget(parent), m_preview(0), m_manager(manager) { m_tabWidget = new KTabWidget(this); m_sel = new KPluginSelector(m_tabWidget); m_tabWidget->addTab(m_sel, i18n("Plugins")); QWidget *m_generalSettings = new QWidget(m_tabWidget); //QVBoxLayout *genLayout = new QVBoxLayout(m_generalSettings); m_interfaceType = KRunnerSettings::interface(); m_uiOptions.setupUi(m_generalSettings); syncPalette(); connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(syncPalette())); QButtonGroup *positionButtons = new QButtonGroup(m_generalSettings); positionButtons->addButton(m_uiOptions.topEdgeButton); positionButtons->addButton(m_uiOptions.freeFloatingButton); m_uiOptions.freeFloatingButton->setChecked(KRunnerSettings::freeFloating()); QButtonGroup *displayButtons = new QButtonGroup(m_generalSettings); connect(displayButtons, SIGNAL(buttonClicked(int)), this, SLOT(setInterface(int))); displayButtons->addButton(m_uiOptions.commandButton, KRunnerSettings::EnumInterface::CommandOriented); displayButtons->addButton(m_uiOptions.taskButton, KRunnerSettings::EnumInterface::TaskOriented); if (m_interfaceType == KRunnerSettings::EnumInterface::CommandOriented) { m_uiOptions.commandButton->setChecked(true); } else { m_uiOptions.taskButton->setChecked(true); } connect(m_uiOptions.previewButton, SIGNAL(clicked()), this, SLOT(previewInterface())); m_tabWidget->addTab(m_generalSettings, i18n("User Interface")); connect(m_sel, SIGNAL(configCommitted(QByteArray)), this, SLOT(updateRunner(QByteArray))); QTimer::singleShot(0, this, SLOT(load())); m_buttons = new QDialogButtonBox(this); m_buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel); connect(m_buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(save(QAbstractButton*))); connect(m_buttons, SIGNAL(rejected()), this, SIGNAL(finished())); QVBoxLayout *topLayout = new QVBoxLayout(this); topLayout->addWidget(m_tabWidget); topLayout->addWidget(m_buttons); }
/** prefs */ void kweather::preferences() { kdDebug(12004) << "prefs" << endl; savePrefs(); if ( settingsDialog == 0 ) { settingsDialog = new KCMultiDialog( this ); connect( settingsDialog, TQT_SIGNAL( configCommitted() ), TQT_SLOT( slotPrefsAccepted() ) ); settingsDialog->addModule( "kcmweather.desktop" ); settingsDialog->addModule( "kcmweatherservice.desktop" ); } settingsDialog->show(); settingsDialog->raise(); }