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

bool RosegardenGUIApp::exportLilypondFile ( QString  url,
bool  forPreview = false 
)

export a Lilypond file

Definition at line 4779 of file rosegardengui.cpp.

References m_doc, and LilypondExporter::write().

Referenced by slotExportLilypond(), and slotPreviewLilypond().

{
    QString caption = "", heading = "";
    if (forPreview) {
      caption = i18n("Lilypond Preview Options");
      heading = i18n("Lilypond preview options");
    }

    LilypondOptionsDialog dialog(this, caption, heading);
    if (dialog.exec() != QDialog::Accepted) {
      return false;
    }

    RosegardenProgressDialog progressDlg(i18n("Exporting Lilypond file..."),
                                         100,
                                         this);
    
    LilypondExporter e(this, m_doc, std::string(QFile::encodeName(file)));

    connect(&e, SIGNAL(setProgress(int)),
            progressDlg.progressBar(), SLOT(setValue(int)));

    connect(&e, SIGNAL(incrementProgress(int)),
            progressDlg.progressBar(), SLOT(advance(int)));

    if (!e.write()) {
      CurrentProgressDialog::freeze();
        KMessageBox::sorry(this, i18n("Export failed.  The file could not be opened for writing."));
      return false;
    }

    return true;
}


Generated by  Doxygen 1.6.0   Back to index