New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #289190 - Toolbar customization refinements & fixes #5019
Fix #289190 - Toolbar customization refinements & fixes #5019
Conversation
mscore/musescore.cpp
Outdated
|
||
viewModeCombo = new QComboBox(this); | ||
for (auto s : _fileOperationEntries) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong indentation, we use 6 spaces per level, here it is 8
mscore/musescore.cpp
Outdated
|
||
// view-options is treated as a special case as it's not a QToolButton | ||
// but, rather, made up of two QComboBox objects (one sub-classed). | ||
void MuseScore::addViewOptionsDoubleWidget() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here it is 4
mscore/musescore.h
Outdated
@@ -882,6 +883,7 @@ MasterSynthesizer* synthesizerFactory(); | |||
Driver* driverFactory(Seq*, QString driver); | |||
|
|||
extern QAction* getAction(const char*); | |||
extern QString getShortcutText(const char*); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong indent again
mscore/shortcut.cpp
Outdated
QT_TRANSLATE_NOOP("action","View Options"), | ||
0, | ||
0, | ||
Icons::viewOptions_ICON, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different indeting here, but one space too much ;-)
mscore/shortcut.cpp
Outdated
|
||
QString getShortcutText(const char* id) | ||
{ | ||
Shortcut* shortcut = Shortcut::getShortcut(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 spaces here please
mscore/toolbarEditor.ui
Outdated
<item row="1" column="0" rowspan="2" colspan="2"> | ||
<widget class="QListWidget" name="toolbarList"> | ||
<property name="toolTip"> | ||
<string>Toolbar to customise</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
customize
please, US spelling. And I promise to translate it to customise
for the Brits ;-)
mscore/musescore.cpp
Outdated
} | ||
else | ||
fileTools->addWidget(new AccessibleToolButton(fileTools, getAction(s))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indent (we use banner style, braces indented)
mscore/musescore.cpp
Outdated
bool leftToRightLayout = qApp->layoutDirection() == Qt::LayoutDirection::LeftToRight; | ||
|
||
if (!leftToRightLayout) | ||
_fileOperationEntries.reverse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 spaces here
mscore/musescore.cpp
Outdated
} | ||
|
||
if (!leftToRightLayout) | ||
_fileOperationEntries.reverse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
mscore/musescore.cpp
Outdated
mag = new MagBox; | ||
connect(mag, SIGNAL(magChanged(MagIdx)), SLOT(magChanged(MagIdx))); | ||
fileTools->addWidget(mag); | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no spaces here
mscore/musescore.cpp
Outdated
viewModeCombo = new QComboBox(this); | ||
#if defined(Q_OS_MAC) | ||
viewModeCombo->setFocusPolicy(Qt::StrongFocus); | ||
#else | ||
viewModeCombo->setFocusPolicy(Qt::TabFocus); | ||
#endif | ||
viewModeCombo->setFixedHeight(preferences.getInt(PREF_UI_THEME_ICONHEIGHT) + 8); // hack | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nor here
mscore/musescore.cpp
Outdated
viewModeCombo->setAccessibleName(tr("View Mode")); | ||
viewModeCombo->addItem(tr("Page View"), int(LayoutMode::PAGE)); | ||
viewModeCombo->addItem(tr("Continuous View"), int(LayoutMode::LINE)); | ||
viewModeCombo->addItem(tr("Single Page"), int(LayoutMode::SYSTEM)); | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nor here
mscore/musescore.cpp
Outdated
|
||
//--------------------------------------------------------- | ||
// populatePlaybackControls | ||
//--------------------------------------------------------- | ||
|
||
void MuseScore::populatePlaybackControls() | ||
{ | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either no spaces (for methods/functions) or 6
mscore/musescore.cpp
Outdated
if (!*s) | ||
transportTools->addSeparator(); | ||
if (!*s) { | ||
transportTools->addSeparator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent... here and below
mscore/toolbarEditor.cpp
Outdated
editToolbars = new ToolbarEditor(this); | ||
} | ||
editToolbars = new ToolbarEditor(this); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
banner style indent. Or no braces here at all for a single statement
mscore/toolbarEditor.cpp
Outdated
@@ -111,49 +117,63 @@ void ToolbarEditor::accepted() | |||
//--------------------------------------------------------- | |||
|
|||
void ToolbarEditor::populateLists(const std::list<const char*>& all, std::list<const char*>* current) | |||
{ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no or 6 spaces...
mscore/toolbarEditor.cpp
Outdated
actionList->clear(); | ||
for (auto currentId : *current) { | ||
QString shortcutText = getShortcutText(currentId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent... here and below
mscore/toolbarEditor.cpp
Outdated
actionList->addItem(item); | ||
|
||
for (auto id : all) { | ||
bool found = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
mscore/toolbarEditor.cpp
Outdated
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excess white space
mscore/workspace.cpp
Outdated
@@ -169,17 +169,20 @@ void MuseScore::changeWorkspace(QAction* a) | |||
//--------------------------------------------------------- | |||
|
|||
void MuseScore::changeWorkspace(Workspace* p, bool first) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent...
mscore/workspace.cpp
Outdated
Workspace::currentWorkspace->save(); | ||
|
||
Workspace::currentWorkspace->save(); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces for nothing
mscore/workspace.cpp
Outdated
updateIcons(); | ||
preferencesChanged(true); | ||
} | ||
updateIcons(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent...
Please check out coding style guide, reg. indenting, see https://musescore.org/en/handbook/developers-handbook/finding-your-way-around/musescore-coding-rules#Indentation-%26-whitespaces Reg. language see https://musescore.org/en/handbook/developers-handbook/text-style-guide#Language Also please squash the commits |
Please don't squash :) It will be useful during the review process of such non trivial changes |
3e77744
to
e4602ee
Compare
@Jojo-Schmitz I very much hope I've caught all the indenting errors now. I've squashed. Thanks for the help and apologies for using up your time on those kinds of error. |
mscore/shortcut.cpp
Outdated
STATE_NORMAL, | ||
"view-options", | ||
QT_TRANSLATE_NOOP("action","View Options"), | ||
0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change that 0,
into QT_TRANSLATE_NOOP("action","View options"),
, needed for the shortcuts dialog (and as a tooltip) and there in sentence case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment got me thinking. The zoom box and view mode box don't really belong in the shortcuts list at all. There are already shortcuts for various zoom and page mode actions. So I've slightly changed tack. (See below.)
e4602ee
to
4f1e9c7
Compare
@Jojo-Schmitz 's comment about shortcuts (above) made me realise that it doesn't make sense to use shortcuts to represent the zoom and view mode combo boxes. There are already shortcut actions related to what the dropdown boxes do. This slightly reduces scope of changes and avoids the need for a new icon. Also added option to customise the zoom box and the view mode independently and fixed some spacing issues related to those toolbar items. |
mscore/toolbarEditor.cpp
Outdated
return new QListWidgetItem(action->icon(), itemName); | ||
} | ||
|
||
qDebug()<<"ToolbarEditor does not recognize id for toolbar item: "<<QString(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it OK to leave the qDebug() in or is it better to do something with ASSERT (the syntax of which I'd need to look up :)). This should never be sprung, but it's pretty benign if it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC qDebug()s vanish when build in RELEASE mode
Now Travis CI's mtests fail, check https://travis-ci.org/musescore/MuseScore/jobs/535052660#L4293-L4321 |
mscore/musescore.cpp
Outdated
@@ -4140,7 +4140,10 @@ void MuseScore::changeState(ScoreState val) | |||
if (getAction("split-measure")->isEnabled()) | |||
getAction("split-measure")->setEnabled(cs && cs->masterScore()->excerpts().size() == 0); | |||
|
|||
getAction("edit-toolbars")->setEnabled(!Workspace::currentWorkspace->readOnly()); | |||
Workspace* currentWorkspace = Workspace::currentWorkspace; | |||
if (currentWorkspace) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running tst_runscripts test the currentWorkspace returns nullptr and MuseScore crashes before it even gets to run any of the tests. I've put in an explicit check to avoid this. It now passes 43/44 tests, which is exactly what master is currently passing. Is currentWorkspace unexpectedly being null because the tests are running MuseScore in "headless" mode (if that's the right terminology)? Might this be an issue elsewhere?
3e43eb7
to
0fc921d
Compare
rebase needed |
0fc921d
to
c2db354
Compare
Another rebase needed |
Is this another one for the design department and @Tantacrul to consider? |
c2db354
to
22d5834
Compare
Code style issues. The Travis fails seems to be unrelated to this PR |
- make ToolbarEditor dialog show the proper names for customisable actions / item as previously it was showing the internal tags/ids - allow for the view mode & page zoom dropdowns to be customised like all other toolbar items - re-ordered the available and chosen lists in the dialogue box to make more sense - most specific is now at the right and not in the middle - Customize Toolbars menu is greyed out / disabled when toolbars are not customisable, i.e. because we're in advanced or basic mode or because although workspace is editable the toolbars are not - available actions now maintain STANDARD order when items are removed from the current toolbar - improved the spacing of view mode and page zoom dropdowns on the toolbar
22d5834
to
abf514e
Compare
Code style fixed (via uncrustify - thanks :) ). Not sure i can do anything wrt TRAVIS fail. |
No idea what to do about Travis, https://travis-ci.org/github/musescore/MuseScore/jobs/722473721#L484-L653 |
Automatically archived due to long inactivity. Could be re-opened later once an author will come back |
made dialogue show the proper names for customisable actions / item
previously it was showing the internal tags/ids (which won't translate)
allow for the view mode / view zoom to be customised like other items
fixed title of dialogue box
removed text box showing workspace name from dialogue box - it's an
edit box showing information that can never be edited - unhelpful UI
added name of workspace being edited to the dialogue box title
re-ordered the available and chosen lists in the dialogue box to make
more sense - most specific is at the right and not in the middle
added tooltips to various items in dialogue box
menu is greyed out / disabled when toolbars are not customisable,
i.e. because we're in advanced or basic mode
available actions now maintain STANDARD order when items are removed
from the current toolbar