示例#1
0
docstring GuiBibitem::dialogToParams() const
{
	InsetCommandParams params(insetCode());
	params["key"] = qstring_to_ucs4(keyED->text());
	params["label"] = qstring_to_ucs4(labelED->text());
	return from_utf8(InsetCommand::params2string(params));
}
示例#2
0
bool GuiNomenclature::initialiseParams(std::string const & data)
{
	InsetCommandParams p(insetCode());
	if (!InsetCommand::string2params(data, p))
		return false;
	symbolED->setText(toqstr(p["symbol"]));
	return true;
}
示例#3
0
docstring GuiNomenclature::dialogToParams() const
{
	InsetCommandParams params(insetCode());
	params["prefix"] = qstring_to_ucs4(prefixED->text());
	params["symbol"] = qstring_to_ucs4(symbolED->text());
	QString description = descriptionTE->toPlainText();
	description.replace('\n',"\\\\");
	params["description"] = qstring_to_ucs4(description);
	return from_utf8(InsetNomencl::params2string(params));
}
示例#4
0
docstring GuiBibitem::dialogToParams() const
{
	InsetCommandParams params(insetCode());
	QString label = labelED->text();
	if (!yearED->isHidden())
		label += "(" + yearED->text() + ")" + allAuthorsED->text();
	params["key"] = qstring_to_ucs4(keyED->text());
	params["label"] = qstring_to_ucs4(label);
	params["literal"] = literalCB->isChecked()
			? from_ascii("true") : from_ascii("false");
	return from_utf8(InsetCommand::params2string(params));
}
示例#5
0
docstring GuiHyperlink::dialogToParams() const
{
	InsetCommandParams params(insetCode());

	params["target"] = qstring_to_ucs4(targetED->text());
	params["name"] = qstring_to_ucs4(nameED->text());
	if (webRB->isChecked())
		params["type"] = from_utf8("");
	else if (emailRB->isChecked())
		params["type"] = from_utf8("mailto:");
	else if (fileRB->isChecked())
		params["type"] = from_utf8("file:");
	params["literal"] = literalCB->isChecked()
			? from_ascii("true") : from_ascii("false");
	params.setCmdName("href");
	return from_utf8(InsetHyperlink::params2string(params));
}
示例#6
0
文件: GuiNomencl.cpp 项目: bsjung/Lyx
GuiNomenclature::GuiNomenclature(GuiView & lv)
	: GuiDialog(lv, "nomenclature", qt_("Nomenclature")),
	  params_(insetCode("nomenclature"))
{
	setupUi(this);

	connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
	connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
	connect(symbolED, SIGNAL(textChanged(QString)),
		this, SLOT(change_adaptor()));
	connect(descriptionTE, SIGNAL(textChanged()),
		this, SLOT(change_adaptor()));

	setFocusProxy(descriptionTE);

	bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
	bc().setOK(okPB);
	bc().setCancel(closePB);
	bc().addReadOnly(symbolED);
	bc().addReadOnly(descriptionTE);
	bc().addReadOnly(prefixED);
}
示例#7
0
GuiPrintNomencl::GuiPrintNomencl(GuiView & lv)
	: GuiDialog(lv, "nomencl_print", qt_("Nomenclature settings")),
	  params_(insetCode("nomencl_print"))
{
	setupUi(this);

	connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
	connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
	connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));

	connect(valueLE, SIGNAL(textChanged(QString)),
		this, SLOT(change_adaptor()));
	connect(unitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
		this, SLOT(change_adaptor()));

	valueLE->setValidator(unsignedLengthValidator(valueLE));

	// Manage the ok, apply, restore and cancel/close buttons
	bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
	bc().setOK(okPB);
	bc().setApply(applyPB);
	bc().setCancel(closePB);

	// disable for read-only documents
	bc().addReadOnly(valueLE);
	bc().addReadOnly(unitLC);

	// initialize the length validator
	bc().addCheckedLineEdit(valueLE, valueLA);

	setWidthCO->addItem(qt_("Default"),
		QVariant(toqstr("none")));
	setWidthCO->addItem(qt_("Longest label width"),
		QVariant(toqstr("auto")));
	setWidthCO->addItem(qt_("Custom"),
		QVariant(toqstr("custom")));
}