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

void RosegardenGUIApp::slotExportProject (  )  [slot]

Let the user export a Rosegarden Project file

Definition at line 4587 of file rosegardengui.cpp.

References getValidWriteFile(), m_doc, and RosegardenGUIDoc::saveDocument().

Referenced by setupActions().

{
    KTmpStatusMsg msg(i18n("Exporting Rosegarden Project file..."), this);

    QString fileName = getValidWriteFile
        ("*.rgp|" + i18n("Rosegarden Project files\n") +
         "\n*|" + i18n("All files"),
         i18n("Export as..."));

    if (fileName.isEmpty()) return;

    QString rgFile = fileName;
    rgFile.replace(QRegExp(".rg.rgp$"), ".rg");
    rgFile.replace(QRegExp(".rgp$"), ".rg"); 

    CurrentProgressDialog::freeze();
      
    QString errMsg;
    if (!m_doc->saveDocument(rgFile, errMsg,
                       true)) { // pretend it's autosave
      KMessageBox::sorry(this, i18n("Saving Rosegarden file to package failed: %1").arg(errMsg));
      CurrentProgressDialog::thaw();
      return;
    }

    KProcess *proc = new KProcess;
    *proc << "rosegarden-project-package";
    *proc << "--pack";
    *proc << rgFile;
    *proc << fileName;

    proc->start(KProcess::Block, KProcess::All);

    if (!proc->normalExit() || proc->exitStatus()) {
      KMessageBox::sorry(this, i18n("Failed to export to project file \"%1\"").arg(fileName));
      CurrentProgressDialog::thaw();
      delete proc;
      return;
    }

    delete proc;
}


Generated by  Doxygen 1.6.0   Back to index