Esempio n. 1
0
void KMMainView::saveSettings()
{
	TDEConfig	*conf = KMFactory::self()->printConfig();
	conf->setGroup("General");
	conf->writeEntry("ViewType",(int)m_printerview->viewType());
	conf->writeEntry("Orientation",(int)orientation());
	conf->writeEntry("ViewToolBar",((TDEToggleAction*)m_actions->action("view_toolbar"))->isChecked());
	conf->writeEntry("ViewMenuBar",static_cast<TDEToggleAction*>( m_actions->action("view_menubar") )->isChecked());
	conf->writeEntry("ViewPrinterInfos",((TDEToggleAction*)m_actions->action("view_printerinfos"))->isChecked());
	conf->sync();
}
Esempio n. 2
0
/** Save the application mPrefs. */
void kweather::savePrefs(){
    kdDebug(12004) << "Saving Prefs..." << endl;
    TDEConfig *kcConfig = config();
    
    kcConfig->setGroup("General Options");
    kcConfig->writeEntry("logging", logOn);
    kcConfig->writeEntry("report_location", reportLocation);
    kcConfig->writeEntry("smallview_mode", mViewMode);
    kcConfig->writePathEntry("log_file_name", fileName );
    kcConfig->sync();
}
Esempio n. 3
0
void KSaveIOConfig::setNoProxyFor( const TQString& _noproxy )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( "Proxy Settings" );
  cfg->writeEntry( "NoProxyFor", _noproxy );
  cfg->sync();
}
Esempio n. 4
0
void KSaveIOConfig::setProxyAuthMode(KProtocolManager::ProxyAuthMode mode)
{
  TDEConfig* cfg = config ();
  cfg->setGroup( "Proxy Settings" );
  cfg->writeEntry( "AuthMode", static_cast<int>(mode) );
  cfg->sync();
}
Esempio n. 5
0
void KSaveIOConfig::setUseReverseProxy( bool mode )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( "Proxy Settings" );
  cfg->writeEntry("ReversedException", mode);
  cfg->sync();
}
Esempio n. 6
0
void KSaveIOConfig::setPersistentConnections( bool enable )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( TQString() );
  cfg->writeEntry( "PersistentConnections", enable );
  cfg->sync();
}
Esempio n. 7
0
void KSaveIOConfig::setCacheControl(TDEIO::CacheControl policy)
{
  TDEConfig* cfg = http_config ();
  TQString tmp = TDEIO::getCacheControlString(policy);
  cfg->writeEntry("cache", tmp);
  cfg->sync();
}
Esempio n. 8
0
void KSaveIOConfig::setProxyConnectTimeout( int _timeout )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( TQString() );
  cfg->writeEntry("ProxyConnectTimeout", TQMAX(MIN_TIMEOUT_VALUE,_timeout));
  cfg->sync();
}
Esempio n. 9
0
void KSaveIOConfig::setAutoResume( bool _mode )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( TQString() );
  cfg->writeEntry( "AutoResume", _mode );
  cfg->sync();
}
Esempio n. 10
0
void KSaveIOConfig::setMinimumKeepSize( int _size )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( TQString() );
  cfg->writeEntry( "MinimumKeepSize", _size );
  cfg->sync();
}
Esempio n. 11
0
void KSaveIOConfig::setMarkPartial( bool _mode )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( TQString() );
  cfg->writeEntry( "MarkPartial", _mode );
  cfg->sync();
}
Esempio n. 12
0
main(int argc, char ** argv)
{
 TDECmdLineArgs::init(argc, argv, "test", description, version);
 
 TDEApplication app;
 TDEConfig * cfg = kapp->config();

 TQDict<char> dict;

 dict.insert("Blah", "Arse");
 dict.insert("Blah", "Smack");
 dict.insert("Blah", "Monkey");

 TQDictIterator<char> it(dict);

 TQString key = "TestConfigItem";

 for (; it.current(); ++it) {

  cerr << "Before saving: " << endl;
  cerr << "key : \"" << key << "\"" << endl;
  cerr << "val : \"" << it.current() << "\"" << endl;

  debug("got back [%s]",cfg->writeEntry(key, it.current()));
//  debug("got back [%s]",s.data());

  cerr << "After saving: " << endl;
  cerr << "key : \"" << key << "\"" << endl;
  cerr << "val : \"" << it.current() << "\"" << endl;

  cerr << endl;
 }
}
Esempio n. 13
0
void KSaveIOConfig::setProxyConfigScript( const TQString& _url )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( "Proxy Settings" );
  cfg->writeEntry( "Proxy Config Script", _url );
  cfg->sync();
}
Esempio n. 14
0
void KSaveIOConfig::setProxyFor( const TQString& protocol,
                                 const TQString& _proxy )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( "Proxy Settings" );
  cfg->writeEntry( protocol.lower() + "Proxy", _proxy );
  cfg->sync();
}
Esempio n. 15
0
void TDELocaleConfigNumber::save()
{
  // temperary use of our locale as the global locale
  TDELocale *lsave = TDEGlobal::_locale;
  TDEGlobal::_locale = m_locale;

  TDEConfig *config = TDEGlobal::config();
  TDEConfigGroupSaver saver(config, "Locale");

  KSimpleConfig ent(locate("locale",
			   TQString::fromLatin1("l10n/%1/entry.desktop")
			   .arg(m_locale->country())), true);
  ent.setGroup("KCM Locale");

  TQString str;

  str = ent.readEntry("DecimalSymbol",
		      TQString::fromLatin1("."));
  config->deleteEntry("DecimalSymbol", false, true);
  if (str != m_locale->decimalSymbol())
    config->writeEntry("DecimalSymbol",
		       m_locale->decimalSymbol(), true, true);

  str = ent.readEntry("ThousandsSeparator",
		      TQString::fromLatin1(","));
  config->deleteEntry("ThousandsSeparator", false, true);
  str.replace(TQString::fromLatin1("$0"), TQString());
  if (str != m_locale->thousandsSeparator())
    config->writeEntry("ThousandsSeparator",
		       TQString::fromLatin1("$0%1$0")
		       .arg(m_locale->thousandsSeparator()), true, true);

  str = ent.readEntry("PositiveSign");
  config->deleteEntry("PositiveSign", false, true);
  if (str != m_locale->positiveSign())
    config->writeEntry("PositiveSign", m_locale->positiveSign(), true, true);

  str = ent.readEntry("NegativeSign", TQString::fromLatin1("-"));
  config->deleteEntry("NegativeSign", false, true);
  if (str != m_locale->negativeSign())
    config->writeEntry("NegativeSign", m_locale->negativeSign(), true, true);

  // restore the old global locale
  TDEGlobal::_locale = lsave;
}
Esempio n. 16
0
void Existing_window_condition::cfg_write( TDEConfig& cfg_P ) const
    {
    base::cfg_write( cfg_P );
    TQString save_cfg_group = cfg_P.group();
    cfg_P.setGroup( save_cfg_group + "Window" );
    window()->cfg_write( cfg_P );
    cfg_P.setGroup( save_cfg_group );
    cfg_P.writeEntry( "Type", "EXISTING_WINDOW" ); // overwrites value set in base::cfg_write()
    }
