X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fintl.C;h=ff1162d2a0f0a338b586486ab53b45114b80b752;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=19978862ecfd46a7dd41f57ae89814ba2b8666c3;hpb=99d1627a471b92f403598d03dfc861ddc3c11be0;p=lyx.git diff --git a/src/intl.C b/src/intl.C index 19978862ec..ff1162d2a0 100644 --- a/src/intl.C +++ b/src/intl.C @@ -1,10 +1,14 @@ /** - * \file intl.C - * Copyright 1995-2002 the LyX Team - * Read the file COPYING + * \file intl.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * * \author unknown - * \author John Levon + * \author Lars Gullik Bjønnes + * \author Angus Leeming + * \author John Levon + * + * Full author contact details are available in file CREDITS. */ #include @@ -13,8 +17,9 @@ #include "debug.h" #include "lyxrc.h" -#include "support/lstrings.h" -#include "language.h" + +namespace lyx { + using std::endl; @@ -26,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