changeset 1277:7293bc5ee7f8 piper

Error reporting for Piper server startup
author Chris Cannam
date Fri, 21 Oct 2016 16:24:30 +0100
parents 0c6cdcf53641
children e9197aa8ea24
files .hgsubstate main/MainWindow.cpp main/main.cpp
diffstat 3 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Fri Oct 21 14:51:22 2016 +0100
+++ b/.hgsubstate	Fri Oct 21 16:24:30 2016 +0100
@@ -8,6 +8,6 @@
 98be18165618992ccedc845ab021182dfd165aa7 piper-cpp
 d93140aac40bbc35361c32ddc9cae42038e9c05f sv-dependency-builds
 7a3fa603190e50a8da656cfa1aeb109375085548 svapp
-91ff08313375a61386bd9d6ec81fd509b49396a9 svcore
+5d886b7b4029f82087d8d83fef22229295a193af svcore
 07e8ac88bccefdf1a6d55e9c6ebb3fb8efb318ce svgui
 af4a1522ef1585686d3d2d9bc9433588f88f4ccc vamp-plugin-sdk
--- a/main/MainWindow.cpp	Fri Oct 21 14:51:22 2016 +0100
+++ b/main/MainWindow.cpp	Fri Oct 21 16:24:30 2016 +0100
@@ -1496,6 +1496,11 @@
     TransformFactory *factory = TransformFactory::getInstance();
 
     TransformList transforms = factory->getAllTransformDescriptions();
+
+    if (factory->getStartupFailureReport() != "") {
+        pluginPopulationWarning();
+    }
+    
     vector<TransformDescription::Type> types = factory->getAllTransformTypes();
 
     map<TransformDescription::Type, map<QString, SubdividingMenu *> > categoryMenus;
@@ -4156,8 +4161,21 @@
 void
 MainWindow::pluginPopulationWarning()
 {
-    QString warning = PluginScan::getInstance()->getStartupFailureReport();
-    QMessageBox::warning(this, tr("Problems loading plugins"), warning);
+    QString scanWarning = PluginScan::getInstance()->getStartupFailureReport();
+    QString factWarning = TransformFactory::getInstance()->getStartupFailureReport();
+    QString warning;
+    if (factWarning != "") {
+        // The order of events on startup implies that, if scanWarning
+        // and factWarning are both present, then we have already been
+        // called once for scanWarning so don't want to report it again
+        warning = factWarning;
+    } else if (scanWarning != "") {
+        warning = scanWarning;
+    }
+    if (warning != "") {
+        emit hideSplash();
+        QMessageBox::warning(this, tr("Problems loading plugins"), warning);
+    }
 }
 
 void
--- a/main/main.cpp	Fri Oct 21 14:51:22 2016 +0100
+++ b/main/main.cpp	Fri Oct 21 16:24:30 2016 +0100
@@ -356,11 +356,11 @@
              << ", trying in my own directory" << endl;
         helperPath = myDir + "/plugin-checker-helper";
     }
-    helperPath += helperSuffix;
     if (!QFile(helperPath + helperSuffix).exists()) {
         cerr << "NOTE: helper not found at " << (helperPath + helperSuffix)
              << endl;
     }
+    helperPath += helperSuffix;
     PluginScan::getInstance()->scan(helperPath);
     
     // Permit size_t and PropertyName to be used as args in queued signal calls