]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiPrefs.cpp
extend the idea of the previous patch a bit...
[lyx.git] / src / frontends / qt4 / GuiPrefs.cpp
index 67b7cd2926c8ee9b1dbd284c8ed41525d33fc5fc..e35e8cc7a1b29e2e8b8b97c7e5bdc67a38196f89 100644 (file)
@@ -260,6 +260,22 @@ PrefInput::PrefInput(GuiPreferences * form, QWidget * parent)
                this, SIGNAL(changed()));
        connect(secondKeymapED, SIGNAL(textChanged(QString)),
                this, SIGNAL(changed()));
+       connect(inlineDelaySB, SIGNAL(valueChanged(double)),
+               this, SIGNAL(changed()));
+       connect(inlineMathCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(inlineTextCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(inlineDotsCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(popupDelaySB, SIGNAL(valueChanged(double)),
+               this, SIGNAL(changed()));
+       connect(popupMathCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(popupTextCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(popupAfterCompleteCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
        connect(mouseWheelSpeedSB, SIGNAL(valueChanged(double)),
                this, SIGNAL(changed()));
 }
@@ -271,6 +287,15 @@ void PrefInput::apply(LyXRC & rc) const
        rc.use_kbmap = keymapCB->isChecked();
        rc.primary_kbmap = internal_path(fromqstr(firstKeymapED->text()));
        rc.secondary_kbmap = internal_path(fromqstr(secondKeymapED->text()));
+       rc.completion_inline_delay = inlineDelaySB->value();
+       rc.completion_inline_math = inlineMathCB->isChecked();
+       rc.completion_inline_text = inlineTextCB->isChecked();
+       rc.completion_inline_dots = inlineDotsCB->isChecked() ? 13 : -1;
+       rc.completion_popup_delay = popupDelaySB->value();
+       rc.completion_popup_math = popupMathCB->isChecked();
+       rc.completion_popup_text = popupTextCB->isChecked();
+       rc.completion_popup_after_complete
+       = popupAfterCompleteCB->isChecked();
        rc.mouse_wheel_speed = mouseWheelSpeedSB->value();
 }
 
@@ -281,6 +306,14 @@ void PrefInput::update(LyXRC const & rc)
        keymapCB->setChecked(rc.use_kbmap);
        firstKeymapED->setText(toqstr(external_path(rc.primary_kbmap)));
        secondKeymapED->setText(toqstr(external_path(rc.secondary_kbmap)));
+       inlineDelaySB->setValue(rc.completion_inline_delay);
+       inlineMathCB->setChecked(rc.completion_inline_math);
+       inlineTextCB->setChecked(rc.completion_inline_text);
+       inlineDotsCB->setChecked(rc.completion_inline_dots != -1);
+       popupDelaySB->setValue(rc.completion_popup_delay);
+       popupMathCB->setChecked(rc.completion_popup_math);
+       popupTextCB->setChecked(rc.completion_popup_text);
+       popupAfterCompleteCB->setChecked(rc.completion_popup_after_complete);
        mouseWheelSpeedSB->setValue(rc.mouse_wheel_speed);
 }
 
@@ -2207,7 +2240,7 @@ GuiPreferences::GuiPreferences(GuiView & lv)
        add(converters);
        add(formats);
 
-       prefsPS->setCurrentPanel(_("User interface"));
+       prefsPS->setCurrentPanel(qt_("User interface"));
 // FIXME: hack to work around resizing bug in Qt >= 4.2
 // bug verified with Qt 4.2.{0-3} (JSpitzm)
 #if QT_VERSION >= 0x040200
@@ -2225,7 +2258,7 @@ GuiPreferences::GuiPreferences(GuiView & lv)
 void GuiPreferences::add(PrefModule * module)
 {
        BOOST_ASSERT(module);
-       prefsPS->addPanel(module, module->title());
+       prefsPS->addPanel(module, toqstr(module->title()));
        connect(module, SIGNAL(changed()), this, SLOT(change_adaptor()));
        modules_.push_back(module);
 }