diff options
author | Tim E. Real <termtech@rogers.com> | 2013-02-22 06:46:23 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2013-02-22 06:46:23 +0000 |
commit | 48b9d2ea9961f935bacabc75a2fbd5cc141010ae (patch) | |
tree | 37512a1feed9d02145e0e52f0c96e5fe42a83f62 /muse2/muse | |
parent | 2d1fc0416a2d8611659a4f630fbc5719f35b694d (diff) |
New: Install pre-built PDF + single/split HMTL docs. Separate devel docs. Added build script.
Diffstat (limited to 'muse2/muse')
-rw-r--r-- | muse2/muse/help.cpp | 50 | ||||
-rw-r--r-- | muse2/muse/widgets/canvas.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/widgets/canvas.h | 2 |
3 files changed, 43 insertions, 11 deletions
diff --git a/muse2/muse/help.cpp b/muse2/muse/help.cpp index 4bce3a16..e371a6cf 100644 --- a/muse2/muse/help.cpp +++ b/muse2/muse/help.cpp @@ -23,6 +23,7 @@ #include <unistd.h> #include <stdlib.h> +#include <stdio.h> #include <QDesktopServices> #include <QMessageBox> @@ -34,6 +35,9 @@ #include "icons.h" #include "aboutbox_impl.h" +// Whether to open the pdf or the html +#define MUSE_USE_PDF_HELP_FILE + namespace MusEGui { //--------------------------------------------------------- @@ -43,16 +47,44 @@ namespace MusEGui { void MusE::startHelpBrowser() { QString lang(getenv("LANG")); - QString museHelp = DOCDIR + QString("/html/index_") + lang + QString(".html"); - if (access(museHelp.toLatin1(), R_OK) != 0) { - museHelp = DOCDIR + QString("/html/index.html"); - if (access(museHelp.toLatin1(), R_OK) != 0) { - QString info(tr("no help found at: ")); - info += museHelp; - QMessageBox::critical(this, tr("MusE: Open Help"), info); - return; - } + QString museHelp; + bool pdffound = false; + +#ifdef MUSE_USE_PDF_HELP_FILE + museHelp = DOCDIR + QString("/muse_pdf/documentation_") + lang + QString(".pdf"); + if (access(museHelp.toLatin1(), R_OK) != 0) + { + museHelp = DOCDIR + QString("/muse_pdf/documentation.pdf"); + if (access(museHelp.toLatin1(), R_OK) != 0) + { + //QString info(tr("no help found at: ")); + //info += museHelp; + //info += tr("\nTrying HTML file instead...\n"); + //QMessageBox::critical(this, tr("MusE: Open Help"), info); + fprintf(stderr, "MusE::startHelpBrowser() no help found at:%s\nTrying HTML file instead...", + museHelp.toLatin1().constData()); } + else + pdffound = true; + } + else + pdffound = true; +#endif + + if(!pdffound) + { + museHelp = DOCDIR + QString("/muse_html/single/documentation/index_") + lang + QString(".html"); + if (access(museHelp.toLatin1(), R_OK) != 0) { + museHelp = DOCDIR + QString("/muse_html/single/documentation/index.html"); + if (access(museHelp.toLatin1(), R_OK) != 0) { + QString info(tr("no help found at: ")); + info += museHelp; + QMessageBox::critical(this, tr("MusE: Open Help"), info); + return; + } + } + } + launchBrowser(museHelp); } diff --git a/muse2/muse/widgets/canvas.cpp b/muse2/muse/widgets/canvas.cpp index 326992eb..b5df2494 100644 --- a/muse2/muse/widgets/canvas.cpp +++ b/muse2/muse/widgets/canvas.cpp @@ -3,7 +3,7 @@ // Linux Music Editor // $Id: canvas.cpp,v 1.10.2.17 2009/05/03 04:14:01 terminator356 Exp $ // (C) Copyright 1999 Werner Schweer (ws@seh.de) -// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net) +// Additions, modifications (C) Copyright 2011-2013 Tim E. Real (terminator356 on users DOT sourceforge DOT net) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License diff --git a/muse2/muse/widgets/canvas.h b/muse2/muse/widgets/canvas.h index d6859a14..06fcd0a6 100644 --- a/muse2/muse/widgets/canvas.h +++ b/muse2/muse/widgets/canvas.h @@ -3,7 +3,7 @@ // Linux Music Editor // $Id: canvas.h,v 1.3.2.8 2009/02/02 21:38:01 terminator356 Exp $ // (C) Copyright 1999 Werner Schweer (ws@seh.de) -// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net) +// Additions, modifications (C) Copyright 2011-2013 Tim E. Real (terminator356 on users DOT sourceforge DOT net) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License |