Skip to content
Permalink
Browse files

Merge pull request #4463 from MarcSabatella/tours-2

add more tours
  • Loading branch information...
anatoly-os committed Dec 22, 2018
2 parents 67aee31 + 157745c commit 36e62465244c804660ab574627f168adace12f93
@@ -17,6 +17,7 @@
#include "libmscore/utils.h"
#include "libmscore/undo.h"
#include "libmscore/part.h"
#include "tourhandler.h"

namespace Ms {

@@ -44,6 +45,8 @@ void ScoreView::doDragElement(QMouseEvent* ev)
{
QPointF delta = toLogical(ev->pos()) - editData.startMove;

TourHandler::startTour("autoplace-tour");

QPointF pt(delta);
if (qApp->keyboardModifiers() == Qt::ShiftModifier)
pt.setX(editData.element->offset().x());
@@ -16,6 +16,7 @@
#include "seq.h"
#include "texttools.h"
#include "fotomode.h"
#include "tourhandler.h"
#include "libmscore/score.h"
#include "libmscore/keysig.h"
#include "libmscore/segment.h"
@@ -330,6 +331,7 @@ void ScoreView::mousePressEventNormal(QMouseEvent* ev)
r.translate(0.0, -m->spatium());
}
if (r.contains(editData.startMove)) {
//TourHandler::startTour("select-tour");
_score->select(m, st, staffIdx);
_score->setUpdateAll();
clickOffElement = false;
@@ -25,6 +25,7 @@
#include "fontStyleSelect.h"
#include "scoreview.h"
#include "resetButton.h"
#include "tourhandler.h"

namespace Ms {

@@ -35,9 +36,10 @@ namespace Ms {
InspectorBase::InspectorBase(QWidget* parent)
: QWidget(parent)
{
setObjectName("inspector");
setObjectName("InspectorBase");
setAccessibleName(tr("Inspector"));
inspector = static_cast<Inspector*>(parent);
setParent(parent);
_layout = new QVBoxLayout(this);
_layout->setSpacing(0);
_layout->setContentsMargins(0, 10, 0, 0);
@@ -387,6 +389,11 @@ void InspectorBase::valueChanged(int idx, bool reset)
Element* iElement = inspector->element();
Score* score = iElement->score();

if (ii.t == Pid::AUTOPLACE)
TourHandler::startTour("autoplace-tour");
else
TourHandler::startTour("inspector-tour");

score->startCmd();
for (Element* e : *inspector->el()) {
for (int i = 0; i < ii.parent; ++i)
@@ -52,16 +52,19 @@ InspectorGroupElement::InspectorGroupElement(QWidget* parent)
notes = new QToolButton(this);
notes->setText(tr("Notes"));
notes->setEnabled(true);
notes->setObjectName("notes");
hbox->addWidget(notes);

graceNotes = new QToolButton(this);
graceNotes->setText(tr("Grace Notes"));
graceNotes->setEnabled(true);
graceNotes->setObjectName("graceNotes");
hbox->addWidget(graceNotes);

rests = new QToolButton(this);
rests->setText(tr("Rests"));
rests->setEnabled(true);
rests->setObjectName("rests");
hbox->addWidget(rests);

_layout->addLayout(hbox);
@@ -114,6 +114,7 @@ void ViewRect::paintEvent(QPaintEvent* ev)
Navigator::Navigator(NScrollArea* sa, QWidget* parent)
: QWidget(parent)
{
setObjectName("Navigator");
setAttribute(Qt::WA_NoBackground);
_score = 0;
scrollArea = sa;
@@ -2517,6 +2517,8 @@ void ScoreView::dragScoreView(QMouseEvent* ev)

constraintCanvas(&dx, &dy);

TourHandler::startTour("navigate-tour");

_matrix.setMatrix(_matrix.m11(), _matrix.m12(), _matrix.m13(), _matrix.m21(),
_matrix.m22(), _matrix.m23(), _matrix.dx()+dx, _matrix.dy()+dy, _matrix.m33());
imatrix = _matrix.inverted();
@@ -2537,6 +2539,7 @@ void ScoreView::dragScoreView(QMouseEvent* ev)

void ScoreView::doDragLasso(QMouseEvent* ev)
{
TourHandler::startTour("select-tour");
QPointF p = toLogical(ev->pos());
_score->addRefresh(lasso->canvasBoundingRect());
QRectF r;
@@ -433,9 +433,10 @@ void TourHandler::displayTour(Tour* tour)
mbox->setWindowTitle(tr("Tour"));
QPushButton* backButton = nullptr;
QPushButton* nextButton = nullptr;
QPushButton* closeButton = nullptr;

//QMessageBox doesn't support next/back semantic for various OS styles. QWizard does.
mbox->addButton(tr("Close"), QMessageBox::RejectRole);
closeButton = mbox->addButton(tr("Close"), QMessageBox::RejectRole);
if (i != 0)
backButton = mbox->addButton(tr("Back"), QMessageBox::NoRole); //Explicit text is bad since it varies depending on the OS. MacOS uses "Go back"
if (i != tourMessages.size() - 1)
@@ -448,6 +449,7 @@ void TourHandler::displayTour(Tour* tour)
mbox->setDefaultButton(nextButton);
else
mbox->setDefaultButton(backButton);
mbox->setEscapeButton(closeButton);

// Add text (translation?)
mbox->setText(tourMessages[i].message);
@@ -18,9 +18,13 @@
#=============================================================================

install(FILES
autoplace.tour
inspector.tour
mmrest.tour
navigate.tour
noteinput.tour
palette.tour
select.tour
timeline.tour
welcome.tour
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}tours
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<Tour name="autoplace-tour">
<Event objectName="autoplace">MouseButtonRelease</Event>
<Message>
<Text>Autoplace is a new feature that automatically detects and avoids many types of collisions between elements.
You can also manually adjust the position of autoplaced elements, or disable autoplace for selected elements.
Click "Next" to learn more.</Text>
</Message>
<Message>
<Text>Autoplace positions most elements according to standard music engraving practice,
such as by moving tempo markings above other text or by shortening hairpins to avoid dynamics.
In many cases, this means that no further adjustments will be required at all.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>If necessary, you can fine-tune the position of elements by dragging, by using the cursor keys while in Edit mode (double-click),
or by using the "Offset" fields in the Inspector.
This allows you to make adjustments while leaving autoplace enabled to continue avoiding collisions.</Text>
<Widget>scoreview</Widget>
<Widget>offsetLabel</Widget>
<Widget>offset</Widget>
<Widget>resetOffset</Widget>
</Message>
<Message>
<Text>For larger adjustments, it may be more convenient to disable autoplace for selected elements using the Inspector.
This will remove them from collision detection and allow you to place them more freely.</Text>
<Widget>autoplace</Widget>
<Widget>resetAutoplace</Widget>
</Message>
</Tour>
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<Tour name="inspector-tour">
<Event objectName="inspector">MouseButtonRelease</Event>
<Event objectName="inspector">FocusIn</Event>
<Event objectName="InspectorBase">MouseButtonRelease</Event>
<Event objectName="InspectorBase">FocusIn</Event>
<Message>
<Text>Welcome to the Inspector, where you can change individual properties for selected elements.
Click "Next" to learn more.</Text>
<Widget>inspector</Widget>
</Message>
<Message>
<Text>Begin by selecting one or more elements in your score, then use the check boxes, spin boxes, dropdown menus, and other controls to change values for the various properties.
The set of properties available will differ according to the type of selected elements or elements.</Text>
<Widget>inspector</Widget>
</Message>
<Message>
<Text>If you have selected elements of different types, only a few settings common to all elements will be available.
You can click the "Notes" and other buttons at the bottom of the Inspector to limit the selection to just the elements of the specified type.</Text>
<Widget>InspectorElement</Widget>
<Widget>InspectorGroupElement</Widget>
<Widget>notes</Widget>
<Widget>graceNotes</Widget>
<Widget>rests</Widget>
</Message>
<Message>
<Text>If you have modified a value, you can click the "Reset" button to reset it to the default.
If the value is controlled by a style setting, you can click the "Set as style" button to set the current value as the new default for the style.
You can also set style defaults using Format / Style.</Text>
<Widget>offsetLabel</Widget>
<Widget>offset</Widget>
<Widget>resetOffset</Widget>
</Message>
</Tour>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<Tour name="navigate-tour">
<Shortcut>page-top</Shortcut>
<Shortcut>page-end</Shortcut>
<Shortcut>page-prev</Shortcut>
<Shortcut>page-next</Shortcut>
<Shortcut>toggle-navigator</Shortcut>
<Message>
<Text>MuseScore provides many ways to navigate through your score.
Click "Next" to learn more.</Text>
</Message>
<Message>
<Text>The quickest way to scroll up and down is to use your mouse wheel or equivalent touch gesture (for example, two-finger swipe).
To scroll horizontally, hold Shift while using the mouse wheel or touch gesture.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>The navigation keys on your keyboard such as PgUp, PgDn, Home, and End function as in other applications
to move between pages.
Keyboards that lack these keys often provide equivalents such as Fn+Up/Down/Left/Right.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>You can move the score short distances by clicking an empty area of the page and dragging.
By the way, you can also select regions by holding Shift while dragging.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>Additional navigation tools include the Timeline and Navigator, both found in the View menu.</Text>
<Widget>Timeline</Widget>
<Widget>Navigator</Widget>
</Message>
</Tour>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<Tour name="select-tour">
<Shortcut>select-all</Shortcut>
<Shortcut>select-section</Shortcut>
<Shortcut>toggle-selection-window</Shortcut>
<Message>
<Text>MuseScore supports different types of selections: single, list, and range.
Click "Next" to learn more.</Text>
</Message>
<Message>
<Text>To make a single selection, click the element you want to select.
It becomes highlighted to indicate that it is selected.
You can use the left and right cursor keys to move the selection through the notes and rests of your score.
Tip: if you press the Alt key (Option on macOS) along with the cursor keys you can move through other elements too,
and also move up and down from staff to staff.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>A list selection is a combination of single selections.
Press Ctrl (macOS: Cmd) while clicking to add or remove elements to the list selection.
You can also quickly select similar elements by right-clicking (macOS: Ctrl+clicking) one
and then choosing one of the "Select" options from the resulting popup menu.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>A range selection includes everything from one point in time to another across one or more staves.
It is indicated by a blue rectangle encompassing the entire range.
To make a range selection, click the first note, rest, or measure you want to select, then Shift+click the last.
You can also extend range selections by holding the Shift key while moving the cursor.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>Another way to make selections is to hold Shift while dragging.
If your selection includes notes, it will automatically be made as a range selection;
otherwise it will be made as a list selection.</Text>
<Widget>scoreview</Widget>
</Message>
<Message>
<Text>Finally, the Selection Filter (found in the View menu) allows you to exclude elements of a given type from a range selection.</Text>
<Widget>SelectionWindow</Widget>
</Message>
</Tour>
@@ -1,16 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<Tour name="timeline-tour">
<Message>
<Text>Welcome to the Timeline, where you can view a reduction of the score for easier navigation.
<Text>Welcome to the Timeline, where you can view a high-level reduction of the score for easier navigation.
Click "Next" to learn more.</Text>
<Widget>Timeline</Widget>
</Message>
<Message>
<Text>Each box represents a measure of a specific instrument.
If it is highlighted, then there are notes in that measure.
The timeline also shows rehearsal marks, changes of tempo, key, or time signature, and other points of interest.
Boxes within the thin blue outline represent measures that are currently in view.
<Text>The timeline shows rehearsal marks, changes of tempo, key, and time signature, and other points of interest.
You can click anywhere to jump to the corresponding location in your score.</Text>
<Widget>Timeline</Widget>
</Message>
<Message>
<Text>The section below contains a row for each instrument.
Each box within the row represents a measure for that instrument.
If the box is highlighted, then there are notes in that measure.
Boxes with a thin blue outline represent measures that are currently in view.</Text>
<Widget>Timeline</Widget>
</Message>
</Tour>
@@ -37,7 +37,7 @@
<Widget>palette-box</Widget>
</Message>
<Message>
<Text>The Inspector allows you to control various details of the elements in your score.</Text>
<Text>The Inspector allows you to control various properties of the elements in your score.</Text>
<Widget>inspector</Widget>
</Message>
<Message>
@@ -50,6 +50,6 @@
<Text>That's the end of this tour!
As you use MuseScore, more tours will pop up to further explain functionality.
To disable these, deselect "Continue showing tours" before closing this window.
You can also enable/disable tours in Help / Tours.</Text>
You can also enable/disable and reset tours in Help / Tours.</Text>
</Message>
</Tour>

0 comments on commit 36e6246

Please sign in to comment.
You can’t perform that action at this time.