From 5eed9fba17110f5a0e36ff71458c9ebd96090b66 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 18 Nov 2016 20:16:54 +0100 Subject: gui/options-dialog: fix logic error in keybinding friendly name --- gui/options-dialog.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index 8cf67e6d..bafddb57 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -16,24 +16,19 @@ QString OptionsDialog::kopts_to_string(const key_opts& kopts) { - const QString str = kopts.keycode; - if (!str.isEmpty()) + if (static_cast(kopts.guid) != "") { - if (str.startsWith("Num+")) - return tr("Num+") + str.mid(4); - const int btn = kopts.button & ~Qt::KeyboardModifierMask; const int mods = kopts.button & Qt::KeyboardModifierMask; QString mm; - - if (mods & Qt::ControlModifier) mm += tr("Control+"); - if (mods & Qt::AltModifier) mm += tr("Alt+"); - if (mods & Qt::ShiftModifier) mm += tr("Shift+"); - + if (mods & Qt::ControlModifier) mm += "Control+"; + if (mods & Qt::AltModifier) mm += "Alt+"; + if (mods & Qt::ShiftModifier) mm += "Shift+"; return mm + tr("Joy button %1").arg(QString::number(btn)); } - else + if (static_cast(kopts.keycode) == "") return tr("None"); + return kopts.keycode; } void OptionsDialog::set_disable_translation_state(bool value) -- cgit v1.2.3