diff options
Diffstat (limited to 'mainwindow.cc')
-rw-r--r-- | mainwindow.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mainwindow.cc b/mainwindow.cc index e7a73fa..d8a935c 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -154,6 +154,18 @@ void MainWindow::exportCurrentPageAsTXYP(const QString &file, bool relativeTime) f.close(); } +void MainWindow::exportCurrentPageAsInkML(const QString &file) +{ + QFile f(file); + if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) { + QMessageBox::warning(this, tr("Export page"), + tr("Could not export current page to '%s'").arg(file)); + return; + } + ui->notebookView->exportPageAsInkML(&f, ui->notebookView->curPage()); + f.close(); +} + void MainWindow::exportCurrentPaperReplayAsAac(const QString &file) { QString src = _media->currentSource().fileName(); @@ -349,6 +361,7 @@ void MainWindow::handleExport() filters << tr("Current page as PNG image (*.png)") << tr("Current page as SVG image (*.svg)") << tr("Current page as TXYP (*.txyp)") + << tr("Current page as InkML (*.inkml)") << tr("Current audio as AAC (*.aac)"); int filterIndex = settings.value("filetype").toInt(); QString filter = filters.value(filterIndex); @@ -378,6 +391,12 @@ void MainWindow::handleExport() exportCurrentPageAsTXYP(fileName, settings.value("txyp_relative_t", true).toBool()); break; case 3: + if (!fileName.endsWith(".inkml", Qt::CaseInsensitive)) { + fileName.append(".inkml"); + } + exportCurrentPageAsInkML(fileName); + break; + case 4: if (!fileName.endsWith(".aac", Qt::CaseInsensitive)) { fileName.append(".aac"); } |