changeset 1639:3dbfe3ba0d1f

More debug output during startup
author Chris Cannam
date Sun, 05 Mar 2017 17:14:17 +0000
parents c3380c78811f
children e01802a474ce
files main/MainWindow.cpp main/NetworkPermissionTester.cpp
diffstat 2 files changed, 26 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Wed Mar 01 14:57:18 2017 +0000
+++ b/main/MainWindow.cpp	Sun Mar 05 17:14:17 2017 +0000
@@ -199,6 +199,8 @@
     cdb->setUseDarkBackground(cdb->addColour(QColor(225, 74, 255), tr("Bright Purple")), true);
     cdb->setUseDarkBackground(cdb->addColour(QColor(255, 188, 80), tr("Bright Orange")), true);
 
+    SVDEBUG << "MainWindow: Creating main user interface layout" << endl;
+
     QFrame *frame = new QFrame;
     setCentralWidget(frame);
 
@@ -282,6 +284,8 @@
 
     frame->setLayout(layout);
 
+    SVDEBUG << "MainWindow: Creating menus and toolbars" << endl;
+
 #ifdef Q_OS_MAC
     // Mac doesn't align menu labels when icons are shown: result is messy
     QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
@@ -313,21 +317,32 @@
     m_unitConverter->hide();
 
     setAudioRecordMode(RecordCreateAdditionalModel);
-    
+
+    SVDEBUG << "MainWindow: Creating new session" << endl;
+
     newSession();
 
     connect(m_midiInput, SIGNAL(eventsAvailable()),
             this, SLOT(midiEventsAvailable()));
 
+    SVDEBUG << "MainWindow: Creating network permission tester" << endl;
+
     NetworkPermissionTester tester(withOSCSupport);
     bool networkPermission = tester.havePermission();
     if (networkPermission) {
         if (withOSCSupport) {
+            SVDEBUG << "MainWindow: Creating OSC queue" << endl;
             startOSCQueue();
         }
+
+        SVDEBUG << "MainWindow: Starting transform population thread" << endl;
         TransformFactory::getInstance()->startPopulationThread();
+
+        SVDEBUG << "MainWindow: Creating surveyer" << endl;
         m_surveyer = new Surveyer
             ("sonicvisualiser.org", "survey23-present.txt", "survey23.php");
+
+        SVDEBUG << "MainWindow: Creating version tester" << endl;
         m_versionTester = new VersionTester
             ("sonicvisualiser.org", "latest-version.txt", SV_VERSION);
         connect(m_versionTester, SIGNAL(newerVersionAvailable(QString)),
@@ -345,6 +360,8 @@
     if (warning != "") {
         QTimer::singleShot(500, this, SLOT(pluginPopulationWarning()));
     }
+
+    SVDEBUG << "MainWindow: Constructor done" << endl;
 }
 
 MainWindow::~MainWindow()
--- a/main/NetworkPermissionTester.cpp	Wed Mar 01 14:57:18 2017 +0000
+++ b/main/NetworkPermissionTester.cpp	Sun Mar 05 17:14:17 2017 +0000
@@ -16,6 +16,8 @@
 
 #include "../version.h"
 
+#include "base/Debug.h"
+
 #include <QWidget>
 #include <QString>
 #include <QSettings>
@@ -37,10 +39,12 @@
     bool permish = false;
 
     if (settings.contains(tag)) {
-	permish = settings.value(tag, false).toBool();
+        permish = settings.value(tag, false).toBool();
+        SVDEBUG << "NetworkPermissionTester: Asked already, result was " << permish << endl;
     } else {
+        SVDEBUG << "NetworkPermissionTester: Asking for permission" << endl;
 
-	QDialog d;
+    QDialog d;
 	d.setWindowTitle(QCoreApplication::translate("NetworkPermissionTester", "Welcome to Sonic Visualiser"));
 
 	QGridLayout *layout = new QGridLayout;
@@ -97,6 +101,8 @@
 
         permish = cb->isChecked();
 	settings.setValue(tag, permish);
+
+        SVDEBUG << "NetworkPermissionTester: asked, answer was " << permish << endl;
     }
 
     settings.endGroup();