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

void KarchiveurApp::slotFileSaveAs (  )  [slot]

Convert archive type

Definition at line 433 of file karchiveur.cpp.

References CFileInfo::baseName(), CArchiveOperation::convertCurrentArchive(), CFileDialog::fixFileExtension(), CArchiveChoice::getArchiveName(), CExtraction::getLastExtractPath(), CLed::setColor(), slotMessageArchiveOperation(), and slotStatusMsg().

Referenced by initActions().

{
      led->setColor(QColor("red"));
      slotStatusMsg(i18n("Convert archive format..."));

  if( operation != NOARCHIVE )
  {
    QString newarchivename;
    CFileInfo  fileinfo;
    fileinfo.setFile(archivechoice->getArchiveName());
    
    CFileDialog newarchivenamedlg(CExtraction::getLastExtractPath(),NULL,0,"convert_dialog",false,new QLabel(i18n("Choose the destination format of the archive."),0));
    newarchivenamedlg.setSelection(fileinfo.baseName()+preferedArchiveType);
    newarchivenamedlg.setCaption(i18n("Convert an archive"));
    
    if(newarchivenamedlg.exec())
    {
      newarchivename=newarchivenamedlg.selectedFile();
      newarchivenamedlg.fixFileExtension(newarchivename);
    }
    
    if(newarchivename.isEmpty())
    {
      operation=STANDBY;
      led->setColor(QColor("orange"));
      return;
    }
    
    archiveoperation=new CArchiveOperationConversion(tmpdir, archiveobj, progress);
    connect(archiveoperation, SIGNAL(operationEnded(int, QString)), this, SLOT(slotMessageArchiveOperation(int , QString )));
    archiveoperation->convertCurrentArchive(newarchivename);
  }
  else
  {
    led->setColor(QColor("orange"));
    slotStatusMsg(i18n("First open an archive!"));
    return;
  }

  slotStatusMsg(IDS_STATUS_DEFAULT);
}


Generated by  Doxygen 1.6.0   Back to index