Mercurial > hg > sonic-visualiser
changeset 1462:f5180edc5dda 3.0-integration
Merge
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Tue, 03 Jan 2017 14:34:46 +0000 |
parents | 0a145f215a45 (current diff) 8ca62b402846 (diff) |
children | f5c828d1f3e2 |
files | main/MainWindow.cpp |
diffstat | 3 files changed, 21 insertions(+), 49 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate Tue Jan 03 14:32:53 2017 +0000 +++ b/.hgsubstate Tue Jan 03 14:34:46 2017 +0000 @@ -6,7 +6,7 @@ 3768bdde6fdf866aa63fff5bde8d9fa64a8979ef dataquay 7d46098431f39c265e47254e420576559587b3fe icons/scalable 3257ddb6fff110cc88f3ffeaeefa0f29d5eb3b6f piper-cpp -5f67a29f0fc7f1b908f7cde4866173a7af337862 sv-dependency-builds +284acf908dcd9f5bdaf805a7f5aeaac1764b4604 sv-dependency-builds 022d6a9e6d75f77a693d31765faead2e578cf014 svapp 47768571681e9ef5a14dbfd066b7a1510580c53e svcore 67f437277069ed83664691fc179421fdbfe9ad70 svgui
--- a/main/MainWindow.cpp Tue Jan 03 14:32:53 2017 +0000 +++ b/main/MainWindow.cpp Tue Jan 03 14:34:46 2017 +0000 @@ -2867,14 +2867,9 @@ Pane *pane = m_paneStack->getCurrentPane(); if (!pane) return; -//!!! QString path = getSaveFileName(FileFinder::ImageFile); -// if (path == "") return; -// if (QFileInfo(path).suffix() == "") path += ".png"; QString path = getSaveFileName(FileFinder::ImageFile); if (path == "") return; - if (QFileInfo(path).suffix() == "") path += ".svg"; - - bool scalable = true; //!!! + if (QFileInfo(path).suffix() == "") path += ".png"; bool haveSelection = m_viewManager && !m_viewManager->getSelections().empty(); @@ -2910,7 +2905,7 @@ settings.beginGroup("MainWindow"); int deflt = settings.value("lastimageexportregion", 0).toInt(); if (deflt == 2 && !haveSelection) deflt = 1; - if (deflt == 0 && !scalable && total.width() > 32767) deflt = 1; + if (deflt == 0 && total.width() > 32767) deflt = 1; ListInputDialog *lid = new ListInputDialog (this, tr("Select region to export"), @@ -2920,7 +2915,7 @@ if (!haveSelection) { lid->setItemAvailability(2, false); } - if (!scalable && total.width() > 32767) { // appears to be limit of a QImage + if (total.width() > 32767) { // appears to be limit of a QImage lid->setItemAvailability(0, false); lid->setFootnote(tr("Note: the whole pane is too wide to be exported as a single image.")); } @@ -2933,47 +2928,25 @@ settings.setValue("lastimageexportregion", deflt); - if (scalable) { - - bool result = false; - - if (item == items[0]) { - result = pane->renderToSvgFile(path ); - } else if (item == items[1]) { - result = pane->renderPartToSvgFile(path, - pane->getFirstVisibleFrame(), - pane->getLastVisibleFrame()); - } else if (haveSelection) { - result = pane->renderPartToSvgFile(path, sf0, sf1); - } - - if (!result) { - QMessageBox::critical(this, tr("Failed to save SVG file"), - tr("Failed to save SVG file %1").arg(path)); - } - - } else { - - QImage *image = 0; - - if (item == items[0]) { - image = pane->renderToNewImage(); - } else if (item == items[1]) { - image = pane->renderPartToNewImage(pane->getFirstVisibleFrame(), - pane->getLastVisibleFrame()); - } else if (haveSelection) { - image = pane->renderPartToNewImage(sf0, sf1); - } - - if (!image) return; - - if (!image->save(path, "PNG")) { - QMessageBox::critical(this, tr("Failed to save image file"), - tr("Failed to save image file %1").arg(path)); - } + QImage *image = 0; - delete image; + if (item == items[0]) { + image = pane->renderToNewImage(); + } else if (item == items[1]) { + image = pane->renderPartToNewImage(pane->getFirstVisibleFrame(), + pane->getLastVisibleFrame()); + } else if (haveSelection) { + image = pane->renderPartToNewImage(sf0, sf1); } + + if (!image) return; + + if (!image->save(path, "PNG")) { + QMessageBox::critical(this, tr("Failed to save image file"), + tr("Failed to save image file %1").arg(path)); + } + + delete image; } void
--- a/main/main.cpp Tue Jan 03 14:32:53 2017 +0000 +++ b/main/main.cpp Tue Jan 03 14:34:46 2017 +0000 @@ -279,7 +279,6 @@ settings.beginGroup("Preferences"); // Default to using Piper server; can change in preferences if (!settings.contains("run-vamp-plugins-in-process")) { - cerr << "setting does not exist yet" << endl; settings.setValue("run-vamp-plugins-in-process", false); } settings.endGroup();