From a2b087e75fc8fa7304e73a5df80f3426885af5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Wed, 29 Dec 2010 13:50:22 +0000 Subject: [PATCH] * GuiPrefs.{cpp,h}: - update screen font sizes in dialog after prefs change, since the localization of float values might have changed. (fixes bug 6771). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37035 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiPrefs.cpp | 26 +++++++++++++++++++------- src/frontends/qt4/GuiPrefs.h | 6 ++++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index e7c1c4e80e..372e7d9eeb 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1003,6 +1003,18 @@ void PrefScreenFonts::update(LyXRC const & rc) selectTypewriter(screenTypewriterCO->currentText()); screenZoomSB->setValue(rc.zoom); + updateScreenFontSizes(rc); + + pixmapCacheCB->setChecked(rc.use_pixmap_cache); +#if defined(Q_WS_X11) + pixmapCacheCB->setEnabled(false); +#endif + +} + + +void PrefScreenFonts::updateScreenFontSizes(LyXRC const & rc) +{ doubleToWidget(screenTinyED, rc.font_sizes[FONT_SIZE_TINY]); doubleToWidget(screenSmallestED, rc.font_sizes[FONT_SIZE_SCRIPT]); doubleToWidget(screenSmallerED, rc.font_sizes[FONT_SIZE_FOOTNOTE]); @@ -1013,12 +1025,6 @@ void PrefScreenFonts::update(LyXRC const & rc) doubleToWidget(screenLargestED, rc.font_sizes[FONT_SIZE_LARGEST]); doubleToWidget(screenHugeED, rc.font_sizes[FONT_SIZE_HUGE]); doubleToWidget(screenHugerED, rc.font_sizes[FONT_SIZE_HUGER]); - - pixmapCacheCB->setChecked(rc.use_pixmap_cache); -#if defined(Q_WS_X11) - pixmapCacheCB->setEnabled(false); -#endif - } @@ -3077,7 +3083,10 @@ GuiPreferences::GuiPreferences(GuiView & lv) addModule(new PrefUserInterface(this)); addModule(new PrefEdit(this)); addModule(new PrefShortcuts(this)); - addModule(new PrefScreenFonts(this)); + PrefScreenFonts * screenfonts = new PrefScreenFonts(this); + connect(this, SIGNAL(prefsApplied(LyXRC const &)), + screenfonts, SLOT(updateScreenFontSizes(LyXRC const &))); + addModule(screenfonts); addModule(new PrefColors(this)); addModule(new PrefDisplay(this)); addModule(new PrefInput(this)); @@ -3185,6 +3194,9 @@ void GuiPreferences::dispatchParams() ostringstream ss; rc_.write(ss, true); dispatch(FuncRequest(LFUN_LYXRC_APPLY, ss.str())); + // issue prefsApplied signal. This will update the + // localized screen font sizes. + prefsApplied(rc_); // FIXME: these need lfuns // FIXME UNICODE Author const & author = diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index e5e82b830f..57b9a32cfc 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -71,6 +71,9 @@ public: public Q_SLOTS: void change_adaptor(); +Q_SIGNALS: + void prefsApplied(LyXRC const & rc); + public: /// Apply changes void applyView(); @@ -240,6 +243,9 @@ private Q_SLOTS: void selectRoman(const QString&); void selectSans(const QString&); void selectTypewriter(const QString&); + +public Q_SLOTS: + void updateScreenFontSizes(LyXRC const & rc); };