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

void KarchiveurApp::checkFirstInstall (  )  [protected]

Check wether karchiver is lauched for the first time. If so, launch a wizard to configure the main features

Check wether karchiver is lauched for the first time. If so, launch a wizard to configure the main features

Definition at line 1711 of file karchiveur.cpp.

References config, and readOptions().

Referenced by configurationWizardAndTip().

                                     {
  int rep=1;
  QString arkpath, arkpath2, arkpath3;
  CFirstInstallWizard firstinstallwizard(this, "1st_install", true);

  config->setGroup("First Time Install");
  if( config->readBoolEntry("first run", true) )
      if( firstinstallwizard.exec() )
  {
        config->setGroup("First Time Install");
        config->writeEntry("first run", false);

            config->setGroup("OPTIONS");
            if(firstinstallwizard.rb_wind_like->isChecked())
                  config->writeEntry("SelectionMode",1);
            else
                  config->writeEntry("SelectionMode",0);

            config->setGroup("LASTDIRS");
            if(firstinstallwizard.rb_extract_lastdir->isChecked())
                  rep=0;
            else if(firstinstallwizard.rb_extract_homedir->isChecked())
                  rep=1;
            else if(firstinstallwizard.rb_extract_shelldir->isChecked())
                  rep=2;
            config->writeEntry("OptionExtraction",rep);

            if(firstinstallwizard.rb_open_lastdir->isChecked())
                  rep=0;
            else if(firstinstallwizard.rb_open_homedir->isChecked())
                  rep=1;
            else if(firstinstallwizard.rb_open_shelldir->isChecked())
                  rep=2;
            config->writeEntry("OptionOuverture",1);

            if(firstinstallwizard.cb_use_karchiver->isChecked())
            {
                  arkpath=KGlobal::dirs()->findResource("data", "konqueror/servicemenus/arkservicemenu.desktop");
                  arkpath3=KGlobal::dirs()->findResourceDir("data", "konqueror/servicemenus/arkservicemenu.desktop");
                  arkpath2=KGlobal::dirs()->findResource("services", "ark_part.desktop");
                  kdDebug()<<QString("Will gzip %1\n").arg(arkpath2);
                  KShellProcess proc;

      proc.clearArguments();
      proc << "kdesu";
      proc << "-c";
      proc << "'";
      if(!arkpath.isEmpty()) //for backward compatibility
      {
        proc << "mkdir";
        proc << arkpath3+"konqueror/servicemenus/ark";
        proc << ";";
        proc << "mv";
        proc << arkpath;
        proc << arkpath3+"konqueror/servicemenus/ark";
        proc << ";";
      }
      proc << "gzip" << arkpath2;
      proc << "'";
      proc.start(KProcess::Block);

      KMessageBox::information(this, i18n("Has gzipped ark files:\n")+arkpath+"\n"+arkpath2, i18n("KArchiver setup"));
            }
      config->sync();
      readOptions();
      }
}


Generated by  Doxygen 1.6.0   Back to index