From: Vincent van Ravesteijn Date: Sun, 22 Nov 2009 00:19:50 +0000 (+0000) Subject: Fixes for the FileFormat pane of GuiPrefs.cpp: X-Git-Tag: 2.0.0~5051 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f1dd63ec2422a7f3c803d9e1898057d1bf9979c6;p=features.git Fixes for the FileFormat pane of GuiPrefs.cpp: - We have to block the signals coming from viewerCO and editorCO, otherwise the signal handlers will clear the customly set viewer or editor. - A copy-paste error made the custom viewer to be changed when changing the editor combobox. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32143 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 1f58ba17cb..99675ad32b 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1685,8 +1685,8 @@ void PrefFileformats::update(LyXRC const & rc) bool const init = defaultFormatCB->currentText().isEmpty(); updateView(); if (init) { - int const pos = defaultFormatCB->findData(toqstr( - rc.default_view_format)); + int const pos = + defaultFormatCB->findData(toqstr(rc.default_view_format)); defaultFormatCB->setCurrentIndex(pos); } } @@ -1859,10 +1859,12 @@ namespace { void PrefFileformats::updateViewers() { Format const f = currentFormat(); + viewerCO->blockSignals(true); viewerCO->clear(); viewerCO->addItem(qt_("None"), QString()); updateComboBox(viewer_alternatives, f.name(), viewerCO); viewerCO->addItem(qt_("Custom"), QString("custom viewer")); + viewerCO->blockSignals(false); int pos = viewerCO->findData(toqstr(f.viewer())); if (pos != -1) { @@ -1880,10 +1882,12 @@ void PrefFileformats::updateViewers() void PrefFileformats::updateEditors() { Format const f = currentFormat(); + editorCO->blockSignals(true); editorCO->clear(); editorCO->addItem(qt_("None"), QString()); updateComboBox(editor_alternatives, f.name(), editorCO); editorCO->addItem(qt_("Custom"), QString("custom editor")); + editorCO->blockSignals(false); int pos = editorCO->findData(toqstr(f.editor())); if (pos != -1) { @@ -1912,7 +1916,7 @@ void PrefFileformats::on_editorCO_currentIndexChanged(int i) bool const custom = editorCO->itemData(i).toString() == "custom editor"; editorED->setEnabled(custom); if (!custom) - currentFormat().setViewer(fromqstr(editorCO->itemData(i).toString())); + currentFormat().setEditor(fromqstr(editorCO->itemData(i).toString())); }