]> git.lyx.org Git - lyx.git/blobdiff - src/intl.C
Extend the navigate menu to child docs
[lyx.git] / src / intl.C
index ce237ed1a2eb1f1e25607233b662f335353e3ccc..ff1162d2a0f0a338b586486ab53b45114b80b752 100644 (file)
@@ -18,6 +18,9 @@
 #include "lyxrc.h"
 
 
+namespace lyx {
+
+
 using std::endl;
 
 
@@ -28,66 +31,71 @@ Intl::Intl()
 }
 
 
-void Intl::KeyMapOn(bool on)
+void Intl::keyMapOn(bool on)
 {
        keymapon = on;
 
        if (on) {
                if (keymap == PRIMARY)
-                       KeyMapPrim();
+                       keyMapPrim();
                else
-                       KeyMapSec();
+                       keyMapSec();
        } else
-               trans.DisableKeymap();
+               trans.disableKeymap();
 }
 
 
-void Intl::ToggleKeyMap()
+void Intl::toggleKeyMap()
 {
        if (keymapon && (keymap == PRIMARY)) {
-               KeyMapSec();
+               keyMapSec();
        } else if (keymapon) {
-               KeyMapOn(false);
+               keyMapOn(false);
        } else
-               KeyMapPrim();
+               keyMapPrim();
 }
 
 
-void Intl::KeyMapPrim()
+void Intl::keyMapPrim()
 {
-       if (!trans.SetPrimary(prim_lang))
-               trans.EnablePrimary();
+       if (!trans.setPrimary(prim_lang))
+               trans.enablePrimary();
 
        keymapon = true;
        keymap = PRIMARY;
 }
 
 
-void Intl::KeyMapSec()
+void Intl::keyMapSec()
 {
-       if (!trans.SetSecondary(sec_lang))
-               trans.EnableSecondary();
+       if (!trans.setSecondary(sec_lang))
+               trans.enableSecondary();
 
        keymapon = true;
        keymap = SECONDARY;
 }
 
 
-void Intl::InitKeyMapper(bool on)
+void Intl::initKeyMapper(bool on)
 {
        lyxerr[Debug::INIT] << "Initializing key mappings..." << endl;
 
+       if (trans.setPrimary(prim_lang) == -1)
+               prim_lang.erase();
+       if (trans.setSecondary(sec_lang) == -1)
+               sec_lang.erase();
+       trans.setCharset(lyxrc.font_norm);
+
        if (prim_lang.empty() && sec_lang.empty())
                keymapon = false;
        else
                keymapon = on;
 
-       KeyMapOn(keymapon);
+       keyMapOn(keymapon);
 
        if (keymapon)
-               KeyMapPrim();
-
-       trans.SetPrimary(prim_lang);
-       trans.SetSecondary(sec_lang);
-       trans.setCharset(lyxrc.font_norm);
+               keyMapPrim();
 }
+
+
+} // namespace lyx