+ setSelectedKeys(cited_keys_);
+
+ // Initialize the drop downs
+ fillEntries(bi);
+ fillFields(bi);
+
+ // Initialize the citation formatting
+ string const & cmd = params_.getCmdName();
+ CitationStyle const cs =
+ citationStyleFromString(cmd, documentBuffer().params());
+
+ forceuppercaseCB->setChecked(cs.forceUpperCase);
+ starredCB->setChecked(cs.hasStarredVersion &&
+ documentBuffer().params().fullAuthorList());
+ textBeforeED->setText(toqstr(params_["before"]));
+ textAfterED->setText(toqstr(params_["after"]));
+
+ // if this is a new citation, we set the literal checkbox
+ // to its last set value.
+ if (cited_keys_.isEmpty())
+ literalCB->setChecked(InsetCitation::last_literal);
+ else
+ literalCB->setChecked(params_["literal"] == "true");
+
+ setPreTexts(getVectorFromString(params_["pretextlist"], from_ascii("\t")));
+ setPostTexts(getVectorFromString(params_["posttextlist"], from_ascii("\t")));
+
+ // Update the interface
+ updateControls(bi);
+ updateStyles(bi);
+ if (selected_model_.rowCount()) {
+ selectedLV->blockSignals(true);
+ selectedLV->setFocus();
+ selectedLV->selectRow(0);
+ selectedLV->blockSignals(false);
+
+ // Find the citation style
+ vector<string> const & cmds = citeCmds_;
+ vector<string>::const_iterator cit =
+ std::find(cmds.begin(), cmds.end(), cs.name);
+ int i = 0;
+ if (cit != cmds.end())
+ i = int(cit - cmds.begin());
+
+ // Set the style combo appropriately
+ citationStyleCO->blockSignals(true);
+ citationStyleCO->setCurrentIndex(i);
+ citationStyleCO->blockSignals(false);
+ updateFormatting(citeStyles_[i]);
+ } else
+ availableLV->setFocus();
+
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
+ buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);