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

void KarchiveurApp::slotMessageArchiveOperation ( int  message,
QString  messagetext 
) [protected, slot]

Messages from CArchiveOperation and childs

Definition at line 1928 of file karchiveur.cpp.

References displayArchiveContent(), displayMessageArchiveSize(), enableMenus(), CArchive::getArchiveName(), CArchiveOperation::getArchiveName(), CArchiveChoice::getArchiveName(), CArchiveOperation::getArchiveObject(), CArchive::isSourceSoftware(), KarchiveurApp(), openFileFromCommandLine(), CArchiveChoice::setArchiveName(), CLed::setColor(), CArchiveBrowser::setPath(), slotAskForCompilation(), slotEndProcess(), slotFileQuit(), slotStatusMsg(), and CArchive::supportPassword().

Referenced by addToArchive(), createArchiveFromCommandLine(), displayArchiveContent(), extractFromCommandLine(), openFilesDropPaste(), slotAddFiles(), slotDiskCutUncut(), slotDisplayFile(), slotDisplaySelectedFiles(), slotExtractArchive(), slotFileSaveAs(), slotMakeSfxArchive(), slotMouseClick(), slotScanArchive(), slotTestArchive(), and slotWizard().

{
  kdDebug()<<QString("KarchiveurApp::slotMessageArchiveOperation %1 %2").arg(message).arg(messagetext)<<endl;
  slotStatusMsg(messagetext);
  
  switch(message)
  {
    case CONVERSION_ACHIEVED:
    {
      slotStatusMsg(messagetext);
      led->setColor(QColor("green"));
      QString s=i18n("Delete : %1?").arg(archivechoice->getArchiveName());
      if(KMessageBox::questionYesNo(this, s, "karchiver")==1)
      {
        process->clearArguments();
        *process << "rm" << "-f" <<archivechoice->getArchiveName();
        process->start(KProcess::Block);
      }
      led->setColor(QColor("green"));
      
      archivechoice->setArchiveName(archiveoperation->getArchiveName());
      
      //displayArchiveContent();
      break;
    }
    case DISPLAY_ACHIEVED:
    {
      archiveobj=archiveoperation->getArchiveObject();//Fetch back the archive object, as a new one has been created in CArchiveOperation...
      archivechoice->setArchiveName(archiveobj->getArchiveName());
      connect(archiveobj, SIGNAL(archiveReadEnded()), this, SLOT(slotEndProcess()));
      connect(archiveobj, SIGNAL(sourceSoftwareSpotted()), this, SLOT(slotAskForCompilation()));
      archiveSetPassword->setEnabled(archiveobj->supportPassword());
      QFileInfo fiarchive(archiveobj->getArchiveName());
      navigateur->setPath(fiarchive.dirPath());
      led->setColor(QColor("green"));
      animation->stopAnimation();
      setCaption(fiarchive.fileName() + " "+i18n("in")+" "+fiarchive.dirPath());
      displayMessageArchiveSize();
      if(archiveobj->isSourceSoftware())
        slotAskForCompilation();
      break;
    }
    case MULTI_EXTRACTION_ACHIEVED:
    {
      slotFileQuit();
      break;
    }
    case SFX_ARCHIVE_CREATED:
    {
      KMessageBox::information(this, messagetext, "Karchiver Sfx");
      led->setColor(QColor("green"));
      break;
    }
    case EXTRACT_ACHIEVED:
    case VIEW_FILES_ACHIEVED:
    case ADD_FILES_ACHIEVED:
    case WIZARD_ACHIEVED:
    case TEST_ACHIEVED:
    {
      led->setColor(QColor("green"));
      break;
    }
    case SCAN_ACHIEVED:
    {
      KMessageBox::information(this, messagetext, i18n("Scan result"));
      led->setColor(QColor("green"));
      break;
    }
    case SPLIT_ACHIEVED:
    {
      KMessageBox::information(this,messagetext,"KArchiver");
      led->setColor(QColor("green"));
      break;
    }
    case UNSPLIT_ACHIEVED:
    {
      archivechoice->setArchiveName(messagetext);
      break;
    }
    case PASTE_FILES_ACHIEVED:
    case ARCHIVE_CREATION_ACHIEVED:
    {
      archiveobj=archiveoperation->getArchiveObject();//Fetch back the archive object, as a new one has been created in CArchiveOperation...
      kdDebug()<<QString("Setting archivename to %1").arg(archiveobj->getArchiveName())<<endl;
      archivechoice->setArchiveName(archiveobj->getArchiveName());
      break;
    }
    case CREATE_ARCHIVE_CMD_LINE_ACHIEVED:
    {
      led->setColor(QColor("green"));
      slotStatusMsg(messagetext);
      kdDebug()<<QString("Will leave the application")<<endl;
      delete archiveoperation;
      archiveoperation=NULL;
      close();
      break;
    }
    case ADD_FILES_ANOTHER_ARCHIVE_ACHIEVED:
    {
      slotStatusMsg(i18n("Opening a new application window..."));
      kdDebug()<<QString("in ADD_FILES_ANOTHER_ARCHIVE_ACHIEVED")<<endl;
      if(archiveobj!=NULL)
      {
        delete archiveobj;
        kdDebug()<<"Object deleted"<<endl;
        archiveobj=NULL;
      }
      kdDebug()<<QString("Archive name=%1").arg(archivechoice->getArchiveName())<<endl;
      /*KarchiveurApp *new_window= new KarchiveurApp();
      new_window->show();
      QStringList archname;
      archname.append(messagetext);
      kdDebug()<<QString("Displaying %1 in a new window and also %2").arg(messagetext).arg(archivechoice->getArchiveName())<<endl;
      new_window->openFileFromCommandLine(archname);*/
      kdDebug()<<QString("Starting karchiver with argument %1").arg(messagetext)<<endl;
      KProcess proc;
      proc << "karchiver" << messagetext;
      proc.start(KProcess::DontCare);
      break;
    }
    case OPEN_ARCHIVE_IN_NEW_WINDOW:
    {
      slotStatusMsg(i18n("Opening a new application window..."));

      KarchiveurApp *new_window= new KarchiveurApp();
      new_window->show();
      QStringList archname;
      archname.append(messagetext);
      kdDebug()<<QString("Displaying %1 in a new window").arg(messagetext)<<endl;
      new_window->openFileFromCommandLine(archname);
      break;
    }
    default:
    case CANNOT_PERFORM_OPERATION:
    {
      led->setColor(QColor("orange"));
      animation->stopAnimation();
      slotStatusMsg(messagetext);
      break;
    }
  }
  operation=STANDBY;
  delete archiveoperation;
  archiveoperation=NULL;
  progress->reset();
  if(archiveobj!=NULL)
    enableMenus(true);
  else
  {
    operation=NOARCHIVE;
    enableMenus(false);
  }
  
  if((message==ARCHIVE_CREATION_ACHIEVED)||(message==ADD_FILES_ACHIEVED)||(message==ADD_FILES_ANOTHER_ARCHIVE_ACHIEVED)||(message==CONVERSION_ACHIEVED)||(message==UNSPLIT_ACHIEVED))
  {
    displayArchiveContent();
  }
}


Generated by  Doxygen 1.6.0   Back to index