Logo Search packages:      
Sourcecode: karchiver version File versions  Download package

void KarchiveurApp::readOptions (  )  [protected]

read general Options again and initialize all variables like the recent file list

Definition at line 233 of file karchiveur.cpp.

References config, CArchiveChoice::getAccessPath(), KarchiveurView::setAlternateBackground(), CArchive::setCompressRate(), CExtraction::setDefaultOptions(), CArchive::setDisplayIcons(), CArchiveChoice::setForInitPreviousPath(), CArchiveChoice::setFullPath(), CArchive::setKindOfDate(), CArchiveBrowser::setPath(), CArchive::setRecursiveMode(), slotViewButineur(), slotViewStatusBar(), slotViewToolBar(), and view.

Referenced by checkFirstInstall(), and KarchiveurApp().

{
  config->setGroup("General Options");

  // bar status settings
  bool bViewToolbar = config->readBoolEntry("Show Toolbar", true);
  viewToolbar->setChecked(bViewToolbar);
  slotViewToolBar();

  bool bViewStatusbar = config->readBoolEntry("Show Statusbar", true);
  viewStatusbar->setChecked(bViewStatusbar);
  slotViewStatusBar();

  bool bViewNavigateur = config->readBoolEntry("Show Navigateur", true);
      viewArchiveBrowser->setChecked(bViewNavigateur);
      slotViewButineur();

  // bar position settings
  KToolBar::BarPosition toolBarPos;
  toolBarPos=(KToolBar::BarPosition) config->readNumEntry("ToolBarPos", KToolBar::Top);
  toolBar("mainToolBar")->setBarPos(toolBarPos);

  // initialize the recent file list
  fileOpenRecent->loadEntries(config,"Recent Files");

  QSize size=config->readSizeEntry("Geometry", new QSize(640,480));
  if( !size.isEmpty() )
  {
          resize(size);
  }

  config->setGroup("OPTIONS");
  includewholepath = config->readBoolEntry("ToutChemin",false);
  recursive = config->readBoolEntry("Recursif",true);//when creating an archive, aslo compress subfolders
  overwrite = config->readBoolEntry("OverwriteWhenExtracting",false);
  cheminabsolu = config->readBoolEntry("CheminAbsolu",false);
  view->setAlternateBackground( config->readBoolEntry("AlternateBackground",true) );
  viewbydirectories=config->readBoolEntry("ReadByDirs",true);
  preferedArchiveType=config->readEntry("PreferedArchiveType",".tar.gz");
  defaultdropbehaviour=config->readBoolEntry("DefaultDropBehaviour",false);

      switch(config->readNumEntry("LectureParFlot",1))
      {
            case 0:
                  readarchivewithstream=false;//Many problems with stream reading, not needed anymore
                  CArchive::setDisplayIcons(true);
                  break;
            case 1:
                  readarchivewithstream=false;
                  CArchive::setDisplayIcons(true);
                  break;
            case 2:
                  //Don't display icons for archive dontent display.
                  readarchivewithstream = false;
                  CArchive::setDisplayIcons(false);
                  break;
      }

      if ( config->readNumEntry("SelectionMode",0) == 0 )
      {
            view->setSelectionMode(QListView::Multi);
      }
      else
      {
            view->setSelectionMode(QListView::Extended);
      }

      // For the compress rate, in the config file 1 = min compress
      compresslevel=config->readNumEntry("TauxCompression",9);
      CArchive::setCompressRate(compresslevel);

      config->setGroup("LASTDIRS");
      QString cheminExtraction=config->readPathEntry("Extraction",QDir::homeDirPath());
      QString cheminOuverture=config->readPathEntry("Ouverture",QDir::homeDirPath());

      int optionExtract=config->readNumEntry("OptionExtraction",1);//Default extraction: in home dir
      optionOpening=config->readNumEntry("OptionOuverture",1);//Default opening: in home dir
      archivechoice->setFullPath(cheminOuverture,optionOpening);
      archivechoice->setForInitPreviousPath(cheminOuverture);
      navigateur->setPath(archivechoice->getAccessPath());
      CExtraction::setDefaultOptions(cheminExtraction, optionExtract);
      
        config->setGroup("DATE");
      CArchive::setKindOfDate(config->readNumEntry("KindOfDate",0));

      config->setGroup("TipOfTheDay");
      displaytipofday=config->readBoolEntry("show_tod", true);

      CArchive::setRecursiveMode(recursive);
 
}


Generated by  Doxygen 1.6.0   Back to index