]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCitation.cpp
Use localized item when calculating the panel stack's tree widget width.
[lyx.git] / src / frontends / qt4 / GuiCitation.cpp
index 2178dd1101722fcb4887e50aaaa3f6e7a8c6d9a6..28d5dcf63830c0a145b893dadda092bde9b2068a 100644 (file)
@@ -127,6 +127,8 @@ GuiCitation::GuiCitation(GuiView & lv)
                this, SLOT(on_citationStyleCO_currentIndexChanged(int)));
        connect(starredCB, SIGNAL(clicked()),
                this, SLOT(updateStyles()));
+       connect(literalCB, SIGNAL(clicked()),
+               this, SLOT(changed()));
        connect(forceuppercaseCB, SIGNAL(clicked()),
                this, SLOT(updateStyles()));
        connect(textBeforeED, SIGNAL(textChanged(QString)),
@@ -248,6 +250,10 @@ void GuiCitation::updateControls(BiblioInfo const & bi)
 {
        QModelIndex idx = selectionManager->getSelectedIndex(1);
        updateInfo(bi, idx);
+       int i = citationStyleCO->currentIndex();
+       if (i == -1)
+               i = 0;
+       updateFormatting(citeStyles_[i]);
        selectionManager->update();
 }
 
@@ -293,6 +299,7 @@ void GuiCitation::updateFormatting(CitationStyle currentStyle)
        textBeforeLA->setEnabled(textbefore && haveSelection);
        textAfterED->setEnabled(textafter && haveSelection);
        textAfterLA->setEnabled(textafter && haveSelection);
+       literalCB->setEnabled(textbefore || textafter);
        citationStyleCO->setEnabled(haveSelection);
        citationStyleLA->setEnabled(haveSelection);
 
@@ -585,6 +592,7 @@ void GuiCitation::applyParams(int const choice, bool full, bool force,
                params_["pretextlist"] = getStringFromVector(getPreTexts(), from_ascii("\t"));
                params_["posttextlist"] = getStringFromVector(getPostTexts(), from_ascii("\t"));
        }
+       params_["literal"] = literalCB->isChecked() ? from_ascii("true") : from_ascii("false");
        dispatchParams();
 }
 
@@ -726,6 +734,7 @@ void GuiCitation::init()
                documentBuffer().params().fullAuthorList());
        textBeforeED->setText(toqstr(params_["before"]));
        textAfterED->setText(toqstr(params_["after"]));
+       literalCB->setChecked(params_["literal"] == "true");
 
        setPreTexts(getVectorFromString(params_["pretextlist"], from_ascii("\t")));
        setPostTexts(getVectorFromString(params_["posttextlist"], from_ascii("\t")));