updates for local help and build system
This commit is contained in:
parent
30aaa5c5f4
commit
1f6e959af2
11 changed files with 28 additions and 54 deletions
|
@ -39,6 +39,8 @@ HelpQuery::HelpQuery(QWidget* parent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mapper = new QSignalMapper(this);
|
||||||
|
|
||||||
w = new QWidget(parent);
|
w = new QWidget(parent);
|
||||||
QHBoxLayout* layout = new QHBoxLayout;
|
QHBoxLayout* layout = new QHBoxLayout;
|
||||||
|
|
||||||
|
@ -60,8 +62,7 @@ HelpQuery::HelpQuery(QWidget* parent)
|
||||||
|
|
||||||
connect(button, SIGNAL(clicked()), entry, SLOT(clear()));
|
connect(button, SIGNAL(clicked()), entry, SLOT(clear()));
|
||||||
connect(entry, SIGNAL(textChanged(const QString&)), SLOT(textChanged(const QString&)));
|
connect(entry, SIGNAL(textChanged(const QString&)), SLOT(textChanged(const QString&)));
|
||||||
QMenu* menu = static_cast<QMenu*>(parent);
|
connect(mapper, SIGNAL(mapped(QObject*)), SLOT(actionTriggered(QObject*)));
|
||||||
connect(menu, SIGNAL(triggered(QAction*)), SLOT(actionTriggered(QAction*)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
@ -93,12 +94,14 @@ void HelpQuery::textChanged(const QString& s)
|
||||||
menu->removeAction(a);
|
menu->removeAction(a);
|
||||||
}
|
}
|
||||||
emptyState = false;
|
emptyState = false;
|
||||||
|
|
||||||
QMap<QString,QUrl>list = helpEngine->linksForIdentifier(s);
|
QMap<QString,QUrl>list = helpEngine->linksForIdentifier(s);
|
||||||
for (const QUrl& s : list) {
|
for (auto i = list.begin(); i != list.end(); ++i) {
|
||||||
QAction* action = new QAction(s.toString(), this);
|
QAction* action = new QAction(i.key(), this);
|
||||||
action->setData(s);
|
action->setData(i.value());
|
||||||
|
printf("add action <%s> <%s>\n", qPrintable(i.key()), qPrintable(i.value().toString()));
|
||||||
menu->addAction(action);
|
menu->addAction(action);
|
||||||
|
connect(action, SIGNAL(triggered()), mapper, SLOT(map()));
|
||||||
|
mapper->setMapping(action, action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,15 +109,17 @@ void HelpQuery::textChanged(const QString& s)
|
||||||
// actionTriggered
|
// actionTriggered
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
||||||
void HelpQuery::actionTriggered(QAction* action)
|
void HelpQuery::actionTriggered(QObject* obj)
|
||||||
{
|
{
|
||||||
|
QAction* action = static_cast<QAction*>(obj);
|
||||||
if (action->data().isNull())
|
if (action->data().isNull())
|
||||||
return;
|
return;
|
||||||
QUrl url = action->data().toUrl();
|
QUrl url = action->data().toUrl();
|
||||||
if (url.isValid()) {
|
if (url.isValid())
|
||||||
printf("actionTriggered <%s>\n", qPrintable(url.toString()));
|
|
||||||
mscore->showHelp(url);
|
mscore->showHelp(url);
|
||||||
}
|
else
|
||||||
|
qDebug("actionTriggered: bad url");
|
||||||
|
entry->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,11 +27,16 @@ class HelpQuery : public QWidgetAction {
|
||||||
QWidget* w;
|
QWidget* w;
|
||||||
QLineEdit* entry;
|
QLineEdit* entry;
|
||||||
QList<QAction*> actions;
|
QList<QAction*> actions;
|
||||||
|
QSignalMapper* mapper;
|
||||||
|
|
||||||
bool emptyState;
|
bool emptyState;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void textChanged(const QString&);
|
void textChanged(const QString&);
|
||||||
void actionTriggered(QAction*);
|
void actionTriggered(QObject*);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setFocus() { entry->setFocus(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HelpQuery(QWidget* parent);
|
HelpQuery(QWidget* parent);
|
||||||
|
@ -43,6 +48,3 @@ extern QHelpEngine* helpEngine;
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -177,11 +177,10 @@ QValidator::State MagValidator::validate(QString& input, int& /*pos*/) const
|
||||||
|
|
||||||
void MagBox::setMag(double val)
|
void MagBox::setMag(double val)
|
||||||
{
|
{
|
||||||
blockSignals(true);
|
const QSignalBlocker blocker(this);
|
||||||
setCurrentIndex(int(MagIdx::MAG_FREE));
|
setCurrentIndex(int(MagIdx::MAG_FREE));
|
||||||
freeMag = val;
|
freeMag = val;
|
||||||
setItemText(int(MagIdx::MAG_FREE), QString("%1%").arg(freeMag * 100));
|
setItemText(int(MagIdx::MAG_FREE), QString("%1%").arg(freeMag * 100));
|
||||||
blockSignals(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
@ -190,9 +189,8 @@ void MagBox::setMag(double val)
|
||||||
|
|
||||||
void MagBox::setMagIdx(MagIdx idx)
|
void MagBox::setMagIdx(MagIdx idx)
|
||||||
{
|
{
|
||||||
blockSignals(true);
|
const QSignalBlocker blocker(this);
|
||||||
setCurrentIndex(int(idx));
|
setCurrentIndex(int(idx));
|
||||||
blockSignals(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -892,6 +892,7 @@ MuseScore::MuseScore()
|
||||||
|
|
||||||
HelpQuery* hw = new HelpQuery(menuHelp);
|
HelpQuery* hw = new HelpQuery(menuHelp);
|
||||||
menuHelp->addAction(hw);
|
menuHelp->addAction(hw);
|
||||||
|
connect(menuHelp, SIGNAL(aboutToShow()), hw, SLOT(setFocus()));
|
||||||
|
|
||||||
menuHelp->addAction(getAction("local-help"));
|
menuHelp->addAction(getAction("local-help"));
|
||||||
menuHelp->addAction(tr("&Online Handbook"), this, SLOT(helpBrowser1()));
|
menuHelp->addAction(tr("&Online Handbook"), this, SLOT(helpBrowser1()));
|
||||||
|
|
|
@ -17,10 +17,11 @@ add_custom_target(referenceDocumentation
|
||||||
|
|
||||||
add_custom_command(TARGET referenceDocumentation
|
add_custom_command(TARGET referenceDocumentation
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND qcollectiongenerator ${PROJECT_SOURCE_DIR}/rdoc/en/doc.qhcp -o doc_en.qhc
|
COMMAND Qt5::qcollectiongenerator ${PROJECT_SOURCE_DIR}/rdoc/en/doc.qhcp -o doc_en.qhc
|
||||||
COMMAND qcollectiongenerator ${PROJECT_SOURCE_DIR}/rdoc/de/doc.qhcp -o doc_de.qhc
|
COMMAND Qt5::qcollectiongenerator ${PROJECT_SOURCE_DIR}/rdoc/de/doc.qhcp -o doc_de.qhc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
${PROJECT_BINARY_DIR}/rdoc/doc_en.qhc
|
${PROJECT_BINARY_DIR}/rdoc/doc_en.qhc
|
||||||
${PROJECT_BINARY_DIR}/rdoc/doc_de.qhc
|
${PROJECT_BINARY_DIR}/rdoc/doc_de.qhc
|
||||||
|
|
BIN
rdoc/de/doc.qch
BIN
rdoc/de/doc.qch
Binary file not shown.
|
@ -23,7 +23,6 @@
|
||||||
<keyword id="klops" ref="doc.html#foobar"/>
|
<keyword id="klops" ref="doc.html#foobar"/>
|
||||||
</keywords>
|
</keywords>
|
||||||
<files>
|
<files>
|
||||||
<file>../classic.css</file>
|
|
||||||
<file>doc.html</file>
|
<file>doc.html</file>
|
||||||
</files>
|
</files>
|
||||||
</filterSection>
|
</filterSection>
|
||||||
|
|
31
rdoc/doc.qhp
31
rdoc/doc.qhp
|
@ -1,31 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<QtHelpProject version="1.0">
|
|
||||||
<namespace>musescore.com.musescore.2.0</namespace>
|
|
||||||
<virtualFolder>doc</virtualFolder>
|
|
||||||
<customFilter name="MuseScore 2.0">
|
|
||||||
<filterAttribute>MuseScore</filterAttribute>
|
|
||||||
<filterAttribute>2.0</filterAttribute>
|
|
||||||
</customFilter>
|
|
||||||
<filterSection>
|
|
||||||
<filterAttribute>MuseScore</filterAttribute>
|
|
||||||
<filterAttribute>2.0</filterAttribute>
|
|
||||||
<toc>
|
|
||||||
<section title="My Application Manual" ref="index.html">
|
|
||||||
<section title="Chapter 1" ref="doc.html#chapter1"/>
|
|
||||||
<section title="Chapter 2" ref="doc.html#chapter2"/>
|
|
||||||
<section title="Chapter 3" ref="doc.html#chapter3"/>
|
|
||||||
</section>
|
|
||||||
</toc>
|
|
||||||
<keywords>
|
|
||||||
<keyword name="foo" id="MuseScore::foo" ref="doc.html#foo"/>
|
|
||||||
<keyword name="bar" ref="doc.html#bar"/>
|
|
||||||
<keyword id="MuseScore::foobar" ref="doc.html#foobar"/>
|
|
||||||
<keyword id="mops" ref="doc.html#foobar"/>
|
|
||||||
<keyword id="klops" ref="doc.html#foobar"/>
|
|
||||||
</keywords>
|
|
||||||
<files>
|
|
||||||
<file>classic.css</file>
|
|
||||||
<file>*.html</file>
|
|
||||||
</files>
|
|
||||||
</filterSection>
|
|
||||||
</QtHelpProject>
|
|
BIN
rdoc/en/doc.qch
BIN
rdoc/en/doc.qch
Binary file not shown.
|
@ -16,14 +16,13 @@
|
||||||
</section>
|
</section>
|
||||||
</toc>
|
</toc>
|
||||||
<keywords>
|
<keywords>
|
||||||
<keyword id="manual" ref="doc.html"/>
|
<keyword name="Manual" id="manual" ref="doc.html"/>
|
||||||
<keyword name="bar" ref="doc.html#bar"/>
|
<keyword name="bar" ref="doc.html#bar"/>
|
||||||
<keyword id="MuseScore::foobar" ref="doc.html#foobar"/>
|
<keyword id="MuseScore::foobar" ref="doc.html#foobar"/>
|
||||||
<keyword id="mops" ref="doc.html#foobar"/>
|
<keyword id="mops" ref="doc.html#foobar"/>
|
||||||
<keyword id="klops" ref="doc.html#foobar"/>
|
<keyword id="klops" ref="doc.html#foobar"/>
|
||||||
</keywords>
|
</keywords>
|
||||||
<files>
|
<files>
|
||||||
<file>../classic.css</file>
|
|
||||||
<file>doc.html</file>
|
<file>doc.html</file>
|
||||||
</files>
|
</files>
|
||||||
</filterSection>
|
</filterSection>
|
||||||
|
|
Loading…
Reference in a new issue