From: Diane Trout Date: Thu, 24 Aug 2006 00:42:02 +0000 (+0000) Subject: start trying to figure out where the documentation is X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=f711cad7f887f2e517afdc744be1d8cb8d12c183 start trying to figure out where the documentation is on os x determine the bundle path as a first step to finding where we might have stored qtassistent and the documentation tree. currently being ignored as i can more easly just launch a webbrowser to our website. --- diff --git a/alg/parse_options.hpp b/alg/parse_options.hpp index bd08ef5..52445d0 100644 --- a/alg/parse_options.hpp +++ b/alg/parse_options.hpp @@ -1,6 +1,8 @@ #ifndef _PARSE_OPTIONS_H_ #define _PARSE_OPTIONS_H_ +#include + class Mussa; //! collect information about runtime options @@ -11,6 +13,8 @@ struct MussaOptions //! pointer to our analysis, if its null, feel free to die Mussa *analysis; + //! Location of documentation + std::string doc_dir; //! should we use the gui? bool useGUI; //! launch as python diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index 6759567..b0d5dbd 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -239,17 +239,7 @@ void MussaWindow::setupMainMenu() void MussaWindow::setupAssistant() { -#if 0 && defined(Q_WS_MAC) - CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef, - kCFURLPOSIXPathStyle); - const char *pathPtr = CFStringGetCStringPtr(macPath, - CFStringGetSystemEncoding()); - qDebug("Path = %s", pathPtr); - CFRelease(pluginRef); - CFRelease(macPath); -#endif -#if defined(QT_ASSISTANT_LIB) +#if defined(QT_ASSISTANT_FOUND) QStringList manualAssistantArgs; manualAssistantArgs = QStringList(); manualAssistantArgs << "-profile" << "./doc/manual/mussagl_manual.adp"; diff --git a/qui/mussagl.cpp b/qui/mussagl.cpp index da238ee..92522de 100644 --- a/qui/mussagl.cpp +++ b/qui/mussagl.cpp @@ -10,9 +10,26 @@ using namespace boost::filesystem; #include #include -#include "qui/MussaWindow.hpp" -#include "alg/parse_options.hpp" -#include "mussa_exceptions.hpp" +#if defined(Q_WS_MAC) +#include +#endif + +std::string get_doc_dir() +{ +#if defined(Q_WS_MAC) + CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle()); + CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef, + kCFURLPOSIXPathStyle); + const char *pathPtr = CFStringGetCStringPtr(macPath, + CFStringGetSystemEncoding()); + std::string doc_dir(pathPtr); + qDebug("Path = %s", pathPtr); + CFRelease(pluginRef); + CFRelease(macPath); +#else + return string("."); +#endif +} int main(int argc, char **argv) { @@ -25,6 +42,7 @@ int main(int argc, char **argv) std::clog << "DISPLAY not set, running in console mode only" << std::endl; } #endif + //opts.doc_dir = get_doc_dir(); QApplication app(argc, argv, opts.useGUI); Q_INIT_RESOURCE(icons);