Skip to content

Commit

Permalink
fix #235406: standard keyboard shortcuts missing
Browse files Browse the repository at this point in the history
small changes

minor change

formatting fixes

all shortcuts are now displayed in prefs dialog

minor change

formatting fix

small change

changed length to size
  • Loading branch information
Aryaman Vinchhi authored and lasconic committed Aug 8, 2017
1 parent f46efb7 commit 99a9c65
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions mscore/shortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3539,6 +3539,17 @@ void Shortcut::setKeys(const QList<QKeySequence>& ks)
_action->setShortcuts(_keys);
}

//---------------------------------------------------------
// setStandardKey
//---------------------------------------------------------

void Shortcut::setStandardKey(QKeySequence::StandardKey k)
{
_standardKey = k;
if (_action && k != QKeySequence::UnknownKey)
_action->setShortcuts(_standardKey);
}

//---------------------------------------------------------
// descr
//---------------------------------------------------------
Expand Down Expand Up @@ -3669,6 +3680,14 @@ QString Shortcut::keysToString() const
s += "; ";
s += Shortcut::keySeqToString(_keys[i], QKeySequence::NativeText);
}
if (s.isEmpty() && _standardKey != QKeySequence::UnknownKey) {
QList<QKeySequence> keySeqList = QKeySequence::keyBindings(_standardKey);
for (int i = 0; i < keySeqList.size(); i++) {
if (i)
s += "; ";
s += Shortcut::keySeqToString(keySeqList[i], QKeySequence::NativeText);
}
}
return s;
}

Expand Down
2 changes: 1 addition & 1 deletion mscore/shortcut.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Shortcut {
Icons icon() const { return _icon; }
const QList<QKeySequence>& keys() const { return _keys; }
QKeySequence::StandardKey standardKey() const { return _standardKey; }
void setStandardKey(QKeySequence::StandardKey k) { _standardKey = k; }
void setStandardKey(QKeySequence::StandardKey k);
void setKeys(const QList<QKeySequence>& ks);

bool compareKeys(const Shortcut&) const;
Expand Down

0 comments on commit 99a9c65

Please sign in to comment.