commit 16d5c49b383841826d1bc563e2d392e12e497ed8
Author: Enrico Forestieri <for...@lyx.org>
Date:   Mon Mar 20 23:59:16 2017 +0100

    Further amendment to 72a488d7
    
    Rephrase positively the check box for the output of en- and em-dashes
    and disable it when using non-TeX fonts. The state of the check box
    is remembered, so that toggling the non-TeX fonts check box does not
    cause information loss.
---
 lib/RELEASE-NOTES                 |    8 ++++----
 src/frontends/qt4/GuiDocument.cpp |   14 ++++++++++++--
 src/frontends/qt4/GuiDocument.h   |    1 +
 src/frontends/qt4/ui/FontUi.ui    |    4 ++--
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index 9264e59..496d0a9 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -88,10 +88,10 @@
 
 !!Caveats when upgrading from earlier versions to 2.3.x
 
-* If the "Use non-TeX fonts" and "Don't use ligatures for en- and em-dashes"
-  document preferences are not checked, when exporting documents containing
-  en- and em-dashes to the format of LyX 2.0 or earlier, the following line
-  has to be manually added to the unicodesymbols file of that LyX version:<br>
+* If using TeX fonts and en- and em-dashes are output as font ligatures,
+  when exporting documents containing en- and em-dashes to the format of
+  LyX 2.0 or earlier, the following line has to be manually added to the
+  unicodesymbols file of that LyX version:<br>
   0x200b "\\hspace{0pt}" "" "" "" "" # ZERO WIDTH SPACE<br>
   This avoids "uncodable character" issues if the document is actually
   loaded by that LyX version. LyX 2.1 and later versions already have the
diff --git a/src/frontends/qt4/GuiDocument.cpp 
b/src/frontends/qt4/GuiDocument.cpp
index 01a5edd..d13f8c4 100644
--- a/src/frontends/qt4/GuiDocument.cpp
+++ b/src/frontends/qt4/GuiDocument.cpp
@@ -840,6 +840,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(fontModule->dashesCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
+       connect(fontModule->dashesCB, SIGNAL(toggled(bool)),
+               this, SLOT(dashesToggled(bool)));
        connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)),
                this, SLOT(change_adaptor()));
        connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)),
@@ -1936,6 +1938,13 @@ void GuiDocument::fontScToggled(bool state)
 }
 
 
+void GuiDocument::dashesToggled(bool state)
+{
+       if (!fontModule->osFontsCB->isChecked())
+               fontModule->dashesCB->setChecked(state);
+}
+
+
 void GuiDocument::updateFontOptions()
 {
        bool const tex_fonts = !fontModule->osFontsCB->isChecked();
@@ -1957,6 +1966,7 @@ void GuiDocument::updateFontOptions()
                                
fontModule->fontsRomanCO->currentIndex()).toString();
        fontModule->fontScCB->setEnabled(providesSC(font));
        fontModule->fontOsfCB->setEnabled(providesOSF(font));
+       fontModule->dashesCB->setEnabled(tex_fonts);
        updateMathFonts(font);
 }
 
@@ -3048,7 +3058,7 @@ void GuiDocument::applyView()
                fromqstr(fontModule->cjkFontLE->text());
 
        bp_.use_microtype = fontModule->microtypeCB->isChecked();
-       bp_.use_dash_ligatures = !fontModule->dashesCB->isChecked();
+       bp_.use_dash_ligatures = fontModule->dashesCB->isChecked();
 
        bp_.fonts_sans_scale[nontexfonts] = fontModule->scaleSansSB->value();
        bp_.fonts_sans_scale[!nontexfonts] = fontModule->font_sf_scale;
@@ -3553,7 +3563,7 @@ void GuiDocument::paramsToDialog()
                fontModule->cjkFontLE->setText(QString());
        
        fontModule->microtypeCB->setChecked(bp_.use_microtype);
-       fontModule->dashesCB->setChecked(!bp_.use_dash_ligatures);
+       fontModule->dashesCB->setChecked(bp_.use_dash_ligatures);
 
        fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
        fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);
diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h
index e202bd9..bb1b2f4 100644
--- a/src/frontends/qt4/GuiDocument.h
+++ b/src/frontends/qt4/GuiDocument.h
@@ -105,6 +105,7 @@ private Q_SLOTS:
        void ttChanged(int);
        void fontOsfToggled(bool state);
        void fontScToggled(bool state);
+       void dashesToggled(bool state);
        void setIndent(int);
        void enableIndent(bool);
        void setSkip(int);
diff --git a/src/frontends/qt4/ui/FontUi.ui b/src/frontends/qt4/ui/FontUi.ui
index 3877b37..b183331 100644
--- a/src/frontends/qt4/ui/FontUi.ui
+++ b/src/frontends/qt4/ui/FontUi.ui
@@ -255,10 +255,10 @@
    <item row="11" column="1">
     <widget class="QCheckBox" name="dashesCB">
      <property name="toolTip">
-      <string>Use \textendash and \textemdash instead of -- and --- for en- 
and em-dashes</string>
+      <string>Use font ligatures -- and --- instead of \textendash and 
\textemdash for en- and em-dashes</string>
      </property>
      <property name="text">
-      <string>Don't use ligatures for en- and &amp;em-dashes</string>
+      <string>Output en- and &amp;em-dashes as ligatures</string>
      </property>
     </widget>
    </item>

Reply via email to