//************************************************************* //************************* Settings ************************** //************************************************************* void NoteDock::loadConfigFromTemplate(KConfig& config) { QString name; int index = config.name().lastIndexOf(QDir::separator()); if (index!=-1) name = config.name().right(config.name().size() - index - 1); else name = config.name(); KConfigGroup group = config.group("Notes"); ui.kcbBgColor->setColor(group.readEntry("BackgroundColor", m_notes->backgroundColor())); ui.kcbTextColor->setColor(group.readEntry("TextColor", m_notes->textColor())); ui.kfrTextFont->setFont(group.readEntry("TextColor", m_notes->textFont())); }
void SpreadsheetDock::loadConfigFromTemplate(KConfig& config) { //extract the name of the template from the file name QString name; int index = config.name().lastIndexOf(QDir::separator()); if (index!=-1) name = config.name().right(config.name().size() - index - 1); else name = config.name(); int size = m_spreadsheetList.size(); if (size>1) m_spreadsheet->beginMacro(i18n("%1 spreadsheets: template \"%2\" loaded", size, name)); else m_spreadsheet->beginMacro(i18n("%1: template \"%2\" loaded", m_spreadsheet->name(), name)); this->loadConfig(config); m_spreadsheet->endMacro(); }