From: Diane Trout Date: Thu, 12 Oct 2006 21:57:20 +0000 (+0000) Subject: Fix initialization of QtAssistant X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=e062d282812ce40cbc1287ba8ea61d7abf1d76e0 Fix initialization of QtAssistant 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. --- diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index 4e281fc..c34c003 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -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)