Fix initialization of QtAssistant
authorDiane Trout <diane@caltech.edu>
Thu, 12 Oct 2006 21:57:20 +0000 (21:57 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 12 Oct 2006 21:57:20 +0000 (21:57 +0000)
ticket:120
I reenabled calling QtAssistant for help on windows to get around the lack
of a python standard library. However, I forgot to update the define
for initializing the QtAssistant. Needless to say an unininitialized
QtAssistantClient pointer wasn't terribly useful.

qui/MussaWindow.cpp

index 4e281fcb6ff7fcc2cc331e80202edde61d0755f4..c34c003c2ae27b01b82cafb006c2fdd35f3fb148 100644 (file)
@@ -270,7 +270,7 @@ void MussaWindow::setupMainMenu()
 
 void MussaWindow::setupAssistant()
 {
-#if defined(QT_ASSISTANT_FOUND)
+#if defined(QT_QTASSISTANT_FOUND)
   QStringList manualAssistantArgs;
   manualAssistantArgs = QStringList();
   manualAssistantArgs << "-profile" << "./doc/manual/mussagl_manual.adp";
@@ -598,22 +598,28 @@ void MussaWindow::showManual()
 #if defined(QT_QTASSISTANT_FOUND)
   if (manualAssistant) { 
     manualAssistant->openAssistant();
+  } else {
+    QMessageBox::warning(this,
+                         tr("Mussa Help Error"),
+                         tr("QtAssistant not setup correctly"),
+                         QMessageBox::Ok,
+                         QMessageBox::NoButton,
+                         QMessageBox::NoButton);
   }
 #else
   try {
     boost::python::object webopen = get_py()["webbrowser.open"];
     webopen("http://woldlab.caltech.edu/~king/mussagl_manual/");
-    return;
   } catch( boost::python::error_already_set ) {
     PyErr_Print();
+    QMessageBox::warning(this,
+                         tr("Mussa Help Error"),
+                         tr("Unable to launch webbrowser"),
+                         QMessageBox::Ok,
+                         QMessageBox::NoButton,
+                         QMessageBox::NoButton);
   }
 #endif //QT_QTASSISTANT_FOUND
-  QMessageBox::warning(this,
-                       tr("Unhelpful Help"),
-                       tr("Error loading help"),
-                       QMessageBox::Ok,
-                       QMessageBox::NoButton,
-                       QMessageBox::NoButton);
 }
 
 void MussaWindow::assistantError(QString message)