Add feedback buttons to the panel

This commit is contained in:
Dmitri Ovodok 2018-10-16 18:14:54 +03:00
parent 59594beec6
commit bec72225dd
8 changed files with 109 additions and 6 deletions

View file

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 164 174" width="164" height="174"><defs><clipPath id="_clipPath_Q7c3oMLQWnGE9HCOy5RrvRCmMH0Z2mWx"><rect width="164" height="174"/></clipPath></defs><g clip-path="url(#_clipPath_Q7c3oMLQWnGE9HCOy5RrvRCmMH0Z2mWx)"><path d=" M 82 0.851 C 66.408 0.851 53.509 12.351 51.329 27.351 L 112.671 27.351 C 110.49 12.351 97.592 0.851 82 0.851 Z " fill="rgb(59,63,69)"/><path d=" M 59 34.004 L 39.049 34.004 L 26.756 13.425 C 25.445 11.232 23.123 10.004 20.741 10.004 C 19.519 10.004 18.282 10.324 17.157 10.997 C 13.839 12.98 12.756 17.29 14.74 20.608 L 31.107 48.004 L 41.985 48.004 C 30.602 57.73 22.614 71.459 20.545 87.004 L 5 87.004 C 2.239 87.004 0 89.242 0 92.004 L 0 95.004 C 0 97.766 2.239 100.004 5 100.004 L 20.223 100.004 C 21.359 113.764 27.126 126.248 35.849 136.004 L 31.107 136.004 L 14.739 163.389 C 12.755 166.707 13.838 171.005 17.156 172.989 C 18.281 173.662 19.519 173.981 20.74 173.981 C 23.122 173.981 25.445 172.765 26.755 170.572 L 39.049 150.004 L 53.81 150.004 C 60.931 153.728 68.786 156.11 76.999 156.785 L 76.999 150.004 L 76.999 136.004 L 76.999 100.004 L 76.999 87.004 L 76.999 48.004 L 76.999 34.004 L 71.126 34.004 L 59 34.004 Z " fill="rgb(59,63,69)"/><path d=" M 159 87 L 143.475 87 C 141.477 71.455 133.744 57.726 122.438 48 L 133.328 48 L 149.709 21.451 C 151.74 18.161 150.72 13.843 147.43 11.812 C 144.139 9.782 139.826 10.812 137.797 14.101 L 125.517 34 L 95 34 L 93.041 34 L 87 34 L 87 48 L 87 87 L 87 100 L 87 136 L 87 150 L 87 156.781 C 95.479 156.106 103.457 153.723 110.618 150 L 125.516 150 L 137.795 169.891 C 139.824 173.18 144.137 174.201 147.428 172.17 C 150.718 170.14 151.739 165.826 149.707 162.537 L 133.327 136 L 128.513 136 C 137.121 126.244 142.691 113.76 143.786 100 L 159 100 C 161.762 100 164 97.762 164 95 L 164 92 C 164 89.238 161.762 87 159 87 Z " fill="rgb(59,63,69)"/></g></svg>

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 60 60" width="60" height="60"><defs><clipPath id="_clipPath_Jh13zPQGeublarQxBMLzSn7xLzGXUOL4"><rect width="60" height="60"/></clipPath></defs><g clip-path="url(#_clipPath_Jh13zPQGeublarQxBMLzSn7xLzGXUOL4)"><rect x="0" y="0" width="60" height="60" transform="matrix(1,0,0,1,0,0)" fill="none"/><path d=" M 30 34.524 L 55.843 11 L 4.157 11 L 30 34.524 L 30 34.524 Z M 23.02 31.92 L 30 37.937 L 36.871 31.92 L 55.843 49 L 4.157 49 L 23.02 31.92 L 23.02 31.92 Z M 2.434 47.19 L 2.434 12.81 L 21.386 30 L 2.434 47.19 L 2.434 47.19 Z M 57.566 47.19 L 57.566 12.81 L 38.614 30 L 57.566 47.19 L 57.566 47.19 Z " fill-rule="evenodd" fill="rgb(59,63,69)"/></g></svg>

After

Width:  |  Height:  |  Size: 846 B

View file

@ -155,7 +155,9 @@ static const char* iconNames[] = {
"edit-reset.svg",
"window-close.svg",
"arrow_up.svg",
"arrow_down.svg"
"arrow_down.svg",
"mail.svg",
"bug.svg"
};
//---------------------------------------------------------

View file

@ -57,6 +57,7 @@ enum class Icons : signed char { Invalid_ICON = -1,
timesig_prolatio03_ICON, timesig_prolatio04_ICON, timesig_prolatio05_ICON, timesig_prolatio07_ICON,
timesig_prolatio08_ICON, timesig_prolatio10_ICON, timesig_prolatio11_ICON, edit_ICON, reset_ICON, close_ICON,
arrowUp_ICON, arrowDown_ICON,
mail_ICON, bug_ICON,
voice1_ICON, voice2_ICON, voice3_ICON, voice4_ICON,
ICONS
};

View file

@ -1202,6 +1202,26 @@ MuseScore::MuseScore()
populateNoteInputMenu();
//-------------------------------
// Feedback Tool Bar
//-------------------------------
feedbackTools = new QToolBar("", this);
feedbackTools->setObjectName("feedback-tools");
// Add the toolbar to the bottom and forbid to move it...
feedbackTools->setMovable(false);
feedbackTools->setFloatable(false);
addToolBar(Qt::BottomToolBarArea, feedbackTools);
// Add a spacer to align the buttons to the right side.
QWidget* spacer = new QWidget(feedbackTools);
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
feedbackTools->addWidget(spacer);
// And, finally, add the buttons themselves.
feedbackTools->addWidget(new AccessibleToolButton(feedbackTools, getAction("report-bug")));
AccessibleToolButton* feedbackButton = new AccessibleToolButton(feedbackTools, getAction("leave-feedback"));
feedbackButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
feedbackTools->addWidget(feedbackButton);
//---------------------
// Menus
//---------------------
@ -1386,6 +1406,12 @@ MuseScore::MuseScore()
connect(entryTools, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool)));
menuToolbars->addAction(a);
a = getAction("toggle-feedback");
a->setCheckable(true);
a->setChecked(feedbackTools->isVisible());
connect(feedbackTools, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool)));
menuToolbars->addAction(a);
menuToolbars->addSeparator();
menuToolbars->addAction(getAction("edit-toolbars"));
@ -1683,7 +1709,8 @@ MuseScore::MuseScore()
#endif
menuHelp->addSeparator();
askForHelpAction = menuHelp->addAction("", this, SLOT(askForHelp()));
reportBugAction = menuHelp->addAction("", this, SLOT(reportBug()));
reportBugAction = menuHelp->addAction("", this, [this]{ reportBug("menu"); });
leaveFeedbackAction = menuHelp->addAction("", this, [this]{ leaveFeedback("menu"); });
menuHelp->addSeparator();
menuHelp->addAction(getAction("resource-manager"));
@ -1787,6 +1814,7 @@ void MuseScore::retranslate(bool firstStart)
checkForUpdateAction->setText(tr("Check for &Update"));
askForHelpAction->setText(tr("Ask for Help"));
reportBugAction->setText(tr("Report a Bug"));
leaveFeedbackAction->setText(tr("Leave feedback"));
revertToFactoryAction->setText(tr("Revert to Factory Settings"));
fileTools->setWindowTitle(tr("File Operations"));
@ -1794,6 +1822,7 @@ void MuseScore::retranslate(bool firstStart)
cpitchTools->setWindowTitle(tr("Concert Pitch"));
fotoTools->setWindowTitle(tr("Image Capture"));
entryTools->setWindowTitle(tr("Note Input"));
feedbackTools->setWindowTitle(tr("Feedback"));
viewModeCombo->setAccessibleName(tr("View Mode"));
viewModeCombo->setItemText(viewModeCombo->findData(int(LayoutMode::PAGE)), tr("Page View"));
@ -1885,7 +1914,8 @@ void MuseScore::helpBrowser1() const
}
//track visits. see: http://www.google.com/support/googleanalytics/bin/answer.py?answer=55578
help += QString("&utm_source=desktop&utm_medium=menu&utm_content=%1&utm_campaign=MuseScore%2").arg(rev.trimmed()).arg(QString(VERSION));
help += '&';
help += getUtmParameters("menu");
QDesktopServices::openUrl(QUrl(help));
}
@ -3984,9 +4014,12 @@ void MuseScore::play(Element* e, int pitch) const
// reportBug
//---------------------------------------------------------
void MuseScore::reportBug()
void MuseScore::reportBug(QString medium)
{
QString url = QString("https://musescore.org/redirect/post/bug-report?sha=%1&locale=%2").arg(revision()).arg(getLocaleISOCode());
QString url = QString("https://musescore.org/redirect/post/bug-report?sha=%1&locale=%2&%3")
.arg(revision())
.arg(getLocaleISOCode())
.arg(getUtmParameters(medium));
QDesktopServices::openUrl(QUrl(url.trimmed()));
}
@ -4000,6 +4033,31 @@ void MuseScore::askForHelp()
QDesktopServices::openUrl(QUrl(url.trimmed()));
}
//---------------------------------------------------------
// leaveFeedback
//---------------------------------------------------------
void MuseScore::leaveFeedback(QString medium)
{
QString url = QString("https://musescore.com/content/editor-feedback?%1")
.arg(getUtmParameters(medium));
QDesktopServices::openUrl(QUrl(url.trimmed()));
}
//---------------------------------------------------------
// getUtmParameters
// Get UTM labels to track visits.
// See: https://www.google.com/support/googleanalytics/bin/answer.py?answer=55578
//---------------------------------------------------------
QString MuseScore::getUtmParameters(QString medium) const
{
return QString("utm_source=desktop&utm_medium=%1&utm_content=%2&utm_campaign=MuseScore%3")
.arg(medium)
.arg(rev.trimmed())
.arg(QString(VERSION));
}
//---------------------------------------------------------
// about
//---------------------------------------------------------
@ -5423,6 +5481,8 @@ void MuseScore::cmd(QAction* a, const QString& cmd)
fotoTools->setVisible(!fotoTools->isVisible());
else if (cmd == "toggle-noteinput")
entryTools->setVisible(!entryTools->isVisible());
else if (cmd == "toggle-feedback")
feedbackTools->setVisible(!feedbackTools->isVisible());
else if (cmd == "help")
showContextHelp();
else if (cmd == "follow")
@ -5566,6 +5626,10 @@ void MuseScore::cmd(QAction* a, const QString& cmd)
switchLayoutMode(LayoutMode::PAGE);
}
}
else if (cmd == "report-bug")
reportBug("panel");
else if (cmd == "leave-feedback")
leaveFeedback("panel");
#ifndef NDEBUG
else if (cmd == "no-horizontal-stretch") {
MScore::noHorizontalStretch = a->isChecked();

View file

@ -258,6 +258,7 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
QAction* checkForUpdateAction { 0 };
QAction* askForHelpAction;
QAction* reportBugAction;
QAction* leaveFeedbackAction;
QAction* revertToFactoryAction;
QProgressBar* _progressBar { 0 };
@ -267,6 +268,7 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
QToolBar* fileTools;
QToolBar* transportTools;
QToolBar* entryTools;
QToolBar* feedbackTools;
TextTools* _textTools { 0 };
PianoTools* _pianoTools { 0 };
MediaDialog* _mediaDialog { 0 };
@ -464,6 +466,8 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
void switchLayoutMode(LayoutMode);
void setPlayRepeats(bool repeat);
QString getUtmParameters(QString medium) const;
private slots:
void cmd(QAction* a, const QString& cmd);
void autoSaveTimerTimeout();
@ -472,8 +476,9 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
void about();
void aboutQt();
void aboutMusicXML();
void reportBug();
void reportBug(QString medium);
void askForHelp();
void leaveFeedback(QString medium);
void openRecentMenu();
void selectScore(QAction*);
void startPreferenceDialog();

View file

@ -162,5 +162,7 @@
<file>data/icons/clef-bass.svg</file>
<file>data/solid_note_head.dat</file>
<file>data/icons/edit-swap.svg</file>
<file>data/icons/mail.svg</file>
<file>data/icons/bug.svg</file>
</qresource>
</RCC>

View file

@ -1879,6 +1879,13 @@ Shortcut Shortcut::_sc[] = {
QT_TRANSLATE_NOOP("action","Note Input"),
QT_TRANSLATE_NOOP("action","Toggle 'Note Input' toolbar")
},
{
MsWidget::MAIN_WINDOW,
STATE_NORMAL | STATE_NOTE_ENTRY | STATE_EDIT ,
"toggle-feedback",
QT_TRANSLATE_NOOP("action","Feedback"),
QT_TRANSLATE_NOOP("action","Toggle 'Feedback' toolbar"),
},
{
MsWidget::MAIN_WINDOW,
STATE_NORMAL | STATE_NOTE_ENTRY | STATE_EDIT ,
@ -3528,6 +3535,26 @@ Shortcut Shortcut::_sc[] = {
Icons::Invalid_ICON,
Qt::ApplicationShortcut
},
{
MsWidget::MAIN_WINDOW,
STATE_ALL,
"report-bug",
QT_TRANSLATE_NOOP("action", "Report a Bug"),
QT_TRANSLATE_NOOP("action", "Report a bug"),
0,
Icons::bug_ICON,
Qt::ApplicationShortcut
},
{
MsWidget::MAIN_WINDOW,
STATE_ALL,
"leave-feedback",
QT_TRANSLATE_NOOP("action", "Leave Feedback"),
QT_TRANSLATE_NOOP("action", "Leave feedback"),
0,
Icons::mail_ICON,
Qt::ApplicationShortcut
},
#ifndef NDEBUG
{
MsWidget::MAIN_WINDOW,