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

void Rosegarden::RosegardenGUIApp::slotExportProject (  )  [slot]

Let the user export a Rosegarden Project file

Definition at line 4857 of file RosegardenGUIApp.cpp.

References getValidWriteFile(), m_doc, and Rosegarden::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");


    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));
        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));
        delete proc;
        return ;

    delete proc;

Generated by  Doxygen 1.6.0   Back to index