- : GuiCommand(lv, "include", qt_("Child Document"))
+ : GuiDialog(lv, "include", qt_("Child Document")),
+ params_(insetCode("include"))
this, SLOT(change_adaptor()));
connect(editPB, SIGNAL(clicked()), this, SLOT(edit()));
connect(browsePB, SIGNAL(clicked()), this, SLOT(browse()));
this, SLOT(change_adaptor()));
connect(editPB, SIGNAL(clicked()), this, SLOT(edit()));
connect(browsePB, SIGNAL(clicked()), this, SLOT(browse()));
connect(typeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(typeCO, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
connect(previewCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(captionLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(labelLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
connect(typeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(typeCO, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
connect(previewCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(captionLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(labelLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
- connect(listingsED, SIGNAL(textChanged()), this, SLOT(set_listings_msg()));
+ connect(listingsED, SIGNAL(textChanged()), this, SLOT(setListingsMsg()));
connect(bypassCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(bypassCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
- connect(bypassCB, SIGNAL(clicked()), this, SLOT(set_listings_msg()));
+ connect(bypassCB, SIGNAL(clicked()), this, SLOT(setListingsMsg()));
string extra = getStringFromVector(pars);
listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams()));
}
string extra = getStringFromVector(pars);
listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams()));
}
}
void GuiInclude::applyView()
{
params_["filename"] = from_utf8(internal_path(fromqstr(filenameED->text())));
}
void GuiInclude::applyView()
{
params_["filename"] = from_utf8(internal_path(fromqstr(filenameED->text())));
- params_["embed"].clear();
- try {
- Buffer & buf = buffer();
- EmbeddedFile file(to_utf8(params_["filename"]), buf.filePath());
- file.setEmbed(embedCB->checkState() == Qt::Checked);
- // move file around if needed, an exception may be raised.
- file.enable(buf.embedded(), &buf, true);
- // if things are OK..., set params_["embed"]
- params_["embed"] = file.embedded() ? from_utf8(file.inzipName()) : docstring();
- } catch (ExceptionMessage const & message) {
- Alert::error(message.title_, message.details_);
- // params_["embed"] will be empty if a file is failed to embed
- }
if (!label.empty())
par.addParam("label", "{" + label + "}");
string const listparams = par.params();
if (!label.empty())
par.addParam("label", "{" + label + "}");
string const listparams = par.params();
QString const title = qt_("Select document to include");
// input TeX, verbatim, or LyX file ?
QString const title = qt_("Select document to include");
// input TeX, verbatim, or LyX file ?
- return browseRelFile(in_name, docpath, title, filters, false,
+ return browseRelToParent(in_name, docpath, title, filters, false,
- string const ext = support::getExtension(file);
- if (ext == "lyx")
- dispatch(FuncRequest(LFUN_BUFFER_CHILD_OPEN, file));
- else
- // tex file or other text file in verbatim mode
- formats.edit(buffer(),
- makeAbsPath(file, support::onlyPath(buffer().absFileName())),
- "text");
+ InsetCommand::string2params(data, params_);
+ paramsToDialog(params_);
+ return true;
+}
+
+
+void GuiInclude::dispatchParams()
+{
+ std::string const lfun = InsetCommand::params2string(params_);
+ dispatch(FuncRequest(getLfun(), lfun));