]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiKeySymbol.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiKeySymbol.cpp
index d058bce50e4050e8ca7e99755295b76a8ecc62c1..6f496ecea119cd068f389d6cf79a1df1af224e28 100644 (file)
@@ -612,7 +612,7 @@ static char encode(string const & encoding, QString const & str)
 #endif
 
 
-void setKeySymbol(KeySymbol * sym, QKeyEvent * ev)
+void setKeySymbol(KeySymbol * sym, QKeyEvent const * ev)
 {
        sym->setKey(ev->key());
        if (ev->text().isNull()) {
@@ -623,7 +623,7 @@ void setKeySymbol(KeySymbol * sym, QKeyEvent * ev)
        LYXERR(Debug::KEY, "Getting key " << ev->key() << ", with text '"
                << ev->text() << "'");
        // This is unsafe because ev->text() is the unicode representation of the
-       // key, not the name of the key. For example, Ctrl-x and Alt-x produce 
+       // key, not the name of the key. For example, Ctrl-x and Alt-x produce
        // different texts.
        sym->setText(qstring_to_ucs4(ev->text()));
        LYXERR(Debug::KEY, "Setting key to " << sym->key() << ", "
@@ -686,7 +686,7 @@ char_type KeySymbol::getUCSEncoded() const
 }
 
 
-docstring const KeySymbol::print(KeyModifier mod, bool forgui) const
+docstring const KeySymbol::print(KeyModifier mod, bool forgui, bool untranslated) const
 {
        int tmpkey = key_;
 
@@ -703,7 +703,8 @@ docstring const KeySymbol::print(KeyModifier mod, bool forgui) const
        QString str;
 
        if (forgui)
-               str = seq.toString(QKeySequence::NativeText);
+               str = untranslated ? seq.toString(QKeySequence::PortableText)
+                                  : seq.toString(QKeySequence::NativeText);
        else {
 #ifdef Q_OS_MAC
                // Qt/Mac does not use Command and friends in the
@@ -714,7 +715,7 @@ docstring const KeySymbol::print(KeyModifier mod, bool forgui) const
                str.replace(QChar(0x2325), qt_("Option-"));
                str.replace(QChar(0x2318), qt_("Command-"));
 #else
-               str = seq.toString(QKeySequence::PortableText); 
+               str = seq.toString(QKeySequence::PortableText);
 #endif
        }