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

KarchiveurApp::KarchiveurApp (  ) 

construtor of KarchiveurApp, calls all init functions to create the application.

See also:
initMenuBar initToolBar

Definition at line 59 of file karchiveur.cpp.

References cbdirectories, config, enableMenus(), CSearch::foundarchives, initActions(), initStatusBar(), initView(), CArchiveBrowser::QListBox_1, readOptions(), recueSdtOut(), CArchive::setIconSize(), CArchive::setOverwriteFilesWhenExtracting(), CArchive::setReadArchiveWithStream(), CArchive::setWidgetComboDirectories(), CArchive::setWidgetListView(), CArchive::setWidgetProgressBar(), slotCloseFind(), slotComboDirectoriesActivated(), slotDoDragAndDrop(), slotFindInThisArchive(), slotMouseClick(), slotOpenFileFromArchiveBrowser(), slotOpenFileFromArchiveFinder(), slotShowContextualMenu(), slotViewButineur(), and view.

Referenced by slotFileNewWindow(), and slotMessageArchiveOperation().

{
  selectedfilesStatusbarMessage.nbselectedfiles=0;
  selectedfilesStatusbarMessage.sizeselectedfiles=0;
  listUndo.clear();
  listRedo.clear();

  archiveobj=NULL;
  archiveoperation=NULL;
  controlkeypressed=false;
    
      config=kapp->config();

      ///////////////////////////////////////////////////////////////////
      // call inits to invoke all other construction parts
        initView();
      initStatusBar();
      initActions();

  //Set toolbar directory browser
        cbdirectories=new KComboBox(toolBar("mainToolBar"), "toolbar_combo");
        connect(cbdirectories, SIGNAL(activated(int)), this, SLOT(slotComboDirectoriesActivated(int)));

        enableMenus(false);
      operation=NOARCHIVE; //No file loaded, nothing to do !

      archivechoice = new CArchiveChoice(this, "Identify_and_Open_Archive_Class");
      archivechoice->hide();

      //Launch the archive browser
      navigateur = new CArchiveBrowser(this,"File_Browser_Dialog");
      connect( navigateur, SIGNAL(windowwillbeclosed()), this, SLOT(slotHideButineur()));
      connect(navigateur->QListBox_1, SIGNAL(selected(const QString&)), this, SLOT(slotOpenFileFromArchiveBrowser(const QString&)));

      // reads in all config-options
      readOptions();

      //Initialise for drops
      //The main drop zone is in KarchiveurView (via QListView* liste)
      setAcceptDrops(true);
    connect(view,SIGNAL(doDragAndDrop()), this, SLOT(slotDoDragAndDrop()));
      connect(view,SIGNAL(rightButtonPressed ( QListViewItem *, const QPoint &, int )), this, SLOT(slotShowContextualMenu ( QListViewItem *, const QPoint &, int )));
      connect(view,SIGNAL(clicked ( QListViewItem * )), this, SLOT(slotMouseClick ( QListViewItem * )));

      //Initialise the process object:
      process=new CProcessus();
      process->clearArguments();
      connect(process,SIGNAL(receivedStdout(KProcess*, char*, int)),this,SLOT(recueSdtOut(KProcess*,char*,int)));

      //Initialise the find in this archive tool
      find = new CFind(this,"Search_in_this_Archive_Class");
      connect( find, SIGNAL(findNext(QString)), this, SLOT(slotFindInThisArchive(QString)));
      connect( find, SIGNAL(findClose()), this, SLOT(slotCloseFind()));

      //Initialise the find archives on disk tool
      searchBox=new CSearch(0,"Search_for_Archives_Dialog");
      connect(searchBox->foundarchives, SIGNAL(selected(const QString&)), this, SLOT(slotOpenFileFromArchiveFinder(const QString&)));

   QString directory;
   QString error;
   directory.sprintf("karchivertmp.%d/", getpid());
   error=strerror(errno);
   tmpdir = locateLocal( "tmp", directory );
  
    if (tmpdir.isNull())
      kdWarning() << i18n("Failed to create temporary "
              "attachment directory %2: %1")
              .arg(error)
              .arg(directory) << endl;
  
  
    directory.sprintf("karchivertmp.%d/extract/", getpid());
    tmpdir = locateLocal( "tmp", directory );
  
    if (tmpdir.isNull())
      kdWarning() <<i18n("Failed to create temporary "
              "attachment directory %2: %1")
              .arg(error)
              .arg(directory) << endl;
  
    directory.sprintf("karchivertmp.%d/undo/", getpid());
    tmpdirundo = locateLocal( "tmp", directory );
  
    if (tmpdirundo.isNull())
      kdWarning() <<i18n("Failed to create temporary "
              "attachment directory %2: %1")
              .arg(error)
              .arg(directory) << endl;
  
  slotViewButineur();
  
  CArchive::setWidgetListView ( view );
  CArchive::setWidgetComboDirectories(cbdirectories);
  CArchive::setWidgetProgressBar(progress);
  CArchive::setOverwriteFilesWhenExtracting(overwrite);
  CArchive::setIconSize(16);
  CArchive::setReadArchiveWithStream(readarchivewithstream);
  animation=new CAnimation();
  animation->hide();
}


Generated by  Doxygen 1.6.0   Back to index