]> 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 290089b3f1bf080d999dfbfe5710e1b5510905e3..e35e8cc7a1b29e2e8b8b97c7e5bdc67a38196f89 100644 (file)
@@ -20,9 +20,7 @@
 #include "BufferList.h"
 #include "Color.h"
 #include "ConverterCache.h"
-#include "support/debug.h"
 #include "FuncRequest.h"
-#include "support/gettext.h"
 #include "GuiFontExample.h"
 #include "GuiKeySymbol.h"
 #include "KeyMap.h"
 #include "paper.h"
 #include "Session.h"
 
+#include "support/debug.h"
+#include "support/FileFilterList.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Package.h"
-#include "support/FileFilterList.h"
 
 #include "graphics/GraphicsTypes.h"
 
@@ -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);
 }
 
@@ -1652,6 +1685,16 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form, QWidget * parent)
                this, SIGNAL(changed()));
        connect(tooltipCB, SIGNAL(toggled(bool)),
                this, SIGNAL(changed()));
+       connect(fullscreenLimitGB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(fullscreenWidthSB, SIGNAL(valueChanged(int)),
+               this, SIGNAL(changed()));
+       connect(toggleTabbarCB, SIGNAL(toggled(bool)),
+               this, SIGNAL(changed()));
+       connect(toggleScrollbarCB, SIGNAL(toggled(bool)),
+               this, SIGNAL(changed()));
+       connect(toggleToolbarsCB, SIGNAL(toggled(bool)),
+               this, SIGNAL(changed()));
        lastfilesSB->setMaximum(maxlastfiles);
 }
 
@@ -1673,6 +1716,11 @@ void PrefUserInterface::apply(LyXRC & rc) const
        rc.make_backup = autoSaveCB->isChecked();
        rc.num_lastfiles = lastfilesSB->value();
        rc.use_tooltip = tooltipCB->isChecked();
+       rc.full_screen_toolbars = toggleToolbarsCB->isChecked();
+       rc.full_screen_scrollbar = toggleScrollbarCB->isChecked();
+       rc.full_screen_tabbar = toggleTabbarCB->isChecked();
+       rc.full_screen_width = fullscreenWidthSB->value();
+       rc.full_screen_limit = fullscreenLimitGB->isChecked();
 }
 
 
@@ -1693,6 +1741,12 @@ void PrefUserInterface::update(LyXRC const & rc)
        autoSaveCB->setChecked(rc.make_backup);
        lastfilesSB->setValue(rc.num_lastfiles);
        tooltipCB->setChecked(rc.use_tooltip);
+       toggleScrollbarCB->setChecked(rc.full_screen_scrollbar);
+       toggleToolbarsCB->setChecked(rc.full_screen_toolbars);
+       toggleTabbarCB->setChecked(rc.full_screen_tabbar);
+       fullscreenWidthSB->setValue(rc.full_screen_width);
+       fullscreenLimitGB->setChecked(rc.full_screen_limit);
+
 }
 
 
@@ -2186,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
@@ -2204,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);
 }