From d15db5de19eda5566a0c0bc4763b37533811b44e Mon Sep 17 00:00:00 2001 From: ws Date: Fri, 30 Jan 2015 17:03:51 +0100 Subject: [PATCH 1/3] cleanup for score dirty status --- libmscore/cmd.cpp | 7 +++++-- libmscore/excerpt.cpp | 2 +- libmscore/note.cpp | 12 ++++++------ libmscore/ottava.cpp | 2 +- libmscore/rendermidi.cpp | 2 +- libmscore/score.cpp | 28 ++++------------------------ libmscore/score.h | 8 ++++---- libmscore/scorefile.cpp | 2 -- libmscore/tempotext.cpp | 2 +- libmscore/undo.cpp | 6 +++--- mscore/capella.cpp | 2 +- mscore/file.cpp | 4 ++-- mscore/importgtp.cpp | 2 +- mscore/layer.cpp | 1 - mscore/mediadialog.cpp | 4 ---- mscore/musescore.cpp | 7 +------ mscore/stafftextproperties.cpp | 2 +- mscore/textstyle.cpp | 1 - 18 files changed, 32 insertions(+), 62 deletions(-) diff --git a/libmscore/cmd.cpp b/libmscore/cmd.cpp index 39e8fb6ae2..ae70cab1c0 100644 --- a/libmscore/cmd.cpp +++ b/libmscore/cmd.cpp @@ -137,10 +137,13 @@ void Score::endCmd(bool rollback) if (rollback) undo()->current()->unwind(); bool noUndo = (undo()->current()->childCount() <= 1); // nothing to undo? - if (!noUndo) - setDirty(true); undo()->endMacro(noUndo); end(); // DEBUG + + if (dirty()) { + rootScore()->_playlistDirty = true; // TODO: flag individual operations + rootScore()->_autosaveDirty = true; + } } //--------------------------------------------------------- diff --git a/libmscore/excerpt.cpp b/libmscore/excerpt.cpp index de3a08a28e..96485cbeb4 100644 --- a/libmscore/excerpt.cpp +++ b/libmscore/excerpt.cpp @@ -205,7 +205,7 @@ void createExcerpt(Excerpt* excerpt) // // layout score // - score->setPlaylistDirty(true); + score->setPlaylistDirty(); score->rebuildMidiMapping(); score->updateChannel(); diff --git a/libmscore/note.cpp b/libmscore/note.cpp index a1c3f3d95d..8e9d0af4e2 100644 --- a/libmscore/note.cpp +++ b/libmscore/note.cpp @@ -312,7 +312,7 @@ void Note::setPitch(int val) Q_ASSERT(val >= 0 && val <= 127); if (_pitch != val) { _pitch = val; - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); } } @@ -2229,7 +2229,7 @@ bool Note::setProperty(P_ID propertyId, const QVariant& v) setPitch(v.toInt()); if (m) m->cmdUpdateNotes(chord()->staffIdx()); - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); break; case P_ID::TPC1: _tpc[0] = v.toInt(); @@ -2258,11 +2258,11 @@ bool Note::setProperty(P_ID propertyId, const QVariant& v) break; case P_ID::VELO_OFFSET: setVeloOffset(v.toInt()); - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); break; case P_ID::TUNING: setTuning(v.toDouble()); - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); break; case P_ID::FRET: setFret(v.toInt()); @@ -2278,7 +2278,7 @@ bool Note::setProperty(P_ID propertyId, const QVariant& v) break; case P_ID::VELO_TYPE: setVeloType(ValueType(v.toInt())); - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); break; case P_ID::VISIBLE: { // P_ID::VISIBLE requires reflecting property on dots setVisible(v.toBool()); @@ -2291,7 +2291,7 @@ bool Note::setProperty(P_ID propertyId, const QVariant& v) } case P_ID::PLAY: setPlay(v.toBool()); - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); break; case P_ID::FIXED: setFixed(v.toBool()); diff --git a/libmscore/ottava.cpp b/libmscore/ottava.cpp index 50e05b50ff..2b77210435 100644 --- a/libmscore/ottava.cpp +++ b/libmscore/ottava.cpp @@ -230,7 +230,7 @@ void Ottava::endEdit() Staff* s = staff(); s->updateOttava(); score()->addLayoutFlags(LayoutFlag::FIX_PITCH_VELO); - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); } TextLine::endEdit(); } diff --git a/libmscore/rendermidi.cpp b/libmscore/rendermidi.cpp index 3de371f18b..4440ece415 100644 --- a/libmscore/rendermidi.cpp +++ b/libmscore/rendermidi.cpp @@ -440,7 +440,7 @@ void Score::updateRepeatList(bool expandRepeats) repeatList()->unwind(); if (MScore::debugMode) repeatList()->dump(); - setPlaylistDirty(true); + setPlaylistDirty(); } //--------------------------------------------------------- diff --git a/libmscore/score.cpp b/libmscore/score.cpp index 1b549076d5..da14e942f9 100644 --- a/libmscore/score.cpp +++ b/libmscore/score.cpp @@ -306,9 +306,8 @@ void Score::init() _showVBox = true; _printing = false; - _playlistDirty = false; - _autosaveDirty = false; - _dirty = false; + _playlistDirty = true; + _autosaveDirty = true; _saved = false; _pos[int(POS::CURRENT)] = 0; _pos[int(POS::LEFT)] = 0; @@ -360,7 +359,6 @@ Score::Score(const MStyle* s) // _links // _staffTypes // _metaTags -// _dirty // Score::Score(Score* parent) @@ -719,30 +717,13 @@ void Score::setShowPageborders(bool v) end(); } -//--------------------------------------------------------- -// setDirty -//--------------------------------------------------------- - -void Score::setDirty(bool val) - { - Score* s = rootScore(); - if (s->dirty() != val) { - s->_dirty = val; - s->_playlistDirty = true; - } - if (s->dirty()) { - s->_playlistDirty = true; - s->_autosaveDirty = true; - } - } - //--------------------------------------------------------- // dirty //--------------------------------------------------------- bool Score::dirty() const { - return rootScore()->_dirty; + return !undo()->isClean(); } //--------------------------------------------------------- @@ -1439,7 +1420,7 @@ void Score::addElement(Element* element) break; case Element::Type::CHORD: - setPlaylistDirty(true); + setPlaylistDirty(); // create playlist does not work here bc. tremolos may not be complete // createPlayEvents(static_cast(element)); break; @@ -2041,7 +2022,6 @@ Score* Score::clone() void Score::setSynthesizerState(const SynthesizerState& s) { // TODO: make undoable - _dirty = true; _synthesizerState = s; } diff --git a/libmscore/score.h b/libmscore/score.h index 4943424f70..5f1dd04a06 100644 --- a/libmscore/score.h +++ b/libmscore/score.h @@ -364,7 +364,7 @@ class Score : public QObject { bool _printing; ///< True if we are drawing to a printer bool _playlistDirty; bool _autosaveDirty; - bool _dirty; ///< Score data was modified. +// bool _dirty; ///< Score data was modified. bool _saved; ///< True if project was already saved; only on first ///< save a backup file will be created, subsequent ///< saves will not overwrite the backup file. @@ -486,7 +486,7 @@ class Score : public QObject { ~Score(); Score* clone(); - void setDirty(bool val); +// void setDirty(bool val); void rebuildBspTree(); bool noStaves() const { return _staves.empty(); } @@ -710,8 +710,8 @@ class Score : public QObject { void setPrinting(bool val) { _printing = val; } void setAutosaveDirty(bool v) { _autosaveDirty = v; } bool autosaveDirty() const { return _autosaveDirty; } - bool playlistDirty() { return _playlistDirty; } - void setPlaylistDirty(bool val) { _playlistDirty = val; } + bool playlistDirty() { return _playlistDirty; } + void setPlaylistDirty() { _playlistDirty = true; } void spell(); void spell(int startStaff, int endStaff, Segment* startSegment, Segment* endSegment); diff --git a/libmscore/scorefile.cpp b/libmscore/scorefile.cpp index bacd961b47..4bdfb167c7 100644 --- a/libmscore/scorefile.cpp +++ b/libmscore/scorefile.cpp @@ -359,7 +359,6 @@ bool Score::saveFile() return false; } undo()->setClean(); - setDirty(false); info.refresh(); update(); return true; @@ -438,7 +437,6 @@ bool Score::saveFile() | QFile::ReadGroup | QFile::ReadOther); undo()->setClean(); - setDirty(false); setSaved(true); info.refresh(); update(); diff --git a/libmscore/tempotext.cpp b/libmscore/tempotext.cpp index 6a9f16d566..8a6f59e537 100644 --- a/libmscore/tempotext.cpp +++ b/libmscore/tempotext.cpp @@ -165,7 +165,7 @@ void TempoText::textChanged() _tempo = qreal(sl[1].toInt()) * tp[i].f; if(segment()) score()->setTempo(segment(), _tempo); - score()->setPlaylistDirty(true); + score()->setPlaylistDirty(); } break; } diff --git a/libmscore/undo.cpp b/libmscore/undo.cpp index 1a86318490..a26f0733ab 100644 --- a/libmscore/undo.cpp +++ b/libmscore/undo.cpp @@ -2623,7 +2623,7 @@ void ChangeStaff::flip() } staff->score()->setLayoutAll(true); staff->score()->rebuildMidiMapping(); - staff->score()->setPlaylistDirty(true); + staff->score()->setPlaylistDirty(); score->scanElements(0, notifyTimeSigs); } @@ -2672,7 +2672,7 @@ void ChangePart::flip() Score* score = part->score(); score->rebuildMidiMapping(); score->setInstrumentsChanged(true); - score->setPlaylistDirty(true); + score->setPlaylistDirty(); // Interval oint = oi.transpose(); // Interval nint = part->instr()->transpose(); @@ -3707,7 +3707,7 @@ void InsertTime::undo() void ChangeNoteEvent::flip() { - note->score()->setPlaylistDirty(true); + note->score()->setPlaylistDirty(); NoteEvent e = *oldEvent; *oldEvent = newEvent; newEvent = e; diff --git a/mscore/capella.cpp b/mscore/capella.cpp index ab1499709c..299aa05b35 100644 --- a/mscore/capella.cpp +++ b/mscore/capella.cpp @@ -1279,7 +1279,7 @@ void convertCapella(Score* score, Capella* cap, bool capxMode) score->connectTies(); score->fixTicks(); score->updateNotes(); - score->setPlaylistDirty(true); + score->setPlaylistDirty(); score->setLayoutAll(true); score->addLayoutFlags(LayoutFlag::FIX_TICKS | LayoutFlag::FIX_PITCH_VELO); } diff --git a/mscore/file.cpp b/mscore/file.cpp index 8684a0d93b..ed49094772 100644 --- a/mscore/file.cpp +++ b/mscore/file.cpp @@ -457,7 +457,7 @@ void MuseScore::updateNewWizard() if (newWizard != 0) newWizard = new NewWizard(this); } - + //--------------------------------------------------------- // newFile // create new score @@ -2070,7 +2070,7 @@ Score::FileError readScore(Score* score, QString name, bool ignoreVersionError) score->setLayoutAll(true); for (Score* s : score->scoreList()) { - s->setPlaylistDirty(true); + s->setPlaylistDirty(); s->rebuildMidiMapping(); s->updateChannel(); s->updateNotes(); diff --git a/mscore/importgtp.cpp b/mscore/importgtp.cpp index 1271deadb1..2032bdd728 100644 --- a/mscore/importgtp.cpp +++ b/mscore/importgtp.cpp @@ -2371,7 +2371,7 @@ Score::FileError importGTP(Score* score, const QString& name) // // layout score // - pscore->setPlaylistDirty(true); + pscore->setPlaylistDirty(); pscore->rebuildMidiMapping(); pscore->updateChannel(); pscore->updateNotes(); diff --git a/mscore/layer.cpp b/mscore/layer.cpp index 66719c2b36..73b9271a35 100644 --- a/mscore/layer.cpp +++ b/mscore/layer.cpp @@ -207,7 +207,6 @@ void LayerManager:: accept() l.tags |= 1; layer.append(l); } - score->setDirty(true); score->setLayoutAll(true); score->endCmd(); if (enableExperimental) diff --git a/mscore/mediadialog.cpp b/mscore/mediadialog.cpp index 71d34f1de4..2bc7c8102b 100644 --- a/mscore/mediadialog.cpp +++ b/mscore/mediadialog.cpp @@ -101,7 +101,6 @@ void MediaDialog::addScanPressed() return; } score->setOmr(omr); - score->setDirty(true); mscore->currentScoreView()->showOmr(true); } @@ -113,7 +112,6 @@ void MediaDialog::removeScanPressed() { mscore->currentScoreView()->showOmr(false); score->removeOmr(); - score->setDirty(true); scanFile->setText(QString()); addScan->setEnabled(true); removeScan->setEnabled(false); @@ -138,7 +136,6 @@ void MediaDialog::addAudioPressed() audio->setPath(path); audio->setData(ba); score->setAudio(audio); - score->setDirty(true); mscore->updatePlayMode(); #if 0 @@ -211,7 +208,6 @@ void MediaDialog::addAudioPressed() void MediaDialog::removeAudioPressed() { score->removeAudio(); - score->setDirty(true); audioFile->setText(QString()); addAudio->setEnabled(true); removeAudio->setEnabled(false); diff --git a/mscore/musescore.cpp b/mscore/musescore.cpp index d1b147c908..6f932ba96c 100644 --- a/mscore/musescore.cpp +++ b/mscore/musescore.cpp @@ -3238,7 +3238,6 @@ bool MuseScore::restoreSession(bool always) else if (tag == "Score") { QString name; bool created = false; - bool dirty = false; while (e.readNextStartElement()) { const QStringRef& tag(e.name()); if (tag == "name") @@ -3246,7 +3245,7 @@ bool MuseScore::restoreSession(bool always) else if (tag == "created") created = e.readInt(); else if (tag == "dirty") - dirty = e.readInt(); + /*int dirty =*/ e.readInt(); else if (tag == "path") { Score* score = readScore(e.readElementText()); if (score) { @@ -3254,11 +3253,9 @@ bool MuseScore::restoreSession(bool always) score->setName(name); if (cleanExit) { // override if last session did a clean exit - dirty = false; created = false; } appendScore(score); - score->setDirty(dirty); score->setCreated(created); } } @@ -3579,7 +3576,6 @@ void MuseScore::networkFinished(QNetworkReply* reply) return; } score->setCreated(true); - score->setDirty(true); setCurrentScoreView(appendScore(score)); } @@ -3827,7 +3823,6 @@ void MuseScore::endCmd() setPos(cs->inputState().tick()); updateInputState(cs); updateUndoRedo(); - cs->setDirty(!cs->undo()->isClean()); dirtyChanged(cs); Element* e = cs->selection().element(); if (e && cs->playNote()) { diff --git a/mscore/stafftextproperties.cpp b/mscore/stafftextproperties.cpp index 3e1578e053..e1c8d4e96f 100644 --- a/mscore/stafftextproperties.cpp +++ b/mscore/stafftextproperties.cpp @@ -434,7 +434,7 @@ void StaffTextProperties::saveValues() } staffText->score()->updateChannel(); staffText->score()->updateSwing(); - staffText->score()->setPlaylistDirty(true); + staffText->score()->setPlaylistDirty(); } } diff --git a/mscore/textstyle.cpp b/mscore/textstyle.cpp index af8988747c..58beccffa4 100644 --- a/mscore/textstyle.cpp +++ b/mscore/textstyle.cpp @@ -232,7 +232,6 @@ void TextStyleDialog::newClicked() textNames->addItem(s); textNames->item(count)->setData(Qt::UserRole, listIdx); textNames->setCurrentRow(count); - cs->setDirty(true); mscore->endCmd(); } } From 1603cf8ee687c748097c74181287b1746672bcfd Mon Sep 17 00:00:00 2001 From: ws Date: Mon, 2 Feb 2015 09:30:17 +0100 Subject: [PATCH 2/3] implement qt help system, first part --- CMakeLists.txt | 2 + all.h | 4 ++ build/ECMQt4To5Porting.cmake | 1 + build/FindQt5Transitional.cmake | 1 + mscore/CMakeLists.txt | 1 + mscore/help.cpp | 118 ++++++++++++++++++++++++++++++++ mscore/help.h | 42 ++++++++++++ mscore/musescore.cpp | 7 +- mscore/musescore.h | 2 + rdoc/CMakeLists.txt | 25 +++++++ rdoc/classic.css | 0 rdoc/doc.html | 9 +++ rdoc/doc.qch | Bin 0 -> 22528 bytes rdoc/doc.qhcp | 14 ++++ rdoc/doc.qhp | 31 +++++++++ 15 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 mscore/help.cpp create mode 100644 mscore/help.h create mode 100644 rdoc/CMakeLists.txt create mode 100644 rdoc/classic.css create mode 100644 rdoc/doc.html create mode 100644 rdoc/doc.qch create mode 100644 rdoc/doc.qhcp create mode 100644 rdoc/doc.qhp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a27743250..a00adf9096 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,7 @@ SET(QT_USE_QTDESIGNER TRUE) SET(QT_USE_QTWEBKIT TRUE) SET(QT_USE_QTXMLPATTERNS TRUE) SET(QT_USE_QTDECLARATIVE TRUE) +SET(QT_USE_QTHELP TRUE) #find_package(Qt5 COMPONENTS Widgets Xml Svg Network Designer WebKit Declarative) @@ -385,6 +386,7 @@ subdirs( mscore awl bww2mxml share midi audiofile fluid mstyle libmscore synthesizer effects thirdparty/rtf2html thirdparty/diff thirdparty/beatroot thirdparty/xmlstream thirdparty/qzip thirdparty/kQOAuth thirdparty/qtwaitingspinner + rdoc ) if (APPLE AND CMAKE_BUILD_TYPE MATCHES "DEBUG") #with xcode, we need to have all the targets in the same project diff --git a/all.h b/all.h index ef6fa12e1d..236bc7bfa7 100644 --- a/all.h +++ b/all.h @@ -157,5 +157,9 @@ #include #include #include + +#include +#include +#include #endif diff --git a/build/ECMQt4To5Porting.cmake b/build/ECMQt4To5Porting.cmake index 890f218aac..a6318fc9fc 100644 --- a/build/ECMQt4To5Porting.cmake +++ b/build/ECMQt4To5Porting.cmake @@ -171,6 +171,7 @@ set(_qt_modules WebKitWidgets Sql OpenGL + Help ) foreach(_module ${_qt_modules}) diff --git a/build/FindQt5Transitional.cmake b/build/FindQt5Transitional.cmake index bb6b9d6a45..791eb4a005 100644 --- a/build/FindQt5Transitional.cmake +++ b/build/FindQt5Transitional.cmake @@ -27,6 +27,7 @@ if (Qt5Core_FOUND) WebKitWidgets OpenGL LinguistTools + Help ) foreach(_component ${_components}) find_package(Qt5${_component}) diff --git a/mscore/CMakeLists.txt b/mscore/CMakeLists.txt index e6634eb83b..b65af0e158 100644 --- a/mscore/CMakeLists.txt +++ b/mscore/CMakeLists.txt @@ -264,6 +264,7 @@ add_executable ( ${ExecutableName} textcursor.cpp continuouspanel.cpp accessibletoolbutton.cpp scoreaccessibility.cpp startcenter.cpp scoreBrowser.cpp scorePreview.cpp scoreInfo.cpp logindialog.cpp loginmanager.cpp uploadscoredialog.cpp breaksdialog.cpp + help.cpp help.h ${OMR_FILES} ${AUDIO} diff --git a/mscore/help.cpp b/mscore/help.cpp new file mode 100644 index 0000000000..4005cc5379 --- /dev/null +++ b/mscore/help.cpp @@ -0,0 +1,118 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2015 Werner Schweer +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 +// as published by the Free Software Foundation and appearing in +// the file LICENCE.GPL +//============================================================================= + +#include "help.h" +#include "musescore.h" + +namespace Ms { + +static QHelpEngineCore* help; + +//--------------------------------------------------------- +// HelpQuery +//--------------------------------------------------------- + +HelpQuery::HelpQuery(QWidget* parent) + : QWidgetAction(parent) + { + if (!help) { + QString s = getSharePath() + "manual/doc.qhc"; + printf("====<%s>\n", qPrintable(s)); + help = new QHelpEngineCore(s); + if (!help->setupData()) { + delete help; + help = 0; + printf("cannot setup data for help engine\n"); + } + } + + w = new QWidget(parent); + QHBoxLayout* layout = new QHBoxLayout; + + QLabel* label = new QLabel; + label->setText(tr("Search for: ")); + layout->addWidget(label); + + entry = new QLineEdit; + layout->addWidget(entry); + + QToolButton* button = new QToolButton; + button->setText("x"); + layout->addWidget(button); + + w->setLayout(layout); + setDefaultWidget(w); + + emptyState = true; + + connect(button, SIGNAL(clicked()), entry, SLOT(clear())); + connect(entry, SIGNAL(textChanged(const QString&)), SLOT(textChanged(const QString&))); + QMenu* menu = static_cast(parent); + connect(menu, SIGNAL(triggered(QAction*)), SLOT(actionTriggered(QAction*))); + } + +//--------------------------------------------------------- +// textChanged +//--------------------------------------------------------- + +void HelpQuery::textChanged(const QString& s) + { + QWidget* menu = static_cast(parent()); + if (s.isEmpty()) { + if (!emptyState) { // restore old menu entries + QList al = menu->actions(); + for (QAction* a : al) { + if (a != this) + menu->removeAction(a); + } + for (QAction* a : actions) { + if (a != this) + menu->addAction(a); + } + } + emptyState = true; + return; + } + if (emptyState) + actions = menu->actions(); + for (QAction* a : menu->actions()) { + if (a != this) + menu->removeAction(a); + } + for (const QChar& c : s) { + QAction* action = new QAction(QString(c), this); + action->setData(QString(c)); + menu->addAction(action); + } + emptyState = false; + + + QMaplist = help->linksForIdentifier(s); + printf("=====links %d\n", list.size()); + for (const QUrl& s : list) + printf(" %s\n", qPrintable(s.toString())); + } + +//--------------------------------------------------------- +// actionTriggered +//--------------------------------------------------------- + +void HelpQuery::actionTriggered(QAction* action) + { + if (action->data().isNull()) + return; + printf("action <%s>\n", qPrintable(action->data().toString())); + } + + +} // end namespace Ms + diff --git a/mscore/help.h b/mscore/help.h new file mode 100644 index 0000000000..9bc1b17548 --- /dev/null +++ b/mscore/help.h @@ -0,0 +1,42 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2015 Werner Schweer +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 +// as published by the Free Software Foundation and appearing in +// the file LICENCE.GPL +//============================================================================= + +#ifndef __HELP_H__ +#define __HELP_H__ + +namespace Ms { + +//--------------------------------------------------------- +// HelpQuery +//--------------------------------------------------------- + +class HelpQuery : public QWidgetAction { + Q_OBJECT + + QWidget* w; + QLineEdit* entry; + QList actions; + bool emptyState; + + private slots: + void textChanged(const QString&); + void actionTriggered(QAction*); + + public: + HelpQuery(QWidget* parent); + }; + +} // end namespace Ms +#endif + + + diff --git a/mscore/musescore.cpp b/mscore/musescore.cpp index 6f932ba96c..15416ae77f 100644 --- a/mscore/musescore.cpp +++ b/mscore/musescore.cpp @@ -100,6 +100,7 @@ #include "accessibletoolbutton.h" #include "startcenter.h" +#include "help.h" #ifdef AEOLUS extern Ms::Synthesizer* createAeolus(); @@ -193,7 +194,7 @@ void InsertMeasuresDialog::accept() // getSharePath //--------------------------------------------------------- -static QString getSharePath() +QString getSharePath() { #ifdef Q_OS_WIN QDir dir(QCoreApplication::applicationDirPath() + QString("/../" INSTALL_NAME)); @@ -584,6 +585,7 @@ MuseScore::MuseScore() entryTools->addWidget(tb); } + //--------------------- // Menus //--------------------- @@ -886,6 +888,9 @@ MuseScore::MuseScore() QMenu* menuHelp = mb->addMenu(tr("&Help")); menuHelp->setObjectName("Help"); + HelpQuery* hw = new HelpQuery(menuHelp); + menuHelp->addAction(hw); + if (enableExperimental) menuHelp->addAction(getAction("local-help")); menuHelp->addAction(tr("&Online Handbook"), this, SLOT(helpBrowser1())); diff --git a/mscore/musescore.h b/mscore/musescore.h index d22facdb0e..4546559cbb 100644 --- a/mscore/musescore.h +++ b/mscore/musescore.h @@ -701,5 +701,7 @@ extern bool saveXml(Score*, const QString& name); struct PluginDescription; extern void collectPluginMetaInformation(PluginDescription*); +extern QString getSharePath(); + } // namespace Ms #endif diff --git a/rdoc/CMakeLists.txt b/rdoc/CMakeLists.txt new file mode 100644 index 0000000000..0b3a4d7bd6 --- /dev/null +++ b/rdoc/CMakeLists.txt @@ -0,0 +1,25 @@ +#============================================================================= +# MuseScore +# Music Composition & Notation +# $Id:$ +# +# Copyright (C) 2011 Werner Schweer +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# as published by the Free Software Foundation and appearing in +# the file LICENSE.GPL +#============================================================================= + +add_custom_target(referenceDocumentation + ALL + DEPENDS doc.html doc.qhp + ) + +add_custom_command(TARGET referenceDocumentation + POST_BUILD + COMMAND qcollectiongenerator ${PROJECT_SOURCE_DIR}/rdoc/doc.qhcp -o doc.qhc + ) + +install(FILES ${PROJECT_BINARY_DIR}/rdoc/doc.qhc DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}manual) + diff --git a/rdoc/classic.css b/rdoc/classic.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rdoc/doc.html b/rdoc/doc.html new file mode 100644 index 0000000000..18955a9a86 --- /dev/null +++ b/rdoc/doc.html @@ -0,0 +1,9 @@ + + + +Hello MuseScore! + + + + + diff --git a/rdoc/doc.qch b/rdoc/doc.qch new file mode 100644 index 0000000000000000000000000000000000000000..f10aa4c8fc329506d01cdfe185e935c6bd3443e5 GIT binary patch literal 22528 zcmeHOO>7%Q6rS0)>&>P~)5d8{)s{?ZRf%bw#xbTS2Sl2f*3cv+b^ng8y^$^aliC{; zRD|RT0T=EZfD=NhIJI!#R`o_IwGv32IDlGI0fJJBTEx$RH?#Ks)J_$tQlail?Df1i zZ{C~t*)#L9`{u~YhYFU-7Aw_K#$s`z5=zPQj1fY1<9jQZz|)-A$r5 z0vfg|aF@$$g}?2}S{)=`A|MfX2nh7_qLFT$UnzV?@Fj~xKqAm#2s}xFOqZ5xW-VK( znq%2YY0RZ2#>V;lSKucCxA7v2L_i|Yp$G&NAVHk*J-8wa&f2 zx+M{i2s9AbgmZt`nfuJy|L+j|zxm*6bys!{~EkQ;2L}d=ivja z$|4bv2s~s2f|^c9$e`O^DOQ$huvn>_%2fMRWNtxb$>j|K^7bOn*~TX)ZRtj*jfzf! z#GpY`0QlZPk&YmZQvN=?1E2rCyZR5=Z)r{m*#meyHHC7rCcpxr1B`Sg#AoXB{7uhC(}M26WsOnpJ>~kbJy2D-nM_7 z@BccvNXSJRp&u&)${R2QZz1#1D0!-fA`x2OU}a7f&ACj;tSx1-X1bM9rWcY^=_E@} z?LU-cen~cx%CXd3I(Z;BC|YK9 z%Cf43Q_GfZuN@D3R@+IeXXwM#6@ADYvV-tSbS{+htW726{m$kgAhr(f6 z4|%M4EQzYt#)@cQBixva=P0|!YqyC->P*u^Lqqhe{r#oNIdes5accpeA(y`nPexfP zXO^wPV!^BmAV=Nr-5rG(pl`rav+)+A|-a1mJ%{y8g z7WdN~0gJ5YdMFyD^{{KiM$I+jp}SfQd0N@Xnt->l%;&#?xBlh*|3_oNlcSUfJTL>~`{a_npJF8jW~ zqWwlRld&>v|DpN)xHGDT9*W0leXq~DXPs{v@~}3v9f?QazI#Jcp?71dE8Ti%-@fL~ zgsMy@=s99q0*toIUf)pKig>}fZby@{oNkwmgmZg_-O1Li~EK?cF}dsuQhoQHR*nV$o?rdzE6&th#FL zNT(6>_$`jIbipb%!&FUVpmGjrHT}WM?Klj=7+Xt_#t{%S?jn4JXUETZQ(eE#O`Sw9lfA_hWDEYA3 zH=$!5@BsG^^M458`@ae|2>b=V!!KBoMIs;(=r9EAr+*-x{(**1{`jLnO#h<_pZ~z0 z|Nn{4{V#Qx+tMA0K&K<{1Zc)iI+Uwq$MROG2=nJ%i`}hJvTF`D13ahElPy@ot1dgKPZ$ z-(C0(e#ELQ5&?-o#~=`Zpn(T{bO=&B4TKrMgyQW0LREeNKK}u}CGZdYj32T{1SA5T zgFp}Lq|U8@J_u9K9RLNO*RbdREk6J6!mZA6TzVoAkO;IQpy9oL0De_){x{D5D+!_` zluwX-7|yl!ksOJD4*_eVeL%p@O|)~*>?Apnh9;_;{po6M!&+x88s{C%70a8ZKjWOs zh@9vP@O;eEB2RACv@%Y1pO5JG8TK`aqX{f6OdQJ;m(51vUushzG&n>v1)i5LjxUG= zedjbnu%R+FH + + + + + doc.qhp + doc.qch + + + + doc.qch + + + diff --git a/rdoc/doc.qhp b/rdoc/doc.qhp new file mode 100644 index 0000000000..4e4bfb3a4a --- /dev/null +++ b/rdoc/doc.qhp @@ -0,0 +1,31 @@ + + + musescore.com.musescore.2.0 + doc + + MuseScore + 2.0 + + + MuseScore + 2.0 + +
+
+
+
+
+ + + + + + + + + + classic.css + *.html + + + From 0ddb30e7fc5f3b11d1dd044b70a62de8302cadf3 Mon Sep 17 00:00:00 2001 From: ws Date: Fri, 6 Feb 2015 17:39:45 +0100 Subject: [PATCH 3/3] small fix for local help --- mscore/help.cpp | 6 ++++-- mscore/helpBrowser.cpp | 2 +- mscore/musescore.cpp | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mscore/help.cpp b/mscore/help.cpp index 47455d9a02..ecc8923bde 100644 --- a/mscore/help.cpp +++ b/mscore/help.cpp @@ -111,8 +111,10 @@ void HelpQuery::actionTriggered(QAction* action) if (action->data().isNull()) return; QUrl url = action->data().toUrl(); - printf("actionTriggered <%s>\n", qPrintable(url.toString())); - mscore->showHelp(url); + if (url.isValid()) { + printf("actionTriggered <%s>\n", qPrintable(url.toString())); + mscore->showHelp(url); + } } diff --git a/mscore/helpBrowser.cpp b/mscore/helpBrowser.cpp index a044d840e0..025ebf23cd 100644 --- a/mscore/helpBrowser.cpp +++ b/mscore/helpBrowser.cpp @@ -50,7 +50,7 @@ HelpBrowser::HelpBrowser(QWidget* parent) QToolButton* next = new QToolButton; next->setIcon(QIcon(*icons[int(Icons::goNext_ICON)])); bl->addWidget(next); - connect(next, SIGNAL(clicked()), view, SLOT(forward()) + connect(next, SIGNAL(clicked()), view, SLOT(forward())); connect(view, SIGNAL(forwardAvailable(bool)), next, SLOT(setEnabled(bool))); bl->addStretch(10); diff --git a/mscore/musescore.cpp b/mscore/musescore.cpp index 319ac46d8f..8a8377e613 100644 --- a/mscore/musescore.cpp +++ b/mscore/musescore.cpp @@ -1043,9 +1043,12 @@ void MuseScore::showHelp(QString s) { if (s.isEmpty()) s = "manual"; + qDebug("showHelp <%s>", qPrintable(s)); QMaplist = helpEngine->linksForIdentifier(s); if (!list.isEmpty()) showHelp(*list.begin()); + else + qDebug("help for <%s> not found", qPrintable(s)); } //--------------------------------------------------------- @@ -4069,7 +4072,6 @@ void MuseScore::cmd(QAction* a, const QString& cmd) // else if (cmd == "toggle-noteinput") // entryTools->setVisible(!entryTools->isVisible()); else if (cmd == "local-help") { -printf("cmd local help, checked %d\n", a->isChecked()); if (!a->isChecked()) { if (manualDock) manualDock->hide();