Fix UI glitch in the prefs dialog (bug 7190).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@37082 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2011-01-03 17:21:37 +00:00
parent 61e7c1472e
commit 2c48ac2626
3 changed files with 24 additions and 11 deletions

View File

@ -970,29 +970,35 @@ PrefDisplay::PrefDisplay(GuiPreferences * form)
connect(displayGraphicsCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
connect(instantPreviewCO, SIGNAL(activated(int)), this, SIGNAL(changed()));
connect(previewSizeSB, SIGNAL(valueChanged(double)), this, SIGNAL(changed()));
if (instantPreviewCO->currentIndex() == 0)
previewSizeSB->setEnabled(false);
else
previewSizeSB->setEnabled(true);
connect(paragraphMarkerCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
}
void PrefDisplay::on_instantPreviewCO_currentIndexChanged(int index)
{
if (index == 0)
previewSizeSB->setEnabled(false);
else
previewSizeSB->setEnabled(true);
previewSizeSB->setEnabled(index != 0);
}
void PrefDisplay::on_displayGraphicsCB_toggled(bool on)
{
instantPreviewCO->setEnabled(on);
previewSizeSB->setEnabled(on && instantPreviewCO->currentIndex() > 0);
}
void PrefDisplay::apply(LyXRC & rc) const
{
switch (instantPreviewCO->currentIndex()) {
case 0: rc.preview = LyXRC::PREVIEW_OFF; break;
case 1: rc.preview = LyXRC::PREVIEW_NO_MATH; break;
case 2: rc.preview = LyXRC::PREVIEW_ON; break;
case 0:
rc.preview = LyXRC::PREVIEW_OFF;
break;
case 1:
rc.preview = LyXRC::PREVIEW_NO_MATH;
break;
case 2:
rc.preview = LyXRC::PREVIEW_ON;
break;
}
rc.display_graphics = displayGraphicsCB->isChecked();
@ -1027,6 +1033,9 @@ void PrefDisplay::update(LyXRC const & rc)
instantPreviewCO->setEnabled(rc.display_graphics);
previewSizeSB->setValue(rc.preview_scale_factor);
paragraphMarkerCB->setChecked(rc.paragraph_markers);
previewSizeSB->setEnabled(
rc.display_graphics
&& rc.preview != LyXRC::PREVIEW_OFF);
}

View File

@ -275,6 +275,7 @@ public:
private Q_SLOTS:
void on_instantPreviewCO_currentIndexChanged(int);
void on_displayGraphicsCB_toggled(bool);
};

View File

@ -154,6 +154,9 @@ What's new
- Wake up from waiting state after encountering a file parsing error
(bug 6950).
- Fix enabling/disabling of Instant Preview widgets in the preferences
dialog (bug 7190).
* DOCUMENTATION AND LOCALIZATION