X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fkeysequencewidget.cpp;h=169a8f0a39a5d1b2f9ae5dc548b02af79edfd10c;hp=b37d98b2a3f8d24872c74f54580a3a3893f453cd;hb=5fdea974f0c3cc72715d968c0f616ba7e02677d6;hpb=1ee776b44047785839ac9657c371459750d9cfdd
diff --git a/src/qtui/settingspages/keysequencewidget.cpp b/src/qtui/settingspages/keysequencewidget.cpp
index b37d98b2..169a8f0a 100644
--- a/src/qtui/settingspages/keysequencewidget.cpp
+++ b/src/qtui/settingspages/keysequencewidget.cpp
@@ -240,27 +240,22 @@ bool KeySequenceWidget::isShiftAsModifierAllowed(int keyQt) const {
}
void KeySequenceWidget::updateShortcutDisplay() {
- // make translators happy
-#if defined(Q_WS_MAC)
- static QString metaKey = tr("Ctrl", "Ctrl key on Mac");
- static QString ctrlKey = tr("â", "Cmd key on Mac");
-#else
- static QString metaKey = tr("Meta", "Meta key");
- static QString ctrlKey = tr("Ctrl", "Ctrl key");
-#endif
- static QString altKey = tr("Alt", "Alt key");
- static QString shiftKey = tr("Shift", "Shift key");
-
QString s = _keySequence.toString(QKeySequence::NativeText);
s.replace('&', QLatin1String("&&"));
if(_isRecording) {
if(_modifierKeys) {
- if(_modifierKeys & Qt::META) s += metaKey + '+';
- if(_modifierKeys & Qt::CTRL) s += ctrlKey + '+';
- if(_modifierKeys & Qt::ALT) s += altKey + '+';
- if(_modifierKeys & Qt::SHIFT) s += shiftKey + '+';
-
+#ifdef Q_WS_MAC
+ if(_modifierKeys & Qt::META) s += QChar(kControlUnicode);
+ if(_modifierKeys & Qt::ALT) s += QChar(kOptionUnicode);
+ if(_modifierKeys & Qt::SHIFT) s += QChar(kShiftUnicode);
+ if(_modifierKeys & Qt::CTRL) s += QChar(kCommandUnicode);
+#else
+ if(_modifierKeys & Qt::META) s += tr("Meta", "Meta key") + '+';
+ if(_modifierKeys & Qt::CTRL) s += tr("Ctrl", "Ctrl key") + '+';
+ if(_modifierKeys & Qt::ALT) s += tr("Alt", "Alt key") + '+';
+ if(_modifierKeys & Qt::SHIFT) s += tr("Shift", "Shift key") + '+';
+#endif
} else {
s = tr("Input", "What the user inputs now will be taken as the new shortcut");
}
@@ -353,7 +348,7 @@ bool KeySequenceWidget::isKeySequenceAvailable(const QKeySequence &seq) {
if(!actIdx.data(ShortcutsModel::IsConfigurableRole).toBool()) {
QMessageBox::warning(this, tr("Shortcut Conflict"),
- tr("The \"%1\" shortcut is already in use, and cannot be configured.\nPlease choose another one.").arg(seq.toString()),
+ tr("The \"%1\" shortcut is already in use, and cannot be configured.\nPlease choose another one.").arg(seq.toString(QKeySequence::NativeText)),
QMessageBox::Ok);
return false;
}
@@ -362,7 +357,7 @@ bool KeySequenceWidget::isKeySequenceAvailable(const QKeySequence &seq) {
(tr("The \"%1\" shortcut is ambiguous with the shortcut for the following action:")
+ "