X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiPrefs.cpp;h=290089b3f1bf080d999dfbfe5710e1b5510905e3;hb=ba76bf5eb85db5a10839fccee3430d906d3f7b70;hp=4162afbb8499303db9e98a55aa009506731c29c1;hpb=33eb188fb627f2ba35ba6cc56d4d7af3362c23bc;p=lyx.git diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 4162afbb84..290089b3f1 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -56,7 +56,6 @@ #include #include #include -#include #include #include @@ -246,12 +245,12 @@ void PrefDate::update(LyXRC const & rc) ///////////////////////////////////////////////////////////////////// // -// PrefKeyboard +// PrefInput // ///////////////////////////////////////////////////////////////////// -PrefKeyboard::PrefKeyboard(GuiPreferences * form, QWidget * parent) - : PrefModule(_("Keyboard"), form, parent) +PrefInput::PrefInput(GuiPreferences * form, QWidget * parent) + : PrefModule(_("Keyboard/Mouse"), form, parent) { setupUi(this); @@ -261,34 +260,38 @@ PrefKeyboard::PrefKeyboard(GuiPreferences * form, QWidget * parent) this, SIGNAL(changed())); connect(secondKeymapED, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); + connect(mouseWheelSpeedSB, SIGNAL(valueChanged(double)), + this, SIGNAL(changed())); } -void PrefKeyboard::apply(LyXRC & rc) const +void PrefInput::apply(LyXRC & rc) const { // FIXME: can derive CB from the two EDs rc.use_kbmap = keymapCB->isChecked(); rc.primary_kbmap = internal_path(fromqstr(firstKeymapED->text())); rc.secondary_kbmap = internal_path(fromqstr(secondKeymapED->text())); + rc.mouse_wheel_speed = mouseWheelSpeedSB->value(); } -void PrefKeyboard::update(LyXRC const & rc) +void PrefInput::update(LyXRC const & rc) { // FIXME: can derive CB from the two EDs keymapCB->setChecked(rc.use_kbmap); firstKeymapED->setText(toqstr(external_path(rc.primary_kbmap))); secondKeymapED->setText(toqstr(external_path(rc.secondary_kbmap))); + mouseWheelSpeedSB->setValue(rc.mouse_wheel_speed); } -QString PrefKeyboard::testKeymap(QString keymap) +QString PrefInput::testKeymap(QString keymap) { return toqstr(form_->browsekbmap(from_utf8(internal_path(fromqstr(keymap))))); } -void PrefKeyboard::on_firstKeymapPB_clicked(bool) +void PrefInput::on_firstKeymapPB_clicked(bool) { QString const file = testKeymap(firstKeymapED->text()); if (!file.isEmpty()) @@ -296,7 +299,7 @@ void PrefKeyboard::on_firstKeymapPB_clicked(bool) } -void PrefKeyboard::on_secondKeymapPB_clicked(bool) +void PrefInput::on_secondKeymapPB_clicked(bool) { QString const file = testKeymap(secondKeymapED->text()); if (!file.isEmpty()) @@ -304,7 +307,7 @@ void PrefKeyboard::on_secondKeymapPB_clicked(bool) } -void PrefKeyboard::on_keymapCB_toggled(bool keymap) +void PrefInput::on_keymapCB_toggled(bool keymap) { firstKeymapLA->setEnabled(keymap); secondKeymapLA->setEnabled(keymap); @@ -437,6 +440,8 @@ PrefScreenFonts::PrefScreenFonts(GuiPreferences * form, QWidget * parent) this, SIGNAL(changed())); connect(screenHugerED, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); + connect(pixmapCacheCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); screenTinyED->setValidator(new QDoubleValidator(screenTinyED)); screenSmallestED->setValidator(new QDoubleValidator(screenSmallestED)); @@ -474,6 +479,7 @@ void PrefScreenFonts::apply(LyXRC & rc) const rc.font_sizes[FONT_SIZE_LARGEST] = fromqstr(screenLargestED->text()); rc.font_sizes[FONT_SIZE_HUGE] = fromqstr(screenHugeED->text()); rc.font_sizes[FONT_SIZE_HUGER] = fromqstr(screenHugerED->text()); + rc.use_pixmap_cache = pixmapCacheCB->isChecked(); if (rc.font_sizes != oldrc.font_sizes || rc.roman_font_name != oldrc.roman_font_name @@ -515,6 +521,12 @@ void PrefScreenFonts::update(LyXRC const & rc) screenLargestED->setText(toqstr(rc.font_sizes[FONT_SIZE_LARGEST])); screenHugeED->setText(toqstr(rc.font_sizes[FONT_SIZE_HUGE])); screenHugerED->setText(toqstr(rc.font_sizes[FONT_SIZE_HUGER])); + + pixmapCacheCB->setChecked(rc.use_pixmap_cache); +#if defined(Q_WS_X11) + pixmapCacheCB->setEnabled(false); +#endif + } @@ -1425,7 +1437,11 @@ PrefLanguage::PrefLanguage(QWidget * parent) { setupUi(this); - connect(rtlCB, SIGNAL(clicked()), + connect(rtlGB, SIGNAL(clicked()), + this, SIGNAL(changed())); + connect(visualCursorRB, SIGNAL(clicked()), + this, SIGNAL(changed())); + connect(logicalCursorRB, SIGNAL(clicked()), this, SIGNAL(changed())); connect(markForeignCB, SIGNAL(clicked()), this, SIGNAL(changed())); @@ -1463,7 +1479,8 @@ PrefLanguage::PrefLanguage(QWidget * parent) void PrefLanguage::apply(LyXRC & rc) const { // FIXME: remove rtl_support bool - rc.rtl_support = rtlCB->isChecked(); + rc.rtl_support = rtlGB->isChecked(); + rc.visual_cursor = rtlGB->isChecked() && visualCursorRB->isChecked(); rc.mark_foreign_language = markForeignCB->isChecked(); rc.language_auto_begin = autoBeginCB->isChecked(); rc.language_auto_end = autoEndCB->isChecked(); @@ -1479,7 +1496,11 @@ void PrefLanguage::apply(LyXRC & rc) const void PrefLanguage::update(LyXRC const & rc) { // FIXME: remove rtl_support bool - rtlCB->setChecked(rc.rtl_support); + rtlGB->setChecked(rc.rtl_support); + if (rc.visual_cursor) + visualCursorRB->setChecked(true); + else + logicalCursorRB->setChecked(true); markForeignCB->setChecked(rc.mark_foreign_language); autoBeginCB->setChecked(rc.language_auto_begin); autoEndCB->setChecked(rc.language_auto_end); @@ -1621,6 +1642,8 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form, QWidget * parent) this, SIGNAL(changed())); connect(sortEnvironmentsCB, SIGNAL(clicked()), this, SIGNAL(changed())); + connect(macroEditStyleCO, SIGNAL(activated(int)), + this, SIGNAL(changed())); connect(autoSaveSB, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); connect(autoSaveCB, SIGNAL(clicked()), @@ -1629,8 +1652,6 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form, QWidget * parent) this, SIGNAL(changed())); connect(tooltipCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(pixmapCacheCB, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); lastfilesSB->setMaximum(maxlastfiles); } @@ -1643,11 +1664,15 @@ void PrefUserInterface::apply(LyXRC & rc) const rc.allow_geometry_session = allowGeometrySessionCB->isChecked(); rc.cursor_follows_scrollbar = cursorFollowsCB->isChecked(); rc.sort_layouts = sortEnvironmentsCB->isChecked(); + switch (macroEditStyleCO->currentIndex()) { + case 0: rc.macro_edit_style = LyXRC::MACRO_EDIT_INLINE_BOX; break; + case 1: rc.macro_edit_style = LyXRC::MACRO_EDIT_INLINE; break; + case 2: rc.macro_edit_style = LyXRC::MACRO_EDIT_LIST; break; + } rc.autosave = autoSaveSB->value() * 60; rc.make_backup = autoSaveCB->isChecked(); rc.num_lastfiles = lastfilesSB->value(); rc.use_tooltip = tooltipCB->isChecked(); - rc.use_pixmap_cache = pixmapCacheCB->isChecked(); } @@ -1659,6 +1684,7 @@ void PrefUserInterface::update(LyXRC const & rc) allowGeometrySessionCB->setChecked(rc.allow_geometry_session); cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar); sortEnvironmentsCB->setChecked(rc.sort_layouts); + macroEditStyleCO->setCurrentIndex(rc.macro_edit_style); // convert to minutes int mins(rc.autosave / 60); if (rc.autosave && !mins) @@ -1667,10 +1693,6 @@ void PrefUserInterface::update(LyXRC const & rc) autoSaveCB->setChecked(rc.make_backup); lastfilesSB->setValue(rc.num_lastfiles); tooltipCB->setChecked(rc.use_tooltip); - pixmapCacheCB->setChecked(rc.use_pixmap_cache); -#if defined(Q_WS_X11) - pixmapCacheGB->setEnabled(false); -#endif } @@ -2127,10 +2149,9 @@ void PrefIdentity::update(LyXRC const & rc) ///////////////////////////////////////////////////////////////////// GuiPreferences::GuiPreferences(GuiView & lv) - : GuiDialog(lv, "prefs"), update_screen_font_(false) + : GuiDialog(lv, "prefs", qt_("Preferences")), update_screen_font_(false) { setupUi(this); - setViewTitle(_("Preferences")); QDialog::setModal(false); @@ -2144,7 +2165,7 @@ GuiPreferences::GuiPreferences(GuiView & lv) add(new PrefScreenFonts(this)); add(new PrefColors(this)); add(new PrefDisplay); - add(new PrefKeyboard(this)); + add(new PrefInput(this)); add(new PrefPaths(this)); @@ -2189,13 +2210,6 @@ void GuiPreferences::add(PrefModule * module) } -void GuiPreferences::closeEvent(QCloseEvent * e) -{ - slotClose(); - e->accept(); -} - - void GuiPreferences::change_adaptor() { changed();