From 1b01ff89a892df30494fa3d964c6b0acf179804a Mon Sep 17 00:00:00 2001 From: Orcan Ogetbil Date: Mon, 20 Dec 2010 22:55:49 +0000 Subject: Use the default browser of the system to open help pages. Added some groupboxes and layouts to genset. --- muse2/ChangeLog | 3 + muse2/config.h.in | 1 + muse2/muse/conf.cpp | 46 +----- muse2/muse/gconfig.cpp | 2 +- muse2/muse/gconfig.h | 1 - muse2/muse/help.cpp | 38 ++--- muse2/muse/widgets/genset.cpp | 3 - muse2/muse/widgets/gensetbase.ui | 316 ++++++++++++++++----------------------- 8 files changed, 147 insertions(+), 263 deletions(-) diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 47ac662c..8ffcb618 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,5 +1,8 @@ 20.12.2010: - Fixed arranger grid h-line drawing, track, and part drawing alignment, border issues. (Tim) + - To open help pages, use the default browser of the system via QDeskopServices. Removed + the configuration option to select the browser. (Orcan) + - Added some groupboxes and layouts to Global Settings to make it look more uniform. (Orcan) 19.12.2010: - Fixed not saving part colours and part canvas background appearance settings. (Tim) *Feature: Added 'global opaqueness' (transparency) appearance setting. (Tim) diff --git a/muse2/config.h.in b/muse2/config.h.in index 2fa3148c..f7b511ad 100644 --- a/muse2/config.h.in +++ b/muse2/config.h.in @@ -27,5 +27,6 @@ #define VERSION "${MusE_VERSION_FULL}" #define SVNVERSION "${MusE_SVNVER}" #define PACKAGE_NAME "MusE" +#define DOCDIR "${MusE_DOC_DIR}" #define SHAREDIR "${MusE_SHARE_DIR}" #define LIBDIR "${MusE_LIB_DIR}" diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 3f7c33e7..3ea829b0 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -836,12 +836,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer) config.dummyAudioBufSize = xml.parseInt(); else if (tag == "guiRefresh") config.guiRefresh = xml.parseInt(); - else if (tag == "helpBrowser") - { - QString tmp = xml.parse1(); - if (tmp.isNull()) {tmp = "";} - config.helpBrowser = tmp; - } else if (tag == "midiTransform") readMidiTransform(xml); else if (tag == "midiInputTransform") @@ -877,41 +871,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer) } } -//--------------------------------------------------------- -// probeMachineSpecificConfiguration -//--------------------------------------------------------- - -static void probeMachineSpecificConfiguration() - { - // set a default help browser (crude way to find out) - if (!system("which konqueror > /dev/null")) - { - config.helpBrowser = QString("konqueror"); - } - else if (!system("which opera > /dev/null")) - { - config.helpBrowser = QString("opera"); - } - else if (!system("which mozilla-firefox > /dev/null")) - { - config.helpBrowser = QString("mozilla-firefox"); - } - else if (!system("which firefox > /dev/null")) - { - config.helpBrowser = QString("firefox"); - } - else if (!system("which mozilla > /dev/null")) - { - config.helpBrowser = QString("mozilla"); - } - else - { - config.helpBrowser = QString(""); - // was not able to find a browser - } - // More preconfiguration - } - //--------------------------------------------------------- // readConfiguration //--------------------------------------------------------- @@ -923,8 +882,6 @@ bool readConfiguration() if (debugMsg || debugMode) fprintf(stderr, "NO Config File <%s> found\n", configName.toLatin1().constData()); - // if the config file does not exist launch probeMachineSpecificConfiguration - probeMachineSpecificConfiguration(); return true; } Xml xml(f); @@ -1120,7 +1077,8 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const xml.intTag(level, "dummyAudioSampleRate", config.dummyAudioSampleRate); xml.intTag(level, "guiRefresh", config.guiRefresh); - xml.strTag(level, "helpBrowser", config.helpBrowser); + // Removed by Orcan. 20101220 + //xml.strTag(level, "helpBrowser", config.helpBrowser); xml.intTag(level, "extendedMidi", config.extendedMidi); xml.intTag(level, "midiExportDivision", config.midiDivision); xml.intTag(level, "guiDivision", config.guiDivision); diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp index ec44ec3f..f4db3604 100644 --- a/muse2/muse/gconfig.cpp +++ b/muse2/muse/gconfig.cpp @@ -82,7 +82,7 @@ GlobalConfigValues config = { -60.0, // double minSlider; false, // use Jack freewheel 20, // int guiRefresh; - QString(""), // helpBrowser + //QString(""), // helpBrowser; // Obsolete true, // extendedMidi 384, // division for smf export QString(""), // copyright string for smf export diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h index 79c66d99..50d13d21 100644 --- a/muse2/muse/gconfig.h +++ b/muse2/muse/gconfig.h @@ -78,7 +78,6 @@ struct GlobalConfigValues { double minSlider; bool freewheelMode; int guiRefresh; - QString helpBrowser; bool extendedMidi; // extended smf format int midiDivision; // division for smf export diff --git a/muse2/muse/help.cpp b/muse2/muse/help.cpp index 268449e6..30803838 100644 --- a/muse2/muse/help.cpp +++ b/muse2/muse/help.cpp @@ -9,8 +9,9 @@ #include #include +#include #include -#include +#include #include "app.h" #include "globals.h" @@ -25,9 +26,9 @@ void MusE::startHelpBrowser() { QString lang(getenv("LANG")); - QString museHelp = museGlobalShare + QString("/html/index_") + lang + QString(".html"); + QString museHelp = DOCDIR + QString("/html/index_") + lang + QString(".html"); if (access(museHelp.toLatin1(), R_OK) != 0) { - museHelp = museGlobalShare + QString("/html/index.html"); + museHelp = DOCDIR + QString("/html/index.html"); if (access(museHelp.toLatin1(), R_OK) != 0) { QString info(tr("no help found at: ")); info += museHelp; @@ -82,33 +83,12 @@ void MusE::aboutQt() void MusE::launchBrowser(QString &whereTo) { - char testStr[40]; - strcpy(testStr, "which "); - strcat(testStr, config.helpBrowser.toLatin1()); - if (config.helpBrowser == "" || system(testStr)) - { - QMessageBox::information( this, "Unable to launch help", - "For some reason MusE has failed to detect or launch\n" - "a browser on your machine. Please go to Settings->Global Settings->GUI\n" - "and insert the program name of your favourite browser.", - "Ok", - 0 ); - return; - } - - QString exe = QString("/bin/sh"); - if(QFile::exists(exe)) - { - // Orcan: Shall we use this instead? Opens the default browser of the user: - // QDesktopServices::openUrl(QUrl(whereTo)); - QStringList arguments; - arguments << "-c" << config.helpBrowser << whereTo; - QProcess helper; - helper.start(exe, arguments); - } - else + if (! QDesktopServices::openUrl(QUrl(whereTo))) { + QMessageBox::information(this, tr("Unable to launch help"), + tr("For some reason MusE has to launch the default\n" + "browser on your machine."), + QMessageBox::Ok, QMessageBox::Ok); printf("Unable to launch help\n"); } - } diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp index a05020d6..24e58855 100644 --- a/muse2/muse/widgets/genset.cpp +++ b/muse2/muse/widgets/genset.cpp @@ -78,7 +78,6 @@ GlobalSettingsConfig::GlobalSettingsConfig(QWidget* parent) //dummyAudioRealRate->setText(dad ? QString().setNum(sampleRate) : "---"); dummyAudioRealRate->setText(QString().setNum(sampleRate)); - helpBrowser->setText(config.helpBrowser); startSongEntry->setText(config.startSong); startSongGroup->button(config.startMode)->setChecked(true); @@ -183,7 +182,6 @@ void GlobalSettingsConfig::updateSettings() //dummyAudioRealRate->setText(dad ? QString().setNum(sampleRate) : "---"); dummyAudioRealRate->setText(QString().setNum(sampleRate)); - helpBrowser->setText(config.helpBrowser); startSongEntry->setText(config.startSong); startSongGroup->button(config.startMode)->setChecked(true); @@ -258,7 +256,6 @@ void GlobalSettingsConfig::apply() config.useOutputLimiter = outputLimiterCheckBox->isChecked(); config.vstInPlace = vstInPlaceCheckBox->isChecked(); config.rtcTicks = rtcResolutions[rtcticks]; - config.helpBrowser = helpBrowser->text(); config.startSong = startSongEntry->text(); config.startMode = startSongGroup->checkedId(); int das = dummyAudioSize->currentIndex(); diff --git a/muse2/muse/widgets/gensetbase.ui b/muse2/muse/widgets/gensetbase.ui index 9d63cbe5..6e5bfec8 100644 --- a/muse2/muse/widgets/gensetbase.ui +++ b/muse2/muse/widgets/gensetbase.ui @@ -6,7 +6,7 @@ 0 0 - 494 + 522 518 @@ -28,6 +28,9 @@ 0 + + 3 + Application @@ -424,43 +427,6 @@ - - - - 9 - - - - - show splash screen - - - - - - - show "Did you know?" dialog - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - @@ -536,6 +502,42 @@ + + + + On Launch + + + + + + show splash screen + + + + + + + show "Did you know?" dialog + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -1092,156 +1094,100 @@ Shorter periods are desirable. GUI - - - - - Help Browser: - - - false - - - - - - - GUI Refresh Rate - - - false - - - - - - - /sec - - - 2 - - - 100 - - - 20 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 240 - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 240 - - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 270 - 20 - - - - - - - - Use old-style stop shortcut: - - - false - - - - - - - Move single armed track with selection - - - false + + + 6 + + + 11 + + + + + Behavior + + + 11 + + + 6 + + + + + GUI Refresh Rate + + + false + + + + + + + /sec + + + 2 + + + 100 + + + 20 + + + + + + + Use old-style stop shortcut: + + + false + + + + + + + Move single armed track with selection + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + + + + - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 210 - 20 - - - - -- cgit v1.2.3