]> git.lyx.org Git - lyx.git/blobdiff - src/intl.C
mathed31.diff
[lyx.git] / src / intl.C
index 371d44da9ba1fde56cee4df3f82b56e4354055e1..89141686266f3e6aaa314be151770350103cd0f8 100644 (file)
@@ -26,7 +26,7 @@
 #include "lyx_gui_misc.h" // CancelCloseBoxCB
 #include "debug.h"
 #include "lyxrc.h"
-#include "trans_mgr.h"
+
 #include "support/lstrings.h"
 #include "language.h"
 #include "frontends/Dialogs.h" // redrawGUI
@@ -43,8 +43,7 @@ extern "C" void C_Intl_DispatchCallback(FL_OBJECT * ob, long code);
 
 Intl::Intl()
        : prim_lang(lyxrc.primary_kbmap), 
-       sec_lang(lyxrc.secondary_kbmap),
-       trans(new TransManager)
+       sec_lang(lyxrc.secondary_kbmap)
 {
        keymapon = lyxrc.use_kbmap;
        chsetcode = 0;
@@ -54,10 +53,10 @@ Intl::Intl()
        r_ = Dialogs::redrawGUI.connect(slot(this, &Intl::redraw));
 }
 
+
 Intl::~Intl()
 {
        r_.disconnect();
-       delete trans;
 }
 
 
@@ -72,7 +71,7 @@ int Intl::SetPrimary(string const & lang)
 {
        if (lyxerr.debugging(Debug::KBMAP))
                lyxerr << "Primary: `" << lang << "'" << endl;
-       return trans->SetPrimary(lang);
+       return trans.SetPrimary(lang);
 }
 
 
@@ -80,7 +79,7 @@ int Intl::SetSecondary(string const & lang)
 {
        if (lyxerr.debugging(Debug::KBMAP))
                lyxerr << "Secondary: `" << lang << "'" << endl;
-       return trans->SetSecondary(lang);
+       return trans.SetSecondary(lang);
 }
 
 
@@ -107,7 +106,7 @@ void Intl::update()
 
 
 void Intl::KeyMapOn(bool on)
-       /* turn on/off key mappings, status in keymapon */
+       // turn on/off key mappings, status in keymapon
 {
        keymapon = on;
 
@@ -126,7 +125,7 @@ void Intl::KeyMapOn(bool on)
        } else {
                fl_set_button(fd_form_keymap->KeyOffBtn, 1);
                fl_hide_object(fd_form_keymap->KeymapErr);
-               trans->DisableKeymap();
+               trans.DisableKeymap();
        }
 }
 
@@ -159,13 +158,13 @@ void Intl::KeyMapPrim()
 
        curkeymap = i;
 
-       if (p.empty() || trans->SetPrimary(p)) {
+       if (p.empty() || trans.SetPrimary(p)) {
                // error selecting keymap
                fl_show_object(fd_form_keymap->KeymapErr);
                update();
        } else {
                // no error
-               trans->EnablePrimary();
+               trans.EnablePrimary();
                keymapon = true;
                primarykeymap = true;
                fl_hide_object(fd_form_keymap->KeymapErr);
@@ -179,7 +178,7 @@ void Intl::KeyMapSec()
        fl_set_button(fd_form_keymap->KeyOnBtn, 0);
        fl_set_button(fd_form_keymap->KeyOnBtn2, 1);
 
-       /* read text from choice */
+       // read text from choice
        int const i = Language2->get();
 
        string p;
@@ -189,19 +188,20 @@ void Intl::KeyMapSec()
                p = Language2->getline();
        curkeymap = i;
 
-       if (p.empty() || trans->SetSecondary(p)) {
+       if (p.empty() || trans.SetSecondary(p)) {
                // error selecting keymap
                fl_show_object(fd_form_keymap->KeymapErr);
                update();
        } else {
                // no error
-               trans->EnableSecondary();
+               trans.EnableSecondary();
                keymapon = true;
                primarykeymap = false;
                fl_hide_object(fd_form_keymap->KeymapErr);
        }
 }
 
+
 void Intl::LCombo(int, void * v, Combox * combox)
 {
        Intl * itl = static_cast<Intl*>(v);
@@ -212,6 +212,7 @@ void Intl::LCombo(int, void * v, Combox * combox)
        return;
 }
 
+
 void Intl::DispatchCallback(FL_OBJECT * ob, long code)
 {
        if (ob && (code == 0)) {
@@ -223,7 +224,7 @@ void Intl::DispatchCallback(FL_OBJECT * ob, long code)
        
        Intl * itl = static_cast<Intl *>(ob->u_vdata);
 
-       if (itl!= 0) itl->Keymap(code);
+       if (itl != 0) itl->Keymap(code);
 }
 
 
@@ -234,7 +235,7 @@ extern "C" void C_Intl_DispatchCallback(FL_OBJECT * ob, long code)
 
 
 void Intl::InitKeyMapper(bool on)
-       /* initialize key mapper */
+       // initialize key mapper
 {
        lyxerr[Debug::INIT] << "Initializing key mappings..." << endl;
 
@@ -307,22 +308,19 @@ void Intl::InitKeyMapper(bool on)
        if (!Language->select_text(prim_lang)) {
                Language->select(n + 1);
                fl_set_input(fd_form_keymap->OtherKeymap, prim_lang.c_str());
-       }
-       else 
-               trans->SetPrimary(prim_lang);
+       } else
+               trans.SetPrimary(prim_lang);
 
        if (!Language2->select_text(sec_lang)) {
                Language2->select(n + 1);
                fl_set_input(fd_form_keymap->OtherKeymap2, sec_lang.c_str());
-       }
-       else
-               trans->SetSecondary(sec_lang);
+       } else
+               trans.SetSecondary(sec_lang);
 
        KeyMapOn(keymapon);
        if (keymapon)
                Keymap(23); // turn primary on
-
-       trans->setCharset(lyxrc.font_norm);
+       trans.setCharset(lyxrc.font_norm);
 }
 
 
@@ -336,7 +334,7 @@ void Intl::Keymap(long code)
        // spagetti example using a switch... (Lgb)
        switch (code) {
        case 0:
-               /* cancel/hide */
+               // cancel/hide
                fl_hide_form(fd_form_keymap->KeyMap);
                break;
        case 3:
@@ -356,9 +354,9 @@ void Intl::Keymap(long code)
                        KeyMapSec();
                }
                break;
-       case 27:        /* set new font norm */
+       case 27:        // set new font norm
                char const * p = fl_get_input(fd_form_keymap->Charset);
-               if (trans->setCharset(p))
+               if (trans.setCharset(p))
                        fl_show_object(fd_form_keymap->ChsetErr);
                else
                        fl_hide_object(fd_form_keymap->ChsetErr);