changeset 442:12f2c987e2b5

Wait for initial analysis to complete before loading (as well as saving)
author Chris Cannam
date Tue, 31 Mar 2015 15:09:58 +0100
parents 692852208b6c
children ea7ca3335a1a 9b816a3dbacb
files src/MainWindow.cpp
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/MainWindow.cpp	Tue Mar 31 15:09:38 2015 +0100
+++ b/src/MainWindow.cpp	Tue Mar 31 15:09:58 2015 +0100
@@ -1161,10 +1161,10 @@
     int lpwSize, bigLpwSize;
 #ifdef Q_OS_MAC
     lpwSize = m_viewManager->scalePixelSize(32); // Mac toolbars are fatter
-    bigLpwSize = lpwSize * 2.2;
+    bigLpwSize = int(lpwSize * 2.2);
 #else
     lpwSize = m_viewManager->scalePixelSize(26);
-    bigLpwSize = lpwSize * 2.8;
+    bigLpwSize = int(lpwSize * 2.8);
 #endif
     
     m_audioLPW->setImageSize(lpwSize);
@@ -1951,7 +1951,7 @@
 
     QMessageBox mb(QMessageBox::Information,
                    tr("Waiting for analysis"),
-                   tr("Waiting for initial analysis to complete before saving..."),
+                   tr("Waiting for initial analysis to finish before loading or saving..."),
                    QMessageBox::Cancel,
                    this);
 
@@ -2130,6 +2130,8 @@
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
 
+    if (!waitForInitialAnalysis()) return FileOpenCancelled;
+    
     QString path = source.getLocalFilename();
 
     RDFImporter::RDFDocumentType rdfType = 
@@ -2214,6 +2216,8 @@
 
     if (path == "") return;
 
+    if (!waitForInitialAnalysis()) return;
+    
     if (QFileInfo(path).suffix() == "") path += ".svl";
 
     QString suffix = QFileInfo(path).suffix().toLower();