aboutsummaryrefslogtreecommitdiff
path: root/mainwindow.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2021-09-19 20:55:17 +0200
committerJavier <dev.git@javispedro.com>2021-09-19 20:55:17 +0200
commitfd2a247a065548422b828d3055729e435a918f42 (patch)
treea8564151389b7c968b0b1ae133e1f7494a6a3623 /mainwindow.cc
parent419cd14ea25bc1585552bf73f0f29aa62518c175 (diff)
downloadscribiu-fd2a247a065548422b828d3055729e435a918f42.tar.gz
scribiu-fd2a247a065548422b828d3055729e435a918f42.zip
add InkML export support, fix bug with page layout in notebookview
Diffstat (limited to 'mainwindow.cc')
-rw-r--r--mainwindow.cc19
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");
}