]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCitation.cpp
Implement display of starred cite commands
[lyx.git] / src / frontends / qt4 / GuiCitation.cpp
index 5889d68f7c7abd668f41f78a624715aab0007c8f..d73f3d3542683a0a44049cf5bcbbfb2ead31fed3 100644 (file)
@@ -125,9 +125,9 @@ GuiCitation::GuiCitation(GuiView & lv)
        connect(citationStyleCO, SIGNAL(activated(int)),
                this, SLOT(on_citationStyleCO_currentIndexChanged(int)));
        connect(starredCB, SIGNAL(clicked()),
-               this, SLOT(changed()));
+               this, SLOT(updateStyles()));
        connect(forceuppercaseCB, SIGNAL(clicked()),
-               this, SLOT(changed()));
+               this, SLOT(updateStyles()));
        connect(textBeforeED, SIGNAL(textChanged(QString)),
                this, SLOT(updateStyles()));
        connect(textAfterED, SIGNAL(textChanged(QString)),
@@ -397,8 +397,10 @@ void GuiCitation::updateInfo(BiblioInfo const & bi, QModelIndex const & idx)
        }
 
        infoML->setToolTip(qt_("Sketchy preview of the selected citation"));
+       CiteItem ci;
+       ci.richtext = true;
        QString const keytxt = toqstr(
-               bi.getInfo(qstring_to_ucs4(idx.data().toString()), documentBuffer(), true));
+               bi.getInfo(qstring_to_ucs4(idx.data().toString()), documentBuffer(), ci));
        infoML->document()->setHtml(keytxt);
 }
 
@@ -678,13 +680,16 @@ void GuiCitation::findKey(BiblioInfo const & bi,
 
 QStringList GuiCitation::citationStyles(BiblioInfo const & bi, size_t max_size)
 {
-       docstring const before = qstring_to_ucs4(textBeforeED->text());
-       docstring const after = qstring_to_ucs4(textAfterED->text());
        vector<docstring> const keys = to_docstring_vector(cited_keys_);
        vector<CitationStyle> styles = citeStyles_;
-       // FIXME: pass a dictionary instead of individual before, after, dialog, etc.
-       vector<docstring> ret = bi.getCiteStrings(keys, styles, documentBuffer(),
-               before, after, from_utf8("dialog"), max_size);
+       CiteItem ci;
+       ci.textBefore = qstring_to_ucs4(textBeforeED->text());
+       ci.textAfter = qstring_to_ucs4(textAfterED->text());
+       ci.forceUpperCase = forceuppercaseCB->isChecked();
+       ci.Starred = starredCB->isChecked();
+       ci.context = CiteItem::Dialog;
+       ci.max_size = max_size;
+       vector<docstring> ret = bi.getCiteStrings(keys, styles, documentBuffer(), ci);
        return to_qstring_list(ret);
 }