/****************************************************************************** * Remove a client application's details from the config file. */ void ADConfigData::removeClient(const QCString &appName) { KConfig *config = KGlobal::config(); config->deleteGroup(CLIENT_GROUP + QString::fromLocal8Bit(appName)); config->sync(); }
TagDialog::~TagDialog() { KConfig *config = amaroK::config( "TagDialog" ); config->writeEntry( "CurrentTab", kTabWidget->currentPageIndex() ); }
void KateConfigDialog::slotApply() { KConfig *config = KateApp::self()->config(); // if data changed apply the kate app stuff if(dataChanged) { config->setGroup("General"); config->writeEntry("Restore Window Configuration", cb_restoreVC->isChecked()); int bu = sessions_start->id(sessions_start->selected()); if(bu == 0) config->writeEntry("Startup Session", "new"); else if(bu == 1) config->writeEntry("Startup Session", "last"); else config->writeEntry("Startup Session", "manual"); bu = sessions_exit->id(sessions_exit->selected()); if(bu == 0) config->writeEntry("Session Exit", "discard"); else if(bu == 1) config->writeEntry("Session Exit", "save"); else config->writeEntry("Session Exit", "ask"); config->writeEntry("Save Meta Infos", cb_saveMetaInfos->isChecked()); KateDocManager::self()->setSaveMetaInfos(cb_saveMetaInfos->isChecked()); config->writeEntry("Days Meta Infos", sb_daysMetaInfos->value()); KateDocManager::self()->setDaysMetaInfos(sb_daysMetaInfos->value()); config->writeEntry("Modified Notification", cb_modNotifications->isChecked()); mainWindow->modNotification = cb_modNotifications->isChecked(); mainWindow->syncKonsole = cb_syncKonsole->isChecked(); fileSelConfigPage->apply(); filelistConfigPage->apply(); configExternalToolsPage->apply(); KateExternalToolsCommand::self()->reload(); for(uint i = 0; i < KateApp::self()->mainWindows(); i++) { KateMainWindow *win = KateApp::self()->mainWindow(i); win->externalTools->reload(); } // mainWindow->externalTools->reload(); mainWindow->viewManager()->setShowFullPath(cb_fullPath->isChecked()); // hm, stored 2 places :( mainWindow->saveOptions(); // save plugin config !! KateApp::self()->pluginManager()->writeConfig(); } // // editor config ! (the apply() methode will check the changed state internally) // for(uint i = 0; i < editorPages.count(); i++) { editorPages.at(i)->apply(); } v->getDoc()->writeConfig(config); // // plugins config ! (the apply() methode SHOULD check the changed state internally) // for(uint i = 0; i < pluginPages.count(); i++) { pluginPages.at(i)->page->apply(); } config->sync(); dataChanged = false; actionButton(KDialogBase::Apply)->setEnabled(false); }
void UserAgentDlg::save() { Q_ASSERT (m_config); // Put all the groups except the default into the delete list. QStringList deleteList = m_config->groupList(); //Remove all the groups that DO NOT contain a "UserAgent" entry... QStringList::ConstIterator endIt = deleteList.constEnd(); for (QStringList::ConstIterator it = deleteList.constBegin(); it != endIt; ++it) { if ( (*it) == QLatin1String ("<default>")) continue; KConfigGroup cg (m_config, *it); if (!cg.hasKey ("UserAgent")) deleteList.removeAll (*it); } QString domain; QTreeWidgetItem* item; int itemCount = ui.sitePolicyTreeWidget->topLevelItemCount(); // Save and remove from the delete list all the groups that were // not deleted by the end user. for (int i = 0; i < itemCount; i++) { item = ui.sitePolicyTreeWidget->topLevelItem (i); domain = item->text (0); KConfigGroup cg (m_config, domain); cg.writeEntry ("UserAgent", item->text (2)); deleteList.removeAll (domain); qDebug ("UserAgentDlg::save: Removed [%s] from delete list", domain.toLatin1().constData()); } // Write the global configuration information... KConfigGroup cg (m_config, QString()); cg.writeEntry ("SendUserAgent", ui.sendUACheckBox->isChecked()); cg.writeEntry ("UserAgentKeys", m_ua_keys); // Sync up all the changes so far... m_config->sync(); // If delete list is not empty, delete the specified domains. if (!deleteList.isEmpty()) { // Remove entries from local file. endIt = deleteList.constEnd(); KConfig cfg (QStringLiteral("kio_httprc"), KConfig::SimpleConfig); for (QStringList::ConstIterator it = deleteList.constBegin(); it != endIt; ++it) { KConfigGroup cg (&cfg, *it); cg.deleteEntry ("UserAgent"); qDebug ("UserAgentDlg::save: Deleting UserAgent of group [%s]", (*it).toLatin1().constData()); if (cg.keyList().count() < 1) cg.deleteGroup(); } // Sync up the configuration... cfg.sync(); // Check everything is gone, reset to blank otherwise. m_config->reparseConfiguration(); endIt = deleteList.constEnd(); for (QStringList::ConstIterator it = deleteList.constBegin(); it != endIt; ++it) { KConfigGroup cg (m_config, *it); if (cg.hasKey ("UserAgent")) cg.writeEntry ("UserAgent", QString()); } // Sync up the configuration... m_config->sync(); } KSaveIOConfig::updateRunningIOSlaves (this); configChanged (false); }
void KSANEOCR::startOCRAD( ) { ocradDialog *ocrDia = static_cast<ocradDialog*>(m_ocrProcessDia); m_ocrResultImage = ocrDia->orfUrl(); const QString cmd = ocrDia->getOCRCmd(); // if( m_ocrResultImage.isEmpty() ) { /* The url is empty. Start the program to fill up a temp file */ m_ocrResultImage = ImgSaver::tempSaveImage( m_img, "BMP", 8 ); // m_tmpFile->name(); kdDebug(28000) << "The new image name is <" << m_ocrResultImage << ">" << endl; } m_ocrImagePBM = ImgSaver::tempSaveImage( m_img, "PBM", 1 ); /* temporar file for orf result */ KTempFile *tmpOrf = new KTempFile( QString(), ".orf" ); tmpOrf->setAutoDelete( false ); tmpOrf->close(); m_tmpOrfName = QFile::encodeName(tmpOrf->name()); if( daemon ) { delete( daemon ); daemon = 0; } daemon = new KProcess; Q_CHECK_PTR(daemon); *daemon << cmd; *daemon << QString("-x"); *daemon << m_tmpOrfName; // the orf result file *daemon << QFile::encodeName( m_ocrImagePBM ); // The name of the image *daemon << QString("-l"); *daemon << QString::number( ocrDia->layoutDetectionMode()); KConfig *konf = KGlobal::config (); KConfigGroupSaver( konf, CFG_GROUP_OCRAD ); QString format = konf->readEntry( CFG_OCRAD_FORMAT, "utf8"); *daemon << QString("-F"); *daemon << format; QString charset = konf->readEntry( CFG_OCRAD_CHARSET, "iso-8859-15"); *daemon << QString("-c"); *daemon << charset; QString addArgs = konf->readEntry( CFG_OCRAD_EXTRA_ARGUMENTS, QString() ); if( !addArgs.isEmpty() ) { kdDebug(28000) << "Setting additional args from config for ocrad: " << addArgs << endl; *daemon << addArgs; } m_ocrResultText = ""; connect(daemon, SIGNAL(processExited(KProcess *)), this, SLOT( ocradExited(KProcess*))); connect(daemon, SIGNAL(receivedStdout(KProcess *, char*, int)), this, SLOT( ocradStdIn(KProcess*, char*, int))); connect(daemon, SIGNAL(receivedStderr(KProcess *, char*, int)), this, SLOT( ocradStdErr(KProcess*, char*, int))); if (!daemon->start(KProcess::NotifyOnExit, KProcess::All)) { kdDebug(28000) << "Error starting ocrad-daemon!" << endl; } else { kdDebug(28000) << "Start OK" << endl; } delete tmpOrf; }
void K3bCddbOptionTab::readSettings() { KConfig* c = kapp->config(); c->setGroup( "Cddb" ); // old config <= 0.7.3 QStringList cddbpServer = c->readListEntry( "cddbp server" ); QStringList httpServer = c->readListEntry( "http server" ); // new config QStringList cddbServer = c->readListEntry( "cddb server" ); QStringList localCddbDirs = c->readPathListEntry( "local cddb dirs" ); m_checkRemoteCddb->setChecked( c->readBoolEntry( "use remote cddb", true ) ); m_checkUseLocalCddb->setChecked( c->readBoolEntry( "use local cddb query", true ) ); m_checkSaveLocalEntries->setChecked( c->readBoolEntry( "save cddb entries locally", true ) ); m_checkManualCgiPath->setChecked( c->readBoolEntry( "use manual cgi path", false ) ); m_editManualCgiPath->setText( c->readEntry( "cgi path", "/~cddb/cddb.cgi" ) ); if( localCddbDirs.isEmpty() ) localCddbDirs.append( "~/.cddb/" ); for( QStringList::const_iterator it = localCddbDirs.begin(); it != localCddbDirs.end(); ++it ) (void)new KListViewItem( m_viewLocalDir, m_viewLocalDir->lastItem(), *it ); // old config <= 0.7.3 if( !httpServer.isEmpty() ) { for( QStringList::iterator it = httpServer.begin(); it != httpServer.end(); ++it ) { cddbServer.append( "Http " + *it ); } } if( !cddbpServer.isEmpty() ) { for( QStringList::iterator it = cddbpServer.begin(); it != cddbpServer.end(); ++it ) { cddbServer.append( "Cddbp " + *it ); } } if( cddbServer.isEmpty() ) cddbServer.append( "Http freedb2.org:80" ); for( QStringList::const_iterator it = cddbServer.begin(); it != cddbServer.end(); ++it ) { const QString& s = *it; QStringList buf = QStringList::split( ":", s.mid( s.find(" ")+1 ) ); QString server = buf[0]; int port = buf[1].toInt(); if( s.startsWith("Http") ) (void)new KListViewItem( m_viewCddbServer, m_viewCddbServer->lastItem(), "Http", server, QString::number(port) ); else (void)new KListViewItem( m_viewCddbServer, m_viewCddbServer->lastItem(), "Cddbp", server, QString::number(port) ); } enDisableButtons(); }
void DolphinIconsViewSettings::save() { KConfig* config = kapp->config(); setConfigGroup(config); config->writeEntry("Icon Size", m_iconSize); if (m_arrangement == QIconView::LeftToRight) { config->writeEntry("Arrangement", "Left to Right"); } else { config->writeEntry("Arrangement", "Top to Bottom"); } config->writeEntry("Preview Size", m_previewSize); config->writeEntry("Grid Width", m_gridWidth); config->writeEntry("Grid Height", m_gridHeight); config->writeEntry("Grid Spacing", m_gridSpacing); config->writeEntry("Font Size", m_fontSize); config->writeEntry("Font Family", m_fontFamily); config->writeEntry("Number of Textlines", m_textlinesCount); }
KProtocolManager::ProxyAuthMode KProtocolManager::proxyAuthMode() { KConfig *cfg = config(); cfg->setGroup("Proxy Settings"); return static_cast< ProxyAuthMode >(cfg->readNumEntry("AuthMode")); }
bool KProtocolManager::useCache() { KConfig *cfg = http_config(); return cfg->readBoolEntry("UseCache", true); }
KNotesApp::KNotesApp() : DCOPObject("KNotesIface"), QLabel( 0, 0, WType_TopLevel ), m_alarm( 0 ), m_listener( 0 ), m_find( 0 ), m_findPos( 0 ) { connect( kapp, SIGNAL(lastWindowClosed()), kapp, SLOT(quit()) ); m_noteList.setAutoDelete( true ); m_noteActions.setAutoDelete( true ); // create the dock widget... KWin::setSystemTrayWindowFor( winId(), qt_xrootwin() ); QToolTip::add( this, i18n( "KNotes: Sticky notes for KDE" ) ); setBackgroundMode( X11ParentRelative ); setPixmap( KSystemTray::loadIcon( "knotes" ) ); // set the initial style KNote::setStyle( KNotesGlobalConfig::style() ); // create the GUI... new KAction( i18n("New Note"), "filenew", 0, this, SLOT(newNote()), actionCollection(), "new_note" ); new KAction( i18n("New Note From Clipboard"), "editpaste", 0, this, SLOT(newNoteFromClipboard()), actionCollection(), "new_note_clipboard" ); new KAction( i18n("Show All Notes"), "knotes", 0, this, SLOT(showAllNotes()), actionCollection(), "show_all_notes" ); new KAction( i18n("Hide All Notes"), "fileclose", 0, this, SLOT(hideAllNotes()), actionCollection(), "hide_all_notes" ); new KHelpMenu( this, kapp->aboutData(), false, actionCollection() ); KStdAction::find( this, SLOT(slotOpenFindDialog()), actionCollection() ); KStdAction::preferences( this, SLOT(slotPreferences()), actionCollection() ); KStdAction::keyBindings( this, SLOT(slotConfigureAccels()), actionCollection() ); //FIXME: no shortcut removing!? KStdAction::quit( this, SLOT(slotQuit()), actionCollection() )->setShortcut( 0 ); setXMLFile( instance()->instanceName() + "appui.rc" ); m_guiBuilder = new KXMLGUIBuilder( this ); m_guiFactory = new KXMLGUIFactory( m_guiBuilder, this ); m_guiFactory->addClient( this ); m_context_menu = static_cast<KPopupMenu*>(m_guiFactory->container( "knotes_context", this )); m_note_menu = static_cast<KPopupMenu*>(m_guiFactory->container( "notes_menu", this )); // get the most recent XML UI file QString xmlFileName = instance()->instanceName() + "ui.rc"; QString filter = QString::fromLatin1( instance()->instanceName() + '/' ) + xmlFileName; QStringList fileList = instance()->dirs()->findAllResources( "data", filter ) + instance()->dirs()->findAllResources( "data", xmlFileName ); QString doc; KXMLGUIClient::findMostRecentXMLFile( fileList, doc ); m_noteGUI.setContent( doc ); // create accels for global shortcuts m_globalAccel = new KGlobalAccel( this, "global accel" ); m_globalAccel->insert( "global_new_note", i18n("New Note"), "", ALT+SHIFT+Key_N, ALT+SHIFT+Key_N , this, SLOT(newNote()), true, true ); m_globalAccel->insert( "global_new_note_clipboard", i18n("New Note From Clipboard"), "", ALT+SHIFT+Key_C, ALT+SHIFT+Key_C, this, SLOT(newNoteFromClipboard()), true, true ); m_globalAccel->insert( "global_hide_all_notes", i18n("Hide All Notes"), "", ALT+SHIFT+Key_H, ALT+SHIFT+Key_H , this, SLOT(hideAllNotes()), true, true ); m_globalAccel->insert( "global_show_all_notes", i18n("Show All Notes"), "", ALT+SHIFT+Key_S, ALT+SHIFT+Key_S, this, SLOT(showAllNotes()), true, true ); m_globalAccel->readSettings(); KConfig *config = KGlobal::config(); config->setGroup( "Global Keybindings" ); m_globalAccel->setEnabled( config->readBoolEntry( "Enabled", true ) ); updateGlobalAccels(); // clean up old config files KNotesLegacy::cleanUp(); // create the resource manager m_manager = new KNotesResourceManager(); connect( m_manager, SIGNAL(sigRegisteredNote( KCal::Journal * )), this, SLOT(createNote( KCal::Journal * )) ); connect( m_manager, SIGNAL(sigDeregisteredNote( KCal::Journal * )), this, SLOT(killNote( KCal::Journal * )) ); // read the notes m_manager->load(); // read the old config files, convert and add them KCal::CalendarLocal calendar( QString::fromLatin1( "UTC" ) ); if ( KNotesLegacy::convert( &calendar ) ) { KCal::Journal::List notes = calendar.journals(); KCal::Journal::List::ConstIterator it; for ( it = notes.begin(); it != notes.end(); ++it ) m_manager->addNewNote( *it ); m_manager->save(); } // set up the alarm reminder - do it after loading the notes because this // is used as a check if updateNoteActions has to be called for a new note m_alarm = new KNotesAlarm( m_manager, this ); // create the socket and possibly start listening for connections m_listener = new KServerSocket(); m_listener->setResolutionEnabled( true ); connect( m_listener, SIGNAL(readyAccept()), SLOT(acceptConnection()) ); updateNetworkListener(); if ( m_noteList.count() == 0 && !kapp->isRestored() ) newNote(); updateNoteActions(); }
bool KProtocolManager::useReverseProxy() { KConfig *cfg = config(); cfg->setGroup("Proxy Settings"); return cfg->readBoolEntry("ReversedException", false); }
KBBGame::KBBGame() : KTopLevelWidget() { int i; setCaption(QString("KBlackBox ")+KBVERSION); menu = new KMenuBar(this, "menu"); QPopupMenu *game = new QPopupMenu; QPopupMenu *file = new QPopupMenu; sizesm = new QPopupMenu; ballsm = new QPopupMenu; QPopupMenu *help = new QPopupMenu; options = new QPopupMenu; CHECK_PTR( file ); CHECK_PTR( game ); CHECK_PTR( help ); CHECK_PTR( sizesm ); CHECK_PTR( ballsm ); CHECK_PTR( options ); CHECK_PTR( menu ); help->insertItem( trans->translate("&Help"), ID_HELP ); help->setAccel( CTRL+Key_H, ID_HELP ); help->insertSeparator(); help->insertItem( trans->translate("&About KBlackBox"), ID_ABOUT ); help->setAccel( CTRL+Key_A, ID_ABOUT ); help->insertItem( trans->translate("About &Qt"), ID_ABOUT_QT ); file->insertItem( trans->translate("&Quit"), ID_QUIT ); file->setAccel( CTRL+Key_Q, ID_QUIT ); game->insertItem( trans->translate("&New"), ID_NEW ); game->insertItem( trans->translate("&Give up"), ID_GIVEUP ); game->insertItem( trans->translate("&Done"), ID_DONE ); game->insertSeparator(); game->insertItem( trans->translate("&Resize"), ID_RESIZE ); sizes1id = sizesm->insertItem( " 8 x 8 ", this, SLOT(size1()) ); sizes2id = sizesm->insertItem( " 10 x 10 ", this, SLOT(size2()) ); sizes3id = sizesm->insertItem( " 12 x 12 ", this, SLOT(size3()) ); sizesm->setCheckable( TRUE ); balls1id = ballsm->insertItem( " 4 ", this, SLOT(balls1()) ); balls2id = ballsm->insertItem( " 6 ", this, SLOT(balls2()) ); balls3id = ballsm->insertItem( " 8 ", this, SLOT(balls3()) ); ballsm->setCheckable( TRUE ); options->insertItem( trans->translate("&Size"), sizesm ); options->insertItem( trans->translate("&Balls"), ballsm ); tut1id = options->insertItem( trans->translate("&Tutorial"), this, SLOT(tutorialSwitch()) ); options->setCheckable( TRUE ); connect( file, SIGNAL(activated(int)), SLOT(callBack(int)) ); connect( help, SIGNAL(activated(int)), SLOT(callBack(int)) ); connect( game, SIGNAL(activated(int)), SLOT(callBack(int)) ); menu->insertItem( trans->translate("&File"), file ); menu->insertItem( trans->translate("&Game"), game ); menu->insertItem( trans->translate("&Options"), options ); menu->insertSeparator(); menu->insertItem( trans->translate("&Help"), help ); menu->show(); setMenu( menu ); KIconLoader *loader = kapp->getIconLoader(); QPixmap **pix = new QPixmap*[NROFTYPES]; pix[0] = new QPixmap(); *pix[0] = loader->loadIcon( pFNames[0] ); if (!pix[0]->isNull()) { debug( "Pixmap \"%s\" loaded.", pFNames[0] ); for (i = 1; i < NROFTYPES; i++) { pix[i] = new QPixmap; *pix[i] = loader->loadIcon( pFNames[i] ); if (!pix[i]->isNull()) { debug( "Pixmap \"%s\" loaded.", pFNames[i] ); } else { pix[i] = pix[i-1]; pix[i]->detach(); debug( "Cannot find pixmap \"%s\". Using previous one.", pFNames[i] ); } } } else { debug( "Cannot find pixmap \"%s\". Pixmaps will not be loaded.", pFNames[0] ); delete pix[0]; delete pix; pix = NULL; } gr = new KBBGraphic( pix, this ); connect( gr, SIGNAL(inputAt(int,int,int)), this, SLOT(gotInputAt(int,int,int)) ); connect( this, SIGNAL(gameRuns(bool)), gr, SLOT(setInputAccepted(bool)) ); connect( gr, SIGNAL(endMouseClicked()), this, SLOT(gameFinished()) ); /* QToolTip::add( doneButton, trans->translate( "Click here when you think you placed all the balls.") ); */ QString tmps; stat = new KStatusBar( this ); tmps.sprintf( "aaaaaaaa" ); stat->insertItem( (const char *) tmps, SSCORE ); tmps.sprintf( "aaaaaaaaaaa" ); stat->insertItem( (const char *) tmps, SBALLS ); tmps.sprintf( "aaaaaaa" ); stat->insertItem( (const char *) tmps, SRUN ); tmps.sprintf( "aaaaaaaaaa" ); stat->insertItem( (const char *) tmps, SSIZE ); setStatusBar( stat ); tool = new KToolBar( this ); tool->insertButton( loader->loadIcon("exit.xpm"), ID_QUIT, TRUE, trans->translate("Quit") ); tool->insertButton( loader->loadIcon("reload.xpm"), ID_NEW, TRUE, trans->translate("New") ); tool->insertButton( loader->loadIcon("giveup.xpm"), ID_GIVEUP, TRUE, trans->translate("Give up") ); tool->insertButton( loader->loadIcon("done.xpm"), ID_DONE, TRUE, trans->translate("Done") ); tool->insertSeparator(); tool->insertButton( loader->loadIcon("help.xpm"), ID_HELP, TRUE, trans->translate("Help") ); connect( tool, SIGNAL(clicked(int)), SLOT(callBack(int)) ); addToolBar( tool ); tool->setBarPos( KToolBar::Top ); tool->show(); /* Game initializations */ running = FALSE; gameBoard = NULL; KConfig *kConf; int j; kConf = KApplication::getKApplication()->getConfig(); kConf->setGroup( "KBlackBox Setup" ); if (kConf->hasKey( "Balls" )) { i = kConf->readNumEntry( "Balls" ); balls = i; switch (i) { case 4: ballsm->setItemChecked( balls1id, TRUE ); break; case 6: ballsm->setItemChecked( balls2id, TRUE ); break; case 8: ballsm->setItemChecked( balls3id, TRUE ); break; } } else { balls = 4; ballsm->setItemChecked( balls1id, TRUE ); } if ((kConf->hasKey( "Width" )) && (kConf->hasKey( "Balls" ))) { i = kConf->readNumEntry( "Width" ); j = kConf->readNumEntry( "Height" ); gr->setSize( i+4, j+4 ); // +4 is the space for "lasers" and an edge... gameBoard = new RectOnArray( gr->numC(), gr->numR() ); switch (i) { case 8: sizesm->setItemChecked( sizes1id, TRUE ); break; case 10: sizesm->setItemChecked( sizes2id, TRUE ); break; case 12: sizesm->setItemChecked( sizes3id, TRUE ); break; } } else { gr->setSize( 8+4, 8+4 ); // +4 is the space for "lasers" and an edge... gameBoard = new RectOnArray( gr->numC(), gr->numR() ); sizesm->setItemChecked( sizes1id, TRUE ); } if (kConf->hasKey( "tutorial" )) { tutorial = (bool) kConf->readNumEntry( "tutorial" ); } else tutorial = FALSE; options->setItemChecked( tut1id, tutorial ); QString s, s1; int pos; setMinSize(); gameResize(); if (kConf->hasKey( "appsize" )) { s = kConf->readEntry( "appsize" ); debug("%s", (const char *) s); pos = s.find( 'x' ); s1 = s.right( s.length() - pos - 1 ); s.truncate( pos - 1 ); // debug("%s", (const char *) s); // debug("%s", (const char *) s1); resize( s.toInt(), s1.toInt() ); } setScore( 0 ); ballsPlaced = 0; updateStats(); setView( gr ); newGame(); }
PanoLastPage::PanoLastPage(PanoManager* const mngr, QWizard* const dlg) : DWizardPage(dlg, i18nc("@title:window", "<b>Panorama Stitched</b>")), d(new Private) { KConfig config; KConfigGroup group = config.group("Panorama Settings"); d->mngr = mngr; DVBox* const vbox = new DVBox(this); d->title = new QLabel(vbox); d->title->setOpenExternalLinks(true); d->title->setWordWrap(true); QVBoxLayout* const formatVBox = new QVBoxLayout(); d->saveSettingsGroupBox = new QGroupBox(i18nc("@title:group", "Save Settings"), vbox); d->saveSettingsGroupBox->setLayout(formatVBox); formatVBox->addStretch(1); QLabel* const fileTemplateLabel = new QLabel(i18nc("@label:textbox", "File name template:"), d->saveSettingsGroupBox); formatVBox->addWidget(fileTemplateLabel); d->fileTemplateQLineEdit = new QLineEdit(QLatin1String("panorama"), d->saveSettingsGroupBox); d->fileTemplateQLineEdit->setToolTip(i18nc("@info:tooltip", "Name of the panorama file (without its extension).")); d->fileTemplateQLineEdit->setWhatsThis(i18nc("@info:whatsthis", "<b>File name template</b>: Set here the base name of the files that " "will be saved. For example, if your template is <i>panorama</i> and if " "you chose a JPEG output, then your panorama will be saved with the " "name <i>panorama.jpg</i>. If you choose to save also the project file, " "it will have the name <i>panorama.pto</i>.")); formatVBox->addWidget(d->fileTemplateQLineEdit); d->savePtoCheckBox = new QCheckBox(i18nc("@option:check", "Save project file"), d->saveSettingsGroupBox); d->savePtoCheckBox->setChecked(group.readEntry("Save PTO", false)); d->savePtoCheckBox->setToolTip(i18nc("@info:tooltip", "Save the project file for further processing within Hugin GUI.")); d->savePtoCheckBox->setWhatsThis(i18nc("@info:whatsthis", "<b>Save project file</b>: You can keep the project file generated to stitch " "your panorama for further tweaking within " "<a href=\"http://hugin.sourceforge.net/\">Hugin</a> by checking this. " "This is useful if you want a different projection, modify the horizon or " "the center of the panorama, or modify the control points to get better results.")); formatVBox->addWidget(d->savePtoCheckBox); d->warningLabel = new QLabel(d->saveSettingsGroupBox); d->warningLabel->hide(); formatVBox->addWidget(d->warningLabel); d->errorLabel = new QLabel(d->saveSettingsGroupBox); d->errorLabel->hide(); formatVBox->addWidget(d->errorLabel); vbox->setStretchFactor(new QWidget(vbox), 2); setPageWidget(vbox); QPixmap leftPix(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/assistant-hugin.png"))); setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation)); connect(d->fileTemplateQLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotTemplateChanged(QString))); connect(d->savePtoCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotPtoCheckBoxChanged(int))); }
/****************************************************************************** * Read the configuration file. * Create the client list and open all calendar files. */ void ADConfigData::readConfig() { kdDebug(5900) << "ADConfigData::readConfig()" << endl; ClientInfo::clear(); KConfig *config = KGlobal::config(); QStringList clients = config->groupList().grep(CLIENT_GROUP_SEARCH); for(QStringList::Iterator cl = clients.begin(); cl != clients.end(); ++cl) { // Read this client's configuration config->setGroup(*cl); QString client = *cl; client.remove(CLIENT_GROUP_SEARCH); QString title = config->readEntry(TITLE_KEY, client); // read app title (default = app name) QCString dcopObject = config->readEntry(DCOP_OBJECT_KEY).local8Bit(); bool startClient = config->readBoolEntry(START_CLIENT_KEY, false); QString calendar = config->readPathEntry(CALENDAR_KEY); // Verify the configuration bool ok = false; if(client.isEmpty() || KStandardDirs::findExe(client).isNull()) kdError(5900) << "ADConfigData::readConfig(): group '" << *cl << "' deleted (client app not found)\n"; else if(calendar.isEmpty()) kdError(5900) << "ADConfigData::readConfig(): no calendar specified for '" << client << "'\n"; else if(dcopObject.isEmpty()) kdError(5900) << "ADConfigData::readConfig(): no DCOP object specified for '" << client << "'\n"; else { ADCalendar *cal = ADCalendar::getCalendar(calendar); if(cal) kdError(5900) << "ADConfigData::readConfig(): calendar registered by multiple clients: " << calendar << endl; else ok = true; } if(!ok) { config->deleteGroup(*cl, true); continue; } // Create the client and calendar objects new ClientInfo(client.local8Bit(), title, dcopObject, calendar, startClient); kdDebug(5900) << "ADConfigData::readConfig(): client " << client << " : calendar " << calendar << endl; } // Remove obsolete CheckInterval entry (if it exists) config->setGroup("General"); config->deleteEntry("CheckInterval"); // Save any updates config->sync(); }
bool KProtocolManager::persistentProxyConnection() { KConfig *cfg = config(); cfg->setGroup(QString::null); return cfg->readBoolEntry("PersistentProxyConnection", false); }
QString KProtocolManager::cacheDir() { KConfig *cfg = http_config(); return cfg->readPathEntry("CacheDir", KGlobal::dirs()->saveLocation("cache", "http")); }
QString KProtocolManager::proxyConfigScript() { KConfig *cfg = config(); cfg->setGroup("Proxy Settings"); return cfg->readEntry("Proxy Config Script"); }
int KProtocolManager::maxCacheAge() { KConfig *cfg = http_config(); return cfg->readNumEntry("MaxCacheAge", DEFAULT_MAX_CACHE_AGE); // 14 days }
void K3bCddbOptionTab::apply() { KConfig* c = kapp->config(); c->setGroup( "Cddb" ); c->writeEntry( "use remote cddb", m_checkRemoteCddb->isChecked() ); c->writeEntry( "use local cddb query", m_checkUseLocalCddb->isChecked() ); c->writeEntry( "save cddb entries locally", m_checkSaveLocalEntries->isChecked() ); c->writeEntry( "use manual cgi path", m_checkManualCgiPath->isChecked() ); c->writeEntry( "cgi path", m_editManualCgiPath->text() ); QStringList cddbServer; QStringList localCddbDirs; QListViewItemIterator it( m_viewLocalDir ); while( it.current() ) { localCddbDirs.append( it.current()->text(0) ); ++it; } QListViewItemIterator it1( m_viewCddbServer ); while( it1.current() ) { cddbServer.append( it1.current()->text(0) + " " + it1.current()->text(1) + ":" + it1.current()->text(2) ); ++it1; } // new config c->writeEntry( "cddb server", cddbServer ); // old config <= 0.7.3 if( c->hasKey( "http server" ) ) c->deleteEntry( "http server" ); if( c->hasKey( "cddbp server" ) ) c->deleteEntry( "cddbp server" ); c->writePathEntry( "local cddb dirs", localCddbDirs ); }
int KProtocolManager::maxCacheSize() { KConfig *cfg = http_config(); return cfg->readNumEntry("MaxCacheSize", DEFAULT_MAX_CACHE_SIZE); // 5 MB }
DolphinIconsViewSettings::DolphinIconsViewSettings(DolphinIconsView::LayoutMode mode) : m_arrangement(QIconView::LeftToRight), m_layoutMode(mode), m_iconSize(KIcon::SizeMedium), m_previewSize(KIcon::SizeMedium), m_gridWidth(0), m_gridHeight(KIcon::SizeMedium), m_gridSpacing(8), m_fontSize(0), m_textlinesCount(2) { KConfig* config = kapp->config(); setConfigGroup(config); // read icon size m_iconSize = config->readNumEntry("Icon Size", -1); if (m_iconSize < 0) { m_iconSize = KIcon::SizeMedium; } // read arrangement const QString arrangement(config->readEntry("Arrangement")); if (arrangement == "Left to Right") { m_arrangement = QIconView::LeftToRight; } else if (arrangement == "Top to Bottom") { m_arrangement = QIconView::TopToBottom; } // read preview size, grid width and grid height m_previewSize = config->readNumEntry("Preview Size", -1); m_gridWidth = config->readNumEntry("Grid Width", -1); m_gridHeight = config->readNumEntry("Grid Height", -1); m_gridSpacing = config->readNumEntry("Grid Spacing", -1); if (mode == DolphinIconsView::Previews) { if (m_previewSize < 0) { m_previewSize = KIcon::SizeEnormous; } if (m_gridWidth < 0) { m_gridWidth = m_previewSize + (m_previewSize / 2); } } else if (m_gridWidth < 0) { m_gridWidth = m_iconSize + (m_iconSize / 2) + (KIcon::SizeLarge * 2); } if (m_gridHeight < 0) { m_gridHeight = m_iconSize * 2; } // read font size and font family m_fontSize = config->readNumEntry("Font Size", -1); m_fontFamily = config->readEntry("Font Family"); const QFont font(KGlobalSettings::generalFont()); if (m_fontSize < 0) { m_fontSize = font.pointSize(); } if (m_fontFamily.isEmpty()) { m_fontFamily = font.family(); } // read textlines count m_textlinesCount = config->readNumEntry("Number of Textlines", 2); }
bool KProtocolManager::markPartial() { KConfig *cfg = config(); cfg->setGroup(QString::null); return cfg->readBoolEntry("MarkPartial", true); }
void KopeteApplication::slotLoadPlugins() { // we have to load the address book early, because calling this enters the Qt event loop when there are remote resources. // The plugin manager is written with the assumption that Kopete will not reenter the event loop during plugin load, // otherwise lots of things break as plugins are loaded, then contacts are added to incompletely initialised MCLVIs Kopete::KABCPersistence::self()->addressBook(); //Create the command handler (looks silly) Kopete::CommandHandler::commandHandler(); //Create the view manager KopeteViewManager::viewManager(); Kopete::AccountManager::self()->load(); Kopete::ContactList::self()->load(); KConfig *config = KGlobal::config(); // Parse command-line arguments KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); bool showConfigDialog = false; config->setGroup( "Plugins" ); /* FIXME: This is crap, if something purged that groups but your accounts * are still working kopete will load the necessary plugins but still show the * stupid accounts dialog (of course empty at that time because account data * gets loaded later on). [mETz - 29.05.2004] */ if ( !config->hasGroup( "Plugins" ) ) showConfigDialog = true; // Listen to arguments /* // TODO: conflicts with emoticon installer and the general meaning // of %U in kopete.desktop if ( args->count() > 0 ) { showConfigDialog = false; for ( int i = 0; i < args->count(); i++ ) Kopete::PluginManager::self()->setPluginEnabled( args->arg( i ), true ); } */ // Prevent plugins from loading? (--disable=foo,bar) QStringList disableArgs = QStringList::split( ',', args->getOption( "disable" ) ); for ( QStringList::ConstIterator it = disableArgs.begin(); it != disableArgs.end(); ++it ) { showConfigDialog = false; Kopete::PluginManager::self()->setPluginEnabled( *it, false ); } // Load some plugins exclusively? (--load-plugins=foo,bar) if ( args->isSet( "load-plugins" ) ) { config->deleteGroup( "Plugins", true ); showConfigDialog = false; QStringList plugins = QStringList::split( ',', args->getOption( "load-plugins" ) ); for ( QStringList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it ) Kopete::PluginManager::self()->setPluginEnabled( *it, true ); } config->sync(); // Disable plugins altogether? (--noplugins) if ( !args->isSet( "plugins" ) ) { // If anybody reenables this I'll get a sword and make a nice chop-suy out // of your body :P [mETz - 29.05.2004] // This screws up kopeterc because there is no way to get the Plugins group back! //config->deleteGroup( "Plugins", true ); showConfigDialog = false; // pretend all plugins were loaded :) QTimer::singleShot(0, this, SLOT( slotAllPluginsLoaded() )); } else { Kopete::PluginManager::self()->loadAllPlugins(); } connect( Kopete::PluginManager::self(), SIGNAL( allPluginsLoaded() ), this, SLOT( slotAllPluginsLoaded() )); if( showConfigDialog ) { // No plugins specified. Show the config dialog. // FIXME: Although it's a bit stupid it is theoretically possible that a user // explicitly configured Kopete to not load plugins on startup. In this // case we don't want this dialog. We need some other config setting // like a bool hasRunKopeteBefore or so to trigger the loading of the // wizard. Maybe using the last run version number is more useful even // as it also allows for other features. - Martijn // FIXME: Possibly we need to influence the showConfigDialog bool based on the // command line arguments processed below. But how exactly? - Martijn // NB: the command line args are completely broken atm. // I don't want to fix them for 3.5 as plugin loading will change for KDE4. - Will AddAccountWizard *m_addwizard = new AddAccountWizard( Kopete::UI::Global::mainWidget(), "addAccountWizard", true, true ); m_addwizard->exec(); Kopete::AccountManager::self()->save(); } }
int KProtocolManager::minimumKeepSize() { KConfig *cfg = config(); cfg->setGroup(QString::null); return cfg->readNumEntry("MinimumKeepSize", DEFAULT_MINIMUM_KEEP_SIZE); // 5000 byte }
void TagDialog::init() { //NOTE We allocate on the stack in Playlist if( parent() != Playlist::instance()->qscrollview() ) setWFlags( getWFlags() | Qt::WDestructiveClose ); KConfig *config = amaroK::config( "TagDialog" ); kTabWidget->addTab( summaryTab, i18n( "Summary" ) ); kTabWidget->addTab( tagsTab, i18n( "Tags" ) ); kTabWidget->addTab( lyricsTab, i18n( "Lyrics" ) ); kTabWidget->addTab( statisticsTab, i18n( "Statistics" ) ); kTabWidget->setCurrentPage( config->readNumEntry( "CurrentTab", 0 ) ); const QStringList artists = CollectionDB::instance()->artistList(); kComboBox_artist->insertStringList( artists ); kComboBox_artist->completionObject()->insertItems( artists ); kComboBox_artist->completionObject()->setIgnoreCase( true ); kComboBox_artist->setCompletionMode( KGlobalSettings::CompletionPopup ); const QStringList albums = CollectionDB::instance()->albumList(); kComboBox_album->insertStringList( albums ); kComboBox_album->completionObject()->insertItems( albums ); kComboBox_album->completionObject()->setIgnoreCase( true ); kComboBox_album->setCompletionMode( KGlobalSettings::CompletionPopup ); const QStringList composers = CollectionDB::instance()->composerList(); kComboBox_composer->insertStringList( composers ); kComboBox_composer->completionObject()->insertItems( composers ); kComboBox_composer->completionObject()->setIgnoreCase( true ); kComboBox_composer->setCompletionMode( KGlobalSettings::CompletionPopup ); kComboBox_rating->insertStringList( MetaBundle::ratingList() ); // const QStringList genres = MetaBundle::genreList(); const QStringList genres = CollectionDB::instance()->genreList(); kComboBox_genre->insertStringList( genres ); kComboBox_genre->completionObject()->insertItems( genres ); kComboBox_genre->completionObject()->setIgnoreCase( true ); // looks better to have a blank label than 0, we can't do this in // the UI file due to bug in Designer kIntSpinBox_track->setSpecialValueText( " " ); kIntSpinBox_year->setSpecialValueText( " " ); kIntSpinBox_score->setSpecialValueText( " " ); kIntSpinBox_discNumber->setSpecialValueText( " " ); if( !AmarokConfig::useRatings() ) { kComboBox_rating->hide(); ratingLabel->hide(); } if( !AmarokConfig::useScores() ) { kIntSpinBox_score->hide(); scoreLabel->hide(); } //HACK due to deficiency in Qt that will be addressed in version 4 // QSpinBox doesn't emit valueChanged if you edit the value with // the lineEdit until you change the keyboard focus connect( kIntSpinBox_year->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kIntSpinBox_track->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kIntSpinBox_score->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kIntSpinBox_discNumber->child( "qt_spinbox_edit" ), SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); // Connects for modification check connect( kLineEdit_title, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kComboBox_composer, SIGNAL(activated( int )), SLOT(checkModified()) ); connect( kComboBox_artist, SIGNAL(activated( int )), SLOT(checkModified()) ); connect( kComboBox_artist, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kComboBox_album, SIGNAL(activated( int )), SLOT(checkModified()) ); connect( kComboBox_album, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kComboBox_genre, SIGNAL(activated( int )), SLOT(checkModified()) ); connect( kComboBox_genre, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kComboBox_rating, SIGNAL(activated( int )), SLOT(checkModified()) ); connect( kComboBox_rating, SIGNAL(textChanged( const QString& )), SLOT(checkModified()) ); connect( kIntSpinBox_track,SIGNAL(valueChanged( int )), SLOT(checkModified()) ); connect( kIntSpinBox_year, SIGNAL(valueChanged( int )), SLOT(checkModified()) ); connect( kIntSpinBox_score,SIGNAL(valueChanged( int )), SLOT(checkModified()) ); connect( kTextEdit_comment,SIGNAL(textChanged()), SLOT(checkModified()) ); connect( kTextEdit_lyrics, SIGNAL(textChanged()), SLOT(checkModified()) ); // Remember original button text m_buttonMbText = pushButton_musicbrainz->text(); connect( pushButton_cancel, SIGNAL(clicked()), SLOT(cancelPressed()) ); connect( pushButton_ok, SIGNAL(clicked()), SLOT(accept()) ); connect( pushButton_open, SIGNAL(clicked()), SLOT(openPressed()) ); connect( pushButton_previous, SIGNAL(clicked()), SLOT(previousTrack()) ); connect( pushButton_next, SIGNAL(clicked()), SLOT(nextTrack()) ); connect( checkBox_perTrack, SIGNAL(clicked()), SLOT(perTrack()) ); // draw an icon onto the open-in-konqui button pushButton_open->setIconSet( kapp->iconLoader()->loadIconSet( "fileopen", KIcon::Small ) ); //Update lyrics on Context Browser connect( this, SIGNAL(lyricsChanged( const QString& )), ContextBrowser::instance(), SLOT( lyricsChanged( const QString& ) ) ); //Update cover connect( CollectionDB::instance(), SIGNAL( coverFetched( const QString&, const QString& ) ), this, SLOT( loadCover( const QString&, const QString& ) ) ); connect( CollectionDB::instance(), SIGNAL( coverChanged( const QString&, const QString& ) ), this, SLOT( loadCover( const QString&, const QString& ) ) ); #if HAVE_TUNEPIMP connect( pushButton_musicbrainz, SIGNAL(clicked()), SLOT(musicbrainzQuery()) ); #else QToolTip::add( pushButton_musicbrainz, i18n("Please install MusicBrainz to enable this functionality") ); #endif connect( pushButton_guessTags, SIGNAL(clicked()), SLOT( guessFromFilename() ) ); connect( pushButton_setFilenameSchemes, SIGNAL(clicked()), SLOT( setFileNameSchemes() ) ); if( m_urlList.count() ) { //editing multiple tracks m_perTrack = false; setMultipleTracksMode(); readMultipleTracks(); checkBox_perTrack->setChecked( m_perTrack ); if( m_urlList.count() == 1 ) { checkBox_perTrack->setEnabled( false ); pushButton_previous->setEnabled( false ); pushButton_next->setEnabled( false ); } else { checkBox_perTrack->setEnabled( true ); pushButton_previous->setEnabled( m_perTrack ); pushButton_next->setEnabled( m_perTrack ); } } else { m_perTrack = true; checkBox_perTrack->hide(); if( !m_playlistItem ) { pushButton_previous->hide(); pushButton_next->hide(); } loadLyrics( m_bundle.url() ); readTags(); } // make it as small as possible resize( sizeHint().width(), minimumSize().height() ); }
bool KProtocolManager::autoResume() { KConfig *cfg = config(); cfg->setGroup(QString::null); return cfg->readBoolEntry("AutoResume", false); }
void KDesktopConfig::load( bool useDefaults ) { // get number of desktops NETRootInfo info( qt_xdisplay(), NET::NumberOfDesktops | NET::DesktopNames ); int n = info.numberOfDesktops(); int konq_screen_number = 0; if (qt_xdisplay()) konq_screen_number = DefaultScreen(qt_xdisplay()); QCString groupname; if (konq_screen_number == 0) groupname = "Desktops"; else groupname.sprintf("Desktops-screen-%d", konq_screen_number); KConfig * kwinconfig = new KConfig("kwinrc"); kwinconfig->setReadDefaults( useDefaults ); kwinconfig->setGroup("Desktops"); for(int i = 1; i <= maxDesktops; i++) { QString key_name(QString("Name_") + QString::number(i)); QString name = QString::fromUtf8(info.desktopName(i)); if (name.isEmpty()) // Get name from configuration if none is set in the WM. { name = kwinconfig->readEntry(key_name, i18n("Desktop %1").arg(i)); } _nameInput[i-1]->setText(name); // Is this entry immutable or not in the range of configured desktops? _labelImmutable[i - 1] = kwinconfig->entryIsImmutable(key_name); _nameInput[i-1]->setEnabled(i <= n && !_labelImmutable[i - 1]); } _numInput->setEnabled(!kwinconfig->entryIsImmutable("Number")); delete kwinconfig; kwinconfig = 0; QString configfile; if (konq_screen_number == 0) configfile = "kdesktoprc"; else configfile.sprintf("kdesktop-screen-%drc", konq_screen_number); KConfig *config = new KConfig(configfile, false, false); config->setReadDefaults( useDefaults ); config->setGroup("Mouse Buttons"); _wheelOption->setChecked(config->readBoolEntry("WheelSwitchesWorkspace",false)); _wheelOptionImmutable = config->entryIsImmutable("WheelSwitchesWorkspace"); if (_wheelOptionImmutable || n<2) _wheelOption->setEnabled( false ); delete config; config = 0; _numInput->setValue(n); emit changed( useDefaults ); }
bool KProtocolManager::persistentConnections() { KConfig *cfg = config(); cfg->setGroup(QString::null); return cfg->readBoolEntry("PersistentConnections", true); }
KateConfigDialog::KateConfigDialog(KateMainWindow *parent, Kate::View *view) : KDialogBase(KDialogBase::TreeList, i18n("Configure"), KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel | KDialogBase::Help, KDialogBase::Ok, parent, "configdialog") { KConfig *config = KateApp::self()->config(); KWin::setIcons(winId(), KateApp::self()->icon(), KateApp::self()->miniIcon()); actionButton(KDialogBase::Apply)->setEnabled(false); mainWindow = parent; setMinimumSize(600, 400); v = view; pluginPages.setAutoDelete(false); editorPages.setAutoDelete(false); QStringList path; setShowIconsInTreeList(true); path.clear(); path << i18n("Application"); setFolderIcon(path, SmallIcon("kate", KIcon::SizeSmall)); path.clear(); // BEGIN General page path << i18n("Application") << i18n("General"); QFrame *frGeneral = addPage(path, i18n("General Options"), BarIcon("gohome", KIcon::SizeSmall)); QVBoxLayout *lo = new QVBoxLayout(frGeneral); lo->setSpacing(KDialog::spacingHint()); config->setGroup("General"); // GROUP with the one below: "Appearance" QButtonGroup *bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("&Appearance"), frGeneral); lo->addWidget(bgStartup); // show full path in title config->setGroup("General"); cb_fullPath = new QCheckBox(i18n("&Show full path in title"), bgStartup); cb_fullPath->setChecked(mainWindow->viewManager()->getShowFullPath()); QWhatsThis::add(cb_fullPath, i18n("If this option is checked, the full document path will be shown in the window caption.")); connect(cb_fullPath, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); // GROUP with the one below: "Behavior" bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("&Behavior"), frGeneral); lo->addWidget(bgStartup); // sync the konsole ? cb_syncKonsole = new QCheckBox(bgStartup); cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document")); cb_syncKonsole->setChecked(parent->syncKonsole); QWhatsThis::add(cb_syncKonsole, i18n("If this is checked, the built in Konsole will <code>cd</code> to the directory " "of the active document when started and whenever the active document changes, " "if the document is a local file.")); connect(cb_syncKonsole, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); // modified files notification cb_modNotifications = new QCheckBox(i18n("Wa&rn about files modified by foreign processes"), bgStartup); cb_modNotifications->setChecked(parent->modNotification); QWhatsThis::add(cb_modNotifications, i18n("If enabled, when Kate receives focus you will be asked what to do with " "files that have been modified on the hard disk. If not enabled, you will " "be asked what to do with a file that has been modified on the hard disk only " "when that file gains focus inside Kate.")); connect(cb_modNotifications, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); // GROUP with the one below: "Meta-informations" bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("Meta-Information"), frGeneral); lo->addWidget(bgStartup); // save meta infos cb_saveMetaInfos = new QCheckBox(bgStartup); cb_saveMetaInfos->setText(i18n("Keep &meta-information past sessions")); cb_saveMetaInfos->setChecked(KateDocManager::self()->getSaveMetaInfos()); QWhatsThis::add(cb_saveMetaInfos, i18n("Check this if you want document configuration like for example " "bookmarks to be saved past editor sessions. The configuration will be " "restored if the document has not changed when reopened.")); connect(cb_saveMetaInfos, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); // meta infos days QHBox *hbDmf = new QHBox(bgStartup); hbDmf->setEnabled(KateDocManager::self()->getSaveMetaInfos()); QLabel *lDmf = new QLabel(i18n("&Delete unused meta-information after:"), hbDmf); sb_daysMetaInfos = new QSpinBox(0, 180, 1, hbDmf); sb_daysMetaInfos->setSpecialValueText(i18n("(never)")); sb_daysMetaInfos->setSuffix(i18n(" day(s)")); sb_daysMetaInfos->setValue(KateDocManager::self()->getDaysMetaInfos()); lDmf->setBuddy(sb_daysMetaInfos); connect(cb_saveMetaInfos, SIGNAL(toggled(bool)), hbDmf, SLOT(setEnabled(bool))); connect(sb_daysMetaInfos, SIGNAL(valueChanged(int)), this, SLOT(slotChanged())); lo->addStretch(1); // :-] works correct without autoadd // END General page path.clear(); // BEGIN Session page path << i18n("Application") << i18n("Sessions"); QFrame *frSessions = addPage(path, i18n("Session Management"), BarIcon("history", KIcon::SizeSmall)); lo = new QVBoxLayout(frSessions); lo->setSpacing(KDialog::spacingHint()); // GROUP with the one below: "Startup" bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("Elements of Sessions"), frSessions); lo->addWidget(bgStartup); // restore view config cb_restoreVC = new QCheckBox(bgStartup); cb_restoreVC->setText(i18n("Include &window configuration")); config->setGroup("General"); cb_restoreVC->setChecked(config->readBoolEntry("Restore Window Configuration", true)); QWhatsThis::add(cb_restoreVC, i18n("Check this if you want all your views and frames restored each time you open Kate")); connect(cb_restoreVC, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); QRadioButton *rb1, *rb2, *rb3; sessions_start = new QButtonGroup(1, Qt::Horizontal, i18n("Behavior on Application Startup"), frSessions); lo->add(sessions_start); sessions_start->setRadioButtonExclusive(true); sessions_start->insert(rb1 = new QRadioButton(i18n("&Start new session"), sessions_start), 0); sessions_start->insert(rb2 = new QRadioButton(i18n("&Load last-used session"), sessions_start), 1); sessions_start->insert(rb3 = new QRadioButton(i18n("&Manually choose a session"), sessions_start), 2); config->setGroup("General"); QString sesStart(config->readEntry("Startup Session", "manual")); if(sesStart == "new") sessions_start->setButton(0); else if(sesStart == "last") sessions_start->setButton(1); else sessions_start->setButton(2); connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); sessions_exit = new QButtonGroup(1, Qt::Horizontal, i18n("Behavior on Application Exit or Session Switch"), frSessions); lo->add(sessions_exit); sessions_exit->setRadioButtonExclusive(true); sessions_exit->insert(rb1 = new QRadioButton(i18n("&Do not save session"), sessions_exit), 0); sessions_exit->insert(rb2 = new QRadioButton(i18n("&Save session"), sessions_exit), 1); sessions_exit->insert(rb3 = new QRadioButton(i18n("&Ask user"), sessions_exit), 2); config->setGroup("General"); QString sesExit(config->readEntry("Session Exit", "save")); if(sesExit == "discard") sessions_exit->setButton(0); else if(sesExit == "save") sessions_exit->setButton(1); else sessions_exit->setButton(2); connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); lo->addStretch(1); // :-] works correct without autoadd // END Session page path.clear(); // file selector page path << i18n("Application") << i18n("File Selector"); QVBox *page = addVBoxPage(path, i18n("File Selector Settings"), BarIcon("fileopen", KIcon::SizeSmall)); fileSelConfigPage = new KFSConfigPage(page, "file selector config page", mainWindow->fileselector); connect(fileSelConfigPage, SIGNAL(changed()), this, SLOT(slotChanged())); path.clear(); path << i18n("Application") << i18n("Document List"); page = addVBoxPage(path, i18n("Document List Settings"), BarIcon("view_text", KIcon::SizeSmall)); filelistConfigPage = new KFLConfigPage(page, "file list config page", mainWindow->filelist); connect(filelistConfigPage, SIGNAL(changed()), this, SLOT(slotChanged())); path.clear(); path << i18n("Application") << i18n("Plugins"); /*QVBox **/ page = addVBoxPage(path, i18n("Plugin Manager"), BarIcon("connect_established", KIcon::SizeSmall)); KateConfigPluginPage *configPluginPage = new KateConfigPluginPage(page, this); connect(configPluginPage, SIGNAL(changed()), this, SLOT(slotChanged())); // Tools->External Tools menu path.clear(); path << i18n("Application") << i18n("External Tools"); page = addVBoxPage(path, i18n("External Tools"), BarIcon("configure", KIcon::SizeSmall)); configExternalToolsPage = new KateExternalToolsConfigWidget(page, "external tools config page"); connect(configExternalToolsPage, SIGNAL(changed()), this, SLOT(slotChanged())); // editor widgets from kwrite/kwdialog path.clear(); path << i18n("Editor"); setFolderIcon(path, SmallIcon("edit", KIcon::SizeSmall)); for(uint i = 0; i < KTextEditor::configInterfaceExtension(v->document())->configPages(); i++) { path.clear(); path << i18n("Editor") << KTextEditor::configInterfaceExtension(v->document())->configPageName(i); /*QVBox **/ page = addVBoxPage(path, KTextEditor::configInterfaceExtension(v->document())->configPageFullName(i), KTextEditor::configInterfaceExtension(v->document())->configPagePixmap(i, KIcon::SizeSmall)); KTextEditor::ConfigPage *cPage = KTextEditor::configInterfaceExtension(v->document())->configPage(i, page); connect(cPage, SIGNAL(changed()), this, SLOT(slotChanged())); editorPages.append(cPage); } KatePluginList &pluginList(KatePluginManager::self()->pluginList()); for(unsigned int i = 0; i < pluginList.size(); ++i) { if(pluginList[i].load && Kate::pluginConfigInterfaceExtension(pluginList[i].plugin)) addPluginPage(pluginList[i].plugin); } enableButtonSeparator(true); dataChanged = false; unfoldTreeList(); }
void KTreemapPage::apply() { KConfig * config = kapp->config(); config->setGroup( "Treemaps" ); config->writeEntry( "Squarify", _squarify->isChecked() ); config->writeEntry( "CushionShading", _doCushionShading->isChecked() ); config->writeEntry( "AmbientLight", _ambientLight->value() ); config->writeEntry( "HeightScaleFactor", _heightScalePercent->value() / 100.0 ); config->writeEntry( "EnsureContrast", _ensureContrast->isChecked() ); config->writeEntry( "ForceCushionGrid", _forceCushionGrid->isChecked() ); config->writeEntry( "MinTileSize", _minTileSize->value() ); config->writeEntry( "AutoResize", _autoResize->isChecked() ); config->writeEntry( "CushionGridColor", _cushionGridColor->color() ); config->writeEntry( "OutlineColor", _outlineColor->color() ); config->writeEntry( "FileFillColor", _fileFillColor->color() ); config->writeEntry( "DirFillColor", _dirFillColor->color() ); config->writeEntry( "HighlightColor", _highlightColor->color() ); if ( treemapView() ) { treemapView()->readConfig(); treemapView()->rebuildTreemap(); } }