Esempio n. 17
0
void KFSConfigPage::apply()
{
  if ( ! m_changed )
    return;

  m_changed = false;

  TDEConfig *config = kapp->config();
  config->setGroup( "fileselector" );
  // toolbar
  TQStringList l;
  TQListBoxItem *item = acSel->selectedListBox()->firstItem();
  ActionLBItem *aItem;
  while ( item )
  {
    aItem = (ActionLBItem*)item;
    if ( aItem )
    {
      l << aItem->idstring();
    }
    item = item->next();
  }
  config->writeEntry( "toolbar actions", l );
  fileSelector->setupToolbar( config );
  // sync
  int s = 0;
  if ( cbSyncActive->isChecked() )
    s |= KateFileSelector::DocumentChanged;
  if ( cbSyncShow->isChecked() )
    s |= KateFileSelector::GotVisible;
  fileSelector->autoSyncEvents = s;

  // histories
  fileSelector->cmbPath->setMaxItems( sbPathHistLength->value() );
  fileSelector->filter->setMaxCount( sbFilterHistLength->value() );
  // session - theese are read/written directly to the app config,
  //           as they are not needed during operation.
  config->writeEntry( "restore location", cbSesLocation->isChecked() );
  config->writeEntry( "restore last filter", cbSesFilter->isChecked() );
}
Esempio n. 18
0
void Condition_list_base::cfg_write( TDEConfig& cfg_P ) const
    {
    TQString save_cfg_group = cfg_P.group();
    int i = 0;
    for( Iterator it( *this );
         it;
         ++it, ++i )
        {
        cfg_P.setGroup( save_cfg_group + TQString::number( i ));
        it.current()->cfg_write( cfg_P );
        }
    cfg_P.setGroup( save_cfg_group );
    cfg_P.writeEntry( "ConditionsCount", i );
    }
