mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-14 04:21:56 +00:00
Use the new InsetCommandParams interface (frontend part), from Ugras and me
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15408 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0d1c89fe64
commit
3bbbc1437b
@ -125,7 +125,7 @@ bool ControlBibtex::usingBibtopic() const
|
|||||||
|
|
||||||
bool ControlBibtex::bibtotoc() const
|
bool ControlBibtex::bibtotoc() const
|
||||||
{
|
{
|
||||||
return prefixIs(params().getOptions(), "bibtotoc");
|
return prefixIs(lyx::to_utf8(params()["options"]), "bibtotoc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -135,27 +135,27 @@ string const ControlBibtex::getStylefile() const
|
|||||||
// own "plain" stylefiles
|
// own "plain" stylefiles
|
||||||
biblio::CiteEngine_enum const & engine =
|
biblio::CiteEngine_enum const & engine =
|
||||||
biblio::getEngine(kernel().buffer());
|
biblio::getEngine(kernel().buffer());
|
||||||
string defaultstyle;
|
docstring defaultstyle;
|
||||||
switch (engine) {
|
switch (engine) {
|
||||||
case biblio::ENGINE_BASIC:
|
case biblio::ENGINE_BASIC:
|
||||||
defaultstyle = "plain";
|
defaultstyle = lyx::from_ascii("plain");
|
||||||
break;
|
break;
|
||||||
case biblio::ENGINE_NATBIB_AUTHORYEAR:
|
case biblio::ENGINE_NATBIB_AUTHORYEAR:
|
||||||
defaultstyle = "plainnat";
|
defaultstyle = lyx::from_ascii("plainnat");
|
||||||
break;
|
break;
|
||||||
case biblio::ENGINE_NATBIB_NUMERICAL:
|
case biblio::ENGINE_NATBIB_NUMERICAL:
|
||||||
defaultstyle = "plainnat";
|
defaultstyle = lyx::from_ascii("plainnat");
|
||||||
break;
|
break;
|
||||||
case biblio::ENGINE_JURABIB:
|
case biblio::ENGINE_JURABIB:
|
||||||
defaultstyle = "jurabib";
|
defaultstyle = lyx::from_ascii("jurabib");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
string bst = params().getOptions();
|
docstring bst = params()["btprint"];
|
||||||
if (bibtotoc()){
|
if (bibtotoc()){
|
||||||
// bibstyle exists?
|
// bibstyle exists?
|
||||||
if (contains(bst,',')) {
|
if (contains(bst, ',')) {
|
||||||
string bibtotoc = "bibtotoc";
|
docstring bibtotoc = lyx::from_ascii("bibtotoc");
|
||||||
bst = split(bst, bibtotoc, ',');
|
bst = split(bst, bibtotoc, ',');
|
||||||
} else
|
} else
|
||||||
bst.erase();
|
bst.erase();
|
||||||
@ -164,10 +164,11 @@ string const ControlBibtex::getStylefile() const
|
|||||||
// propose default style file for new insets
|
// propose default style file for new insets
|
||||||
// existing insets might have (legally) no bst files
|
// existing insets might have (legally) no bst files
|
||||||
// (if the class already provides a style)
|
// (if the class already provides a style)
|
||||||
if (bst.empty() && params().getContents().empty())
|
if (bst.empty() && params()["bibfiles"].empty())
|
||||||
bst = defaultstyle;
|
bst = defaultstyle;
|
||||||
|
|
||||||
return bst;
|
// FIXME UNICODE
|
||||||
|
return lyx::to_utf8(bst);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
@ -62,15 +62,15 @@ void GBibItem::update()
|
|||||||
{
|
{
|
||||||
bc().refreshReadOnly();
|
bc().refreshReadOnly();
|
||||||
|
|
||||||
keyentry_->set_text (controller().params().getContents());
|
keyentry_->set_text (lyx::to_utf8(controller().params()["key"]));
|
||||||
labelentry_->set_text (controller().params().getOptions());
|
labelentry_->set_text (lyx::to_utf8(controller().params()["label"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GBibItem::apply()
|
void GBibItem::apply()
|
||||||
{
|
{
|
||||||
controller().params().setContents(keyentry_->get_text());
|
controller().params()["key"] = lyx::from_utf8(keyentry_->get_text());
|
||||||
controller().params().setOptions(labelentry_->get_text());
|
controller().params()["label"] = lyx::from_utf8(labelentry_->get_text());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GBibItem::changed()
|
void GBibItem::changed()
|
||||||
|
@ -95,7 +95,7 @@ void GBibtex::doBuild()
|
|||||||
|
|
||||||
void GBibtex::update()
|
void GBibtex::update()
|
||||||
{
|
{
|
||||||
string bibs(controller().params().getContents());
|
string bibs(lyx::to_utf8(controller().params()["bibfiles"]));
|
||||||
string bib;
|
string bib;
|
||||||
|
|
||||||
databasesstore_->clear();
|
databasesstore_->clear();
|
||||||
@ -118,7 +118,7 @@ void GBibtex::update()
|
|||||||
|
|
||||||
toccheck_->set_sensitive(!bibtopic);
|
toccheck_->set_sensitive(!bibtopic);
|
||||||
|
|
||||||
string btprint(controller().params().getSecOptions());
|
string btprint(lyx::to_ascii(controller().params()["btprint"]));
|
||||||
int btp = 0;
|
int btp = 0;
|
||||||
if (btprint == "btPrintNotCited")
|
if (btprint == "btPrintNotCited")
|
||||||
btp = 1;
|
btp = 1;
|
||||||
@ -169,7 +169,7 @@ void GBibtex::apply()
|
|||||||
dblist += ",";
|
dblist += ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
controller().params().setContents(dblist);
|
controller().params()["bibfiles"] = lyx::from_utf8(dblist);
|
||||||
|
|
||||||
string const bibstyle = stylecombo_.get_active_text();
|
string const bibstyle = stylecombo_.get_active_text();
|
||||||
bool const bibtotoc = toccheck_->get_active();
|
bool const bibtotoc = toccheck_->get_active();
|
||||||
@ -177,15 +177,15 @@ void GBibtex::apply()
|
|||||||
|
|
||||||
if (!bibtopic && bibtotoc && (!bibstyle.empty())) {
|
if (!bibtopic && bibtotoc && (!bibstyle.empty())) {
|
||||||
// both bibtotoc and style
|
// both bibtotoc and style
|
||||||
controller().params().setOptions("bibtotoc," + bibstyle);
|
controller().params()["options"] = lyx::from_utf8("bibtotoc," + bibstyle);
|
||||||
} else if (!bibtopic && bibtotoc) {
|
} else if (!bibtopic && bibtotoc) {
|
||||||
// bibtotoc and no style
|
// bibtotoc and no style
|
||||||
controller().params().setOptions("bibtotoc");
|
controller().params()["options"] = lyx::from_ascii("bibtotoc");
|
||||||
} else {
|
} else {
|
||||||
// only style. An empty one is valid, because some
|
// only style. An empty one is valid, because some
|
||||||
// documentclasses have an own \bibliographystyle{}
|
// documentclasses have an own \bibliographystyle{}
|
||||||
// command!
|
// command!
|
||||||
controller().params().setOptions(bibstyle);
|
controller().params()["options"] = lyx::from_utf8(bibstyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bibtopic allows three kinds of sections:
|
// bibtopic allows three kinds of sections:
|
||||||
@ -196,18 +196,20 @@ void GBibtex::apply()
|
|||||||
|
|
||||||
switch (btp) {
|
switch (btp) {
|
||||||
case 0:
|
case 0:
|
||||||
controller().params().setSecOptions("btPrintCited");
|
controller().params()["btprint"] = lyx::from_ascii("btPrintCited");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
controller().params().setSecOptions("btPrintNotCited");
|
|
||||||
|
controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
controller().params().setSecOptions("btPrintAll");
|
|
||||||
|
controller().params()["btprint"] = lyx::from_ascii("btPrintAll");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bibtopic)
|
if (!bibtopic)
|
||||||
controller().params().setSecOptions("");
|
controller().params()["btprint"] = docstring();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ void GInclude::doBuild()
|
|||||||
|
|
||||||
void GInclude::update()
|
void GInclude::update()
|
||||||
{
|
{
|
||||||
string const filename = controller().params().getContents();
|
string const filename = lyx::to_utf8(controller().params()["filename"]);
|
||||||
fileentry_->set_text(filename);
|
fileentry_->set_text(filename);
|
||||||
|
|
||||||
string const cmdname = controller().params().getCmdName();
|
string const cmdname = controller().params().getCmdName();
|
||||||
@ -113,7 +113,7 @@ void GInclude::apply()
|
|||||||
InsetCommandParams params = controller().params();
|
InsetCommandParams params = controller().params();
|
||||||
|
|
||||||
params.preview(previewcheck_->get_active());
|
params.preview(previewcheck_->get_active());
|
||||||
params.setContents(fileentry_->get_text());
|
params["filename"] = lyx::from_utf8(fileentry_->get_text());
|
||||||
|
|
||||||
if (includeradio_->get_active())
|
if (includeradio_->get_active())
|
||||||
params.setCmdName("include");
|
params.setCmdName("include");
|
||||||
|
@ -168,8 +168,8 @@ void GRef::update()
|
|||||||
bc().refreshReadOnly();
|
bc().refreshReadOnly();
|
||||||
jumptobutton_->set_sensitive(true);
|
jumptobutton_->set_sensitive(true);
|
||||||
backbutton_->set_sensitive(false);
|
backbutton_->set_sensitive(false);
|
||||||
labelentry_->set_text(controller().params().getContents());
|
labelentry_->set_text(lyx::to_utf8(controller().params()["reference"]));
|
||||||
nameentry_->set_text(controller().params().getOptions());
|
nameentry_->set_text(lyx::to_utf8(controller().params()["name"]));
|
||||||
|
|
||||||
// Name is irrelevant to LaTeX/Literate documents
|
// Name is irrelevant to LaTeX/Literate documents
|
||||||
Kernel::DocType doctype = kernel().docType();
|
Kernel::DocType doctype = kernel().docType();
|
||||||
@ -240,8 +240,8 @@ void GRef::apply()
|
|||||||
if (applylock_)
|
if (applylock_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
controller().params().setContents(labelentry_->get_text());
|
controller().params()["reference"] = lyx::from_utf8(labelentry_->get_text());
|
||||||
controller().params().setOptions(nameentry_->get_text());
|
controller().params()["name"] = lyx::from_utf8(nameentry_->get_text());
|
||||||
int const type = formatcombo_->get_active_row_number();
|
int const type = formatcombo_->get_active_row_number();
|
||||||
controller().params().setCmdName(InsetRef::getName(type));
|
controller().params().setCmdName(InsetRef::getName(type));
|
||||||
}
|
}
|
||||||
|
@ -44,14 +44,14 @@ GText::GText(Dialog & parent, docstring const & title, docstring const & label)
|
|||||||
|
|
||||||
void GText::apply()
|
void GText::apply()
|
||||||
{
|
{
|
||||||
controller().params().setContents(entry_->get_text());
|
controller().params()["name"] = lyx::from_utf8(entry_->get_text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GText::update()
|
void GText::update()
|
||||||
{
|
{
|
||||||
string const contents = support::trim(
|
string const contents = support::trim(
|
||||||
controller().params().getContents());
|
lyx::to_utf8(controller().params()["name"]));
|
||||||
entry_->set_text(contents);
|
entry_->set_text(contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +77,8 @@ void GUrl::onEntryChanged()
|
|||||||
|
|
||||||
void GUrl::update()
|
void GUrl::update()
|
||||||
{
|
{
|
||||||
url_->set_text(Glib::locale_to_utf8(
|
url_->set_text(lyx::to_utf8(controller().params()["target"]));
|
||||||
controller().params().getContents()));
|
name_->set_text(lyx::to_utf8(controller().params()["name"]));
|
||||||
name_->set_text(Glib::locale_to_utf8(
|
|
||||||
controller().params().getOptions()));
|
|
||||||
if (controller().params().getCmdName() == "url")
|
if (controller().params().getCmdName() == "url")
|
||||||
htmlType_->set_active(false);
|
htmlType_->set_active(false);
|
||||||
else
|
else
|
||||||
@ -90,10 +88,8 @@ void GUrl::update()
|
|||||||
|
|
||||||
void GUrl::apply()
|
void GUrl::apply()
|
||||||
{
|
{
|
||||||
controller().params().setContents(
|
controller().params()["target"] = lyx::from_utf8(url_->get_text());
|
||||||
Glib::locale_to_utf8(url_->get_text()));
|
controller().params()["name"] = lyx::from_utf8(name_->get_text());
|
||||||
controller().params().setOptions(
|
|
||||||
Glib::locale_to_utf8(name_->get_text()));
|
|
||||||
if (htmlType_->get_active())
|
if (htmlType_->get_active())
|
||||||
controller().params().setCmdName("htmlurl");
|
controller().params().setCmdName("htmlurl");
|
||||||
else
|
else
|
||||||
|
@ -46,15 +46,15 @@ void QBibitem::build_dialog()
|
|||||||
|
|
||||||
void QBibitem::update_contents()
|
void QBibitem::update_contents()
|
||||||
{
|
{
|
||||||
dialog_->keyED->setText(toqstr(controller().params().getContents()));
|
dialog_->keyED->setText(toqstr(controller().params()["key"]));
|
||||||
dialog_->labelED->setText(toqstr(controller().params().getOptions()));
|
dialog_->labelED->setText(toqstr(controller().params()["label"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QBibitem::apply()
|
void QBibitem::apply()
|
||||||
{
|
{
|
||||||
controller().params().setContents(fromqstr(dialog_->keyED->text()));
|
controller().params()["key"] = qstring_to_ucs4(dialog_->keyED->text());
|
||||||
controller().params().setOptions(fromqstr(dialog_->labelED->text()));
|
controller().params()["label"] = qstring_to_ucs4(dialog_->labelED->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,8 +76,8 @@ void QBibtex::update_contents()
|
|||||||
|
|
||||||
dialog_->databaseLB->clear();
|
dialog_->databaseLB->clear();
|
||||||
|
|
||||||
string bibs(controller().params().getContents());
|
docstring bibs(controller().params()["bibfiles"]);
|
||||||
string bib;
|
docstring bib;
|
||||||
|
|
||||||
while (!bibs.empty()) {
|
while (!bibs.empty()) {
|
||||||
bibs = split(bibs, bib, ',');
|
bibs = split(bibs, bib, ',');
|
||||||
@ -99,7 +99,7 @@ void QBibtex::update_contents()
|
|||||||
dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic);
|
dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic);
|
||||||
dialog_->bibtocCB->setEnabled(!bibtopic);
|
dialog_->bibtocCB->setEnabled(!bibtopic);
|
||||||
|
|
||||||
string btprint(controller().params().getSecOptions());
|
docstring btprint(controller().params()["bibfiles"]);
|
||||||
int btp = 0;
|
int btp = 0;
|
||||||
if (btprint == "btPrintNotCited")
|
if (btprint == "btPrintNotCited")
|
||||||
btp = 1;
|
btp = 1;
|
||||||
@ -138,30 +138,30 @@ void QBibtex::update_contents()
|
|||||||
|
|
||||||
void QBibtex::apply()
|
void QBibtex::apply()
|
||||||
{
|
{
|
||||||
string dbs(fromqstr(dialog_->databaseLB->text(0)));
|
docstring dbs(qstring_to_ucs4(dialog_->databaseLB->text(0)));
|
||||||
|
|
||||||
unsigned int maxCount = dialog_->databaseLB->count();
|
unsigned int maxCount = dialog_->databaseLB->count();
|
||||||
for (unsigned int i = 1; i < maxCount; i++) {
|
for (unsigned int i = 1; i < maxCount; i++) {
|
||||||
dbs += ',';
|
dbs += ',';
|
||||||
dbs += fromqstr(dialog_->databaseLB->text(i));
|
dbs += qstring_to_ucs4(dialog_->databaseLB->text(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
controller().params().setContents(dbs);
|
controller().params()["bibfiles"] = dbs;
|
||||||
|
|
||||||
string const bibstyle(fromqstr(dialog_->styleCB->currentText()));
|
docstring const bibstyle(qstring_to_ucs4(dialog_->styleCB->currentText()));
|
||||||
bool const bibtotoc(dialog_->bibtocCB->isChecked());
|
bool const bibtotoc(dialog_->bibtocCB->isChecked());
|
||||||
|
|
||||||
if (bibtotoc && (!bibstyle.empty())) {
|
if (bibtotoc && (!bibstyle.empty())) {
|
||||||
// both bibtotoc and style
|
// both bibtotoc and style
|
||||||
controller().params().setOptions("bibtotoc," + bibstyle);
|
controller().params()["options"] = "bibtotoc," + bibstyle;
|
||||||
} else if (bibtotoc) {
|
} else if (bibtotoc) {
|
||||||
// bibtotoc and no style
|
// bibtotoc and no style
|
||||||
controller().params().setOptions("bibtotoc");
|
controller().params()["options"] = lyx::from_ascii("bibtotoc");
|
||||||
} else {
|
} else {
|
||||||
// only style. An empty one is valid, because some
|
// only style. An empty one is valid, because some
|
||||||
// documentclasses have an own \bibliographystyle{}
|
// documentclasses have an own \bibliographystyle{}
|
||||||
// command!
|
// command!
|
||||||
controller().params().setOptions(bibstyle);
|
controller().params()["options"] = bibstyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bibtopic allows three kinds of sections:
|
// bibtopic allows three kinds of sections:
|
||||||
@ -172,18 +172,18 @@ void QBibtex::apply()
|
|||||||
|
|
||||||
switch (btp) {
|
switch (btp) {
|
||||||
case 0:
|
case 0:
|
||||||
controller().params().setSecOptions("btPrintCited");
|
controller().params()["btprint"] = lyx::from_ascii("btPrintCited");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
controller().params().setSecOptions("btPrintNotCited");
|
controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
controller().params().setSecOptions("btPrintAll");
|
controller().params()["btprint"] = lyx::from_ascii("btPrintAll");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!controller().usingBibtopic())
|
if (!controller().usingBibtopic())
|
||||||
controller().params().setSecOptions("");
|
controller().params()["btprint"] = docstring();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ void QInclude::update_contents()
|
|||||||
|
|
||||||
InsetCommandParams const & params = controller().params();
|
InsetCommandParams const & params = controller().params();
|
||||||
|
|
||||||
dialog_->filenameED->setText(toqstr(params.getContents()));
|
dialog_->filenameED->setText(toqstr(params["filename"]));
|
||||||
|
|
||||||
dialog_->visiblespaceCB->setChecked(false);
|
dialog_->visiblespaceCB->setChecked(false);
|
||||||
dialog_->visiblespaceCB->setEnabled(false);
|
dialog_->visiblespaceCB->setEnabled(false);
|
||||||
@ -100,7 +100,7 @@ void QInclude::apply()
|
|||||||
{
|
{
|
||||||
InsetCommandParams params = controller().params();
|
InsetCommandParams params = controller().params();
|
||||||
|
|
||||||
params.setContents(fromqstr(dialog_->filenameED->text()));
|
params["filename"] = qstring_to_ucs4(dialog_->filenameED->text());
|
||||||
params.preview(dialog_->previewCB->isChecked());
|
params.preview(dialog_->previewCB->isChecked());
|
||||||
|
|
||||||
int const item = dialog_->typeCO->currentItem();
|
int const item = dialog_->typeCO->currentItem();
|
||||||
|
@ -50,16 +50,16 @@ void QIndex::build_dialog()
|
|||||||
|
|
||||||
void QIndex::update_contents()
|
void QIndex::update_contents()
|
||||||
{
|
{
|
||||||
string const contents = controller().params().getContents();
|
docstring const & name = controller().params()["name"];
|
||||||
dialog_->keywordED->setText(toqstr(contents));
|
dialog_->keywordED->setText(toqstr(name));
|
||||||
|
|
||||||
bc().valid(!contents.empty());
|
bc().valid(!name.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QIndex::apply()
|
void QIndex::apply()
|
||||||
{
|
{
|
||||||
controller().params().setContents(fromqstr(dialog_->keywordED->text()));
|
controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,13 +71,13 @@ void QRef::update_contents()
|
|||||||
|
|
||||||
int orig_type = dialog_->typeCO->currentItem();
|
int orig_type = dialog_->typeCO->currentItem();
|
||||||
|
|
||||||
dialog_->referenceED->setText(toqstr(params.getContents()));
|
dialog_->referenceED->setText(toqstr(params["reference"]));
|
||||||
|
|
||||||
dialog_->nameED->setText(toqstr(params.getOptions()));
|
dialog_->nameED->setText(toqstr(params["name"]));
|
||||||
dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly());
|
dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly());
|
||||||
|
|
||||||
// restore type settings for new insets
|
// restore type settings for new insets
|
||||||
if (params.getContents().empty())
|
if (params["reference"].empty())
|
||||||
dialog_->typeCO->setCurrentItem(orig_type);
|
dialog_->typeCO->setCurrentItem(orig_type);
|
||||||
else
|
else
|
||||||
dialog_->typeCO->setCurrentItem(InsetRef::getType(params.getCmdName()));
|
dialog_->typeCO->setCurrentItem(InsetRef::getType(params.getCmdName()));
|
||||||
@ -95,7 +95,7 @@ void QRef::update_contents()
|
|||||||
dialog_->bufferCO->insertItem(toqstr(*it));
|
dialog_->bufferCO->insertItem(toqstr(*it));
|
||||||
}
|
}
|
||||||
// restore the buffer combo setting for new insets
|
// restore the buffer combo setting for new insets
|
||||||
if (params.getContents().empty() && restored_buffer_ != -1
|
if (params["reference"].empty() && restored_buffer_ != -1
|
||||||
&& restored_buffer_ < dialog_->bufferCO->count())
|
&& restored_buffer_ < dialog_->bufferCO->count())
|
||||||
dialog_->bufferCO->setCurrentItem(restored_buffer_);
|
dialog_->bufferCO->setCurrentItem(restored_buffer_);
|
||||||
else
|
else
|
||||||
@ -111,8 +111,8 @@ void QRef::apply()
|
|||||||
InsetCommandParams & params = controller().params();
|
InsetCommandParams & params = controller().params();
|
||||||
|
|
||||||
params.setCmdName(InsetRef::getName(dialog_->typeCO->currentItem()));
|
params.setCmdName(InsetRef::getName(dialog_->typeCO->currentItem()));
|
||||||
params.setContents(fromqstr(dialog_->referenceED->text()));
|
params["reference"] = qstring_to_ucs4(dialog_->referenceED->text());
|
||||||
params.setOptions(fromqstr(dialog_->nameED->text()));
|
params["name"] = qstring_to_ucs4(dialog_->nameED->text());
|
||||||
|
|
||||||
restored_buffer_ = dialog_->bufferCO->currentItem();
|
restored_buffer_ = dialog_->bufferCO->currentItem();
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,8 @@ void QURL::update_contents()
|
|||||||
{
|
{
|
||||||
InsetCommandParams const & params = controller().params();
|
InsetCommandParams const & params = controller().params();
|
||||||
|
|
||||||
dialog_->urlED->setText(toqstr(params.getContents()));
|
dialog_->urlED->setText(toqstr(params["target"]));
|
||||||
dialog_->nameED->setText(toqstr(params.getOptions()));
|
dialog_->nameED->setText(toqstr(params["name"]));
|
||||||
dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url");
|
dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url");
|
||||||
|
|
||||||
bc().valid(isValid());
|
bc().valid(isValid());
|
||||||
@ -63,8 +63,8 @@ void QURL::apply()
|
|||||||
{
|
{
|
||||||
InsetCommandParams & params = controller().params();
|
InsetCommandParams & params = controller().params();
|
||||||
|
|
||||||
params.setContents(fromqstr(dialog_->urlED->text()));
|
params["target"] = qstring_to_ucs4(dialog_->urlED->text());
|
||||||
params.setOptions(fromqstr(dialog_->nameED->text()));
|
params["name"] = qstring_to_ucs4(dialog_->nameED->text());
|
||||||
|
|
||||||
if (dialog_->hyperlinkCB->isChecked())
|
if (dialog_->hyperlinkCB->isChecked())
|
||||||
params.setCmdName("htmlurl");
|
params.setCmdName("htmlurl");
|
||||||
|
@ -46,15 +46,15 @@ void QBibitem::build_dialog()
|
|||||||
|
|
||||||
void QBibitem::update_contents()
|
void QBibitem::update_contents()
|
||||||
{
|
{
|
||||||
dialog_->keyED->setText(toqstr(controller().params().getContents()));
|
dialog_->keyED->setText(toqstr(controller().params()["key"]));
|
||||||
dialog_->labelED->setText(toqstr(controller().params().getOptions()));
|
dialog_->labelED->setText(toqstr(controller().params()["label"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QBibitem::apply()
|
void QBibitem::apply()
|
||||||
{
|
{
|
||||||
controller().params().setContents(fromqstr(dialog_->keyED->text()));
|
controller().params()["key"] = qstring_to_ucs4(dialog_->keyED->text());
|
||||||
controller().params().setOptions(fromqstr(dialog_->labelED->text()));
|
controller().params()["label"] = qstring_to_ucs4(dialog_->labelED->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ void QBibtex::update_contents()
|
|||||||
|
|
||||||
dialog_->databaseLW->clear();
|
dialog_->databaseLW->clear();
|
||||||
|
|
||||||
string bibs(controller().params().getContents());
|
docstring bibs(controller().params()["bibfiles"]);
|
||||||
string bib;
|
docstring bib;
|
||||||
|
|
||||||
while (!bibs.empty()) {
|
while (!bibs.empty()) {
|
||||||
bibs = split(bibs, bib, ',');
|
bibs = split(bibs, bib, ',');
|
||||||
@ -100,7 +100,7 @@ void QBibtex::update_contents()
|
|||||||
dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic);
|
dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic);
|
||||||
dialog_->bibtocCB->setEnabled(!bibtopic);
|
dialog_->bibtocCB->setEnabled(!bibtopic);
|
||||||
|
|
||||||
string btprint(controller().params().getSecOptions());
|
docstring btprint(controller().params()["btprint"]);
|
||||||
int btp = 0;
|
int btp = 0;
|
||||||
if (btprint == "btPrintNotCited")
|
if (btprint == "btPrintNotCited")
|
||||||
btp = 1;
|
btp = 1;
|
||||||
@ -138,30 +138,30 @@ void QBibtex::update_contents()
|
|||||||
|
|
||||||
void QBibtex::apply()
|
void QBibtex::apply()
|
||||||
{
|
{
|
||||||
string dbs(fromqstr(dialog_->databaseLW->item(0)->text()));
|
docstring dbs(qstring_to_ucs4(dialog_->databaseLW->item(0)->text()));
|
||||||
|
|
||||||
unsigned int maxCount = dialog_->databaseLW->count();
|
unsigned int maxCount = dialog_->databaseLW->count();
|
||||||
for (unsigned int i = 1; i < maxCount; i++) {
|
for (unsigned int i = 1; i < maxCount; i++) {
|
||||||
dbs += ',';
|
dbs += ',';
|
||||||
dbs += fromqstr(dialog_->databaseLW->item(i)->text());
|
dbs += qstring_to_ucs4(dialog_->databaseLW->item(i)->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
controller().params().setContents(dbs);
|
controller().params()["bibfiles"] = dbs;
|
||||||
|
|
||||||
string const bibstyle(fromqstr(dialog_->styleCB->currentText()));
|
docstring const bibstyle(qstring_to_ucs4(dialog_->styleCB->currentText()));
|
||||||
bool const bibtotoc(dialog_->bibtocCB->isChecked());
|
bool const bibtotoc(dialog_->bibtocCB->isChecked());
|
||||||
|
|
||||||
if (bibtotoc && (!bibstyle.empty())) {
|
if (bibtotoc && (!bibstyle.empty())) {
|
||||||
// both bibtotoc and style
|
// both bibtotoc and style
|
||||||
controller().params().setOptions("bibtotoc," + bibstyle);
|
controller().params()["options"] = "bibtotoc," + bibstyle;
|
||||||
} else if (bibtotoc) {
|
} else if (bibtotoc) {
|
||||||
// bibtotoc and no style
|
// bibtotoc and no style
|
||||||
controller().params().setOptions("bibtotoc");
|
controller().params()["options"] = lyx::from_ascii("bibtotoc");
|
||||||
} else {
|
} else {
|
||||||
// only style. An empty one is valid, because some
|
// only style. An empty one is valid, because some
|
||||||
// documentclasses have an own \bibliographystyle{}
|
// documentclasses have an own \bibliographystyle{}
|
||||||
// command!
|
// command!
|
||||||
controller().params().setOptions(bibstyle);
|
controller().params()["options"] = bibstyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bibtopic allows three kinds of sections:
|
// bibtopic allows three kinds of sections:
|
||||||
@ -172,18 +172,18 @@ void QBibtex::apply()
|
|||||||
|
|
||||||
switch (btp) {
|
switch (btp) {
|
||||||
case 0:
|
case 0:
|
||||||
controller().params().setSecOptions("btPrintCited");
|
controller().params()["btprint"] = lyx::from_ascii("btPrintCited");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
controller().params().setSecOptions("btPrintNotCited");
|
controller().params()["btprint"] = lyx::from_ascii("btPrintNotCited");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
controller().params().setSecOptions("btPrintAll");
|
controller().params()["btprint"] = lyx::from_ascii("btPrintAll");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!controller().usingBibtopic())
|
if (!controller().usingBibtopic())
|
||||||
controller().params().setSecOptions("");
|
controller().params()["btprint"] = docstring();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ void QInclude::update_contents()
|
|||||||
|
|
||||||
InsetCommandParams const & params = controller().params();
|
InsetCommandParams const & params = controller().params();
|
||||||
|
|
||||||
dialog_->filenameED->setText(toqstr(params.getContents()));
|
dialog_->filenameED->setText(toqstr(params["filename"]));
|
||||||
|
|
||||||
dialog_->visiblespaceCB->setChecked(false);
|
dialog_->visiblespaceCB->setChecked(false);
|
||||||
dialog_->visiblespaceCB->setEnabled(false);
|
dialog_->visiblespaceCB->setEnabled(false);
|
||||||
@ -99,7 +99,7 @@ void QInclude::apply()
|
|||||||
{
|
{
|
||||||
InsetCommandParams params = controller().params();
|
InsetCommandParams params = controller().params();
|
||||||
|
|
||||||
params.setContents(fromqstr(dialog_->filenameED->text()));
|
params["filename"] = qstring_to_ucs4(dialog_->filenameED->text());
|
||||||
params.preview(dialog_->previewCB->isChecked());
|
params.preview(dialog_->previewCB->isChecked());
|
||||||
|
|
||||||
int const item = dialog_->typeCO->currentIndex();
|
int const item = dialog_->typeCO->currentIndex();
|
||||||
|
@ -50,7 +50,7 @@ void QIndex::build_dialog()
|
|||||||
|
|
||||||
void QIndex::update_contents()
|
void QIndex::update_contents()
|
||||||
{
|
{
|
||||||
string const contents = controller().params().getContents();
|
docstring const contents = controller().params()["name"];
|
||||||
dialog_->keywordED->setText(toqstr(contents));
|
dialog_->keywordED->setText(toqstr(contents));
|
||||||
|
|
||||||
bc().valid(!contents.empty());
|
bc().valid(!contents.empty());
|
||||||
@ -59,7 +59,7 @@ void QIndex::update_contents()
|
|||||||
|
|
||||||
void QIndex::apply()
|
void QIndex::apply()
|
||||||
{
|
{
|
||||||
controller().params().setContents(fromqstr(dialog_->keywordED->text()));
|
controller().params()["name"] = qstring_to_ucs4(dialog_->keywordED->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,13 +72,13 @@ void QRef::update_contents()
|
|||||||
|
|
||||||
int orig_type = dialog_->typeCO->currentIndex();
|
int orig_type = dialog_->typeCO->currentIndex();
|
||||||
|
|
||||||
dialog_->referenceED->setText(toqstr(params.getContents()));
|
dialog_->referenceED->setText(toqstr(params["reference"]));
|
||||||
|
|
||||||
dialog_->nameED->setText(toqstr(params.getOptions()));
|
dialog_->nameED->setText(toqstr(params["name"]));
|
||||||
dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly());
|
dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly());
|
||||||
|
|
||||||
// restore type settings for new insets
|
// restore type settings for new insets
|
||||||
if (params.getContents().empty())
|
if (params["reference"].empty())
|
||||||
dialog_->typeCO->setCurrentIndex(orig_type);
|
dialog_->typeCO->setCurrentIndex(orig_type);
|
||||||
else
|
else
|
||||||
dialog_->typeCO->setCurrentIndex(InsetRef::getType(params.getCmdName()));
|
dialog_->typeCO->setCurrentIndex(InsetRef::getType(params.getCmdName()));
|
||||||
@ -96,7 +96,7 @@ void QRef::update_contents()
|
|||||||
dialog_->bufferCO->addItem(toqstr(*it));
|
dialog_->bufferCO->addItem(toqstr(*it));
|
||||||
}
|
}
|
||||||
// restore the buffer combo setting for new insets
|
// restore the buffer combo setting for new insets
|
||||||
if (params.getContents().empty() && restored_buffer_ != -1
|
if (params["reference"].empty() && restored_buffer_ != -1
|
||||||
&& restored_buffer_ < dialog_->bufferCO->count())
|
&& restored_buffer_ < dialog_->bufferCO->count())
|
||||||
dialog_->bufferCO->setCurrentIndex(restored_buffer_);
|
dialog_->bufferCO->setCurrentIndex(restored_buffer_);
|
||||||
else
|
else
|
||||||
@ -112,8 +112,8 @@ void QRef::apply()
|
|||||||
InsetCommandParams & params = controller().params();
|
InsetCommandParams & params = controller().params();
|
||||||
|
|
||||||
params.setCmdName(InsetRef::getName(dialog_->typeCO->currentIndex()));
|
params.setCmdName(InsetRef::getName(dialog_->typeCO->currentIndex()));
|
||||||
params.setContents(fromqstr(dialog_->referenceED->text()));
|
params["reference"] = qstring_to_ucs4(dialog_->referenceED->text());
|
||||||
params.setOptions(fromqstr(dialog_->nameED->text()));
|
params["name"] = qstring_to_ucs4(dialog_->nameED->text());
|
||||||
|
|
||||||
restored_buffer_ = dialog_->bufferCO->currentIndex();
|
restored_buffer_ = dialog_->bufferCO->currentIndex();
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,8 @@ void UrlView::update_contents()
|
|||||||
{
|
{
|
||||||
InsetCommandParams const & params = controller().params();
|
InsetCommandParams const & params = controller().params();
|
||||||
|
|
||||||
dialog_->urlED->setText(toqstr(params.getContents()));
|
dialog_->urlED->setText(toqstr(params["target"]));
|
||||||
dialog_->nameED->setText(toqstr(params.getOptions()));
|
dialog_->nameED->setText(toqstr(params["name"]));
|
||||||
dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url");
|
dialog_->hyperlinkCB->setChecked(params.getCmdName() != "url");
|
||||||
|
|
||||||
bc().valid(isValid());
|
bc().valid(isValid());
|
||||||
@ -63,8 +63,8 @@ void UrlView::apply()
|
|||||||
{
|
{
|
||||||
InsetCommandParams & params = controller().params();
|
InsetCommandParams & params = controller().params();
|
||||||
|
|
||||||
params.setContents(fromqstr(dialog_->urlED->text()));
|
params["target"] = qstring_to_ucs4(dialog_->urlED->text());
|
||||||
params.setOptions(fromqstr(dialog_->nameED->text()));
|
params["name"] = qstring_to_ucs4(dialog_->nameED->text());
|
||||||
|
|
||||||
if (dialog_->hyperlinkCB->isChecked())
|
if (dialog_->hyperlinkCB->isChecked())
|
||||||
params.setCmdName("htmlurl");
|
params.setCmdName("htmlurl");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user