Esempio n. 19
0
void KasPrefsDialog::accept()
{
   TDEConfig *conf = kasbar->config();
   if ( conf ) {
       kasbar->writeConfig( conf );

       conf->setGroup("Layout");
       // TODO: This needs to be made independent of the gui and moved to kastasker
       conf->writeEntry( "MaxBoxes", maxBoxesSpin->value() );

       conf->sync();
   }

   TQDialog::accept();
}
Esempio n. 20
0
void ExtensionManager::saveContainerConfig()
{
//    kdDebug(1210) << "ExtensionManager::saveContainerConfig()" << endl;

    TDEConfig *config = TDEGlobal::config();

    // build the extension list
    TQStringList elist;
    ExtensionList::iterator itEnd = _containers.end();
    for (ExtensionList::iterator it = _containers.begin(); it != itEnd; ++it)
    {
        elist.append((*it)->extensionId());
    }

    // write extension list
    config->setGroup("General");
    config->writeEntry("Extensions2", elist);

    config->sync();
}
Esempio n. 21
0
 int main( int argc, char **argv )
{
  TDEApplication app( argc, argv, "TDEFontDialogTest" );

  TDEConfig aConfig;
  aConfig.setGroup( "TDEFontDialog-test" );

  app.setFont(TQFont("Helvetica",12));

  //  TQFont font = TQFont("Times",18,TQFont::Bold);

  TQFont font = aConfig.readFontEntry( "Chosen" );
  int nRet = TDEFontDialog::getFont(font);
  int flags;
  nRet = TDEFontDialog::getFontDiff(font, flags);
  aConfig.writeEntry( "Chosen", font, true );

  aConfig.sync();
  return nRet;
}
Esempio n. 22
0
void KSaveIOConfig::setUseCache( bool _mode )
{
  TDEConfig* cfg = http_config ();
  cfg->writeEntry( "UseCache", _mode );
  cfg->sync();
}
Esempio n. 23
0
void ExtensionManager::migrateMenubar()
{
    // lame, lame, lame.
    // the menubar applet was just plunked into kicker and not much
    // thought was put into how it should be used. great idea, but no
    // integration. >:-(
    // so now we have to check to see if we HAVE another extension that
    // will have a menubar in it, and if so, abort creating one of our
    // own.
    //
    // the reason i didn't do this as a tdeconfig_update script is that
    // most people don't use this feature, so no reason to penalize
    // everyone, and moreover the user may added this to their main
    // panel, meaning kickerrc itself would have to be vastly modified
    // with lots of complications. not work it IMHO.

    TDEConfig* config = TDEGlobal::config();
    config->setGroup("General");

    if (config->readBoolEntry("CheckedForMenubar", false))
    {
        return;
    }

    if (!locate("config", "kicker_menubarpanelrc").isEmpty())
    {
        // don't overwrite/override something that's already there
        return;
    }

    TQStringList elist = config->readListEntry("Extensions2");
    TQStringList::iterator itEnd = elist.end();
    for (TQStringList::iterator it = elist.begin(); it !=  elist.end(); ++it)
    {
        TQString extensionId(*it);

        if (extensionId.find("Extension") == -1)
        {
            continue;
        }

        // is there a config group for this extension?
        if (!config->hasGroup(extensionId))
        {
            continue;
        }

        config->setGroup(extensionId);
        TQString extension = config->readPathEntry("ConfigFile");
        TDEConfig extensionConfig(locate("config", extension));
        extensionConfig.setGroup("General");

        if (extensionConfig.hasKey("Applets2"))
        {
            TQStringList containers = extensionConfig.readListEntry("Applets2");
            TQStringList::iterator cit = containers.begin();
            TQStringList::iterator citEnd = containers.end();
            for (; cit != citEnd; ++cit)
            {
                TQString appletId(*cit);

                // is there a config group for this applet?
                if (!extensionConfig.hasGroup(appletId))
                {
                    continue;
                }

                TDEConfigGroup group(&extensionConfig, appletId.latin1());
                TQString appletType = appletId.left(appletId.findRev('_'));

                if (appletType == "Applet")
                {
                    TQString appletFile = group.readPathEntry("DesktopFile");
                    if (appletFile.find("menuapplet.desktop") != -1)
                    {
                        TQString menubarConfig = locate("config", extension);
                        TDEIO::NetAccess::copy(menubarConfig,
                                             locateLocal("config",
                                             "kicker_menubarpanelrc"), 0);
                        elist.remove(it);
                        config->setGroup("General");
                        config->writeEntry("Extensions2", elist);
                        config->writeEntry("CheckedForMenubar", true);
                        config->sync();
                        return;
                    }
                }
            }
        }
    }

    config->setGroup("General");
    config->writeEntry("CheckedForMenubar", true);
}
Esempio n. 24
0
void Condition::cfg_write( TDEConfig& cfg_P ) const
    {
    cfg_P.writeEntry( "Type", "ERROR" );
    }
Esempio n. 25
0
void Or_condition::cfg_write( TDEConfig& cfg_P ) const
    {
    base::cfg_write( cfg_P );
    cfg_P.writeEntry( "Type", "OR" ); // overwrites value set in base::cfg_write()
    }
Esempio n. 26
0
void KSaveIOConfig::setMaxCacheAge( int cache_age )
{
  TDEConfig* cfg = http_config ();
  cfg->writeEntry( "MaxCacheAge", cache_age );
  cfg->sync();
}
Esempio n. 27
0
void Condition_list::cfg_write( TDEConfig& cfg_P ) const
    {
    base::cfg_write( cfg_P );
    cfg_P.writeEntry( "Comment", comment());
    }
Esempio n. 28
0
void KateConfigDialog::slotApply()
{
  TDEConfig *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();
    mainWindow->useInstance = cb_useInstance->isChecked();
    mainWindow->filelist->setSortType(cb_sortFiles->isChecked() ? KateFileList::sortByName : KateFileList::sortByID);

    config->writeEntry( "Number of recent files", sb_numRecentFiles->value() );
    mainWindow->fileOpenRecent->setMaxItems( sb_numRecentFiles->value() );

    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 );
}