#include "insets/InsetListingsParams.h"
#include "insets/InsetInclude.h"
-#include <QPushButton>
#include <QCheckBox>
#include <QLineEdit>
+#include <QPushButton>
#include <utility>
{
setupUi(this);
- connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
- connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
+ connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+ this, SLOT(slotButtonBox(QAbstractButton *)));
connect(visiblespaceCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(filenameED, SIGNAL(textChanged(const QString &)),
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(literalCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()), this, SLOT(setListingsMsg()));
connect(bypassCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
setFocusProxy(filenameED);
bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
- bc().setOK(okPB);
- bc().setCancel(closePB);
+ bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
+ bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
bc().addReadOnly(filenameED);
bc().addReadOnly(browsePB);
bc().addReadOnly(visiblespaceCB);
//see this thread
// http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg118471.html
//for the reason this is here.
- okPB->setDefault(true);
+ buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
}
-void GuiInclude::paramsToDialog(InsetCommandParams const & params_)
+void GuiInclude::paramsToDialog(InsetCommandParams const & icp)
{
- filenameED->setText(toqstr(params_["filename"]));
+ filenameED->setText(toqstr(icp["filename"]));
visiblespaceCB->setChecked(false);
visiblespaceCB->setEnabled(false);
listingsTB->setPlainText(
qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
- string cmdname = params_.getCmdName();
+ string cmdname = icp.getCmdName();
if (cmdname != "include" &&
cmdname != "verbatiminput" &&
cmdname != "verbatiminput*" &&
} else if (cmdname == "input") {
typeCO->setCurrentIndex(1);
previewCB->setEnabled(true);
- previewCB->setChecked(params_.preview());
+ previewCB->setChecked(icp.preview());
} else if (cmdname == "verbatiminput*") {
typeCO->setCurrentIndex(2);
typeCO->setCurrentIndex(3);
listingsGB->setEnabled(true);
listingsED->setEnabled(true);
- InsetListingsParams par(to_utf8(params_["lstparams"]));
+ InsetListingsParams par(to_utf8(icp["lstparams"]));
// extract caption and label and put them into their respective editboxes
vector<string> pars = getVectorFromString(par.separatedParams(), "\n");
for (vector<string>::iterator it = pars.begin();
string extra = getStringFromVector(pars);
listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams()));
}
+ literalCB->setChecked(icp["literal"] == "true");
// Make sure that the bc is in the INITIAL state
if (bc().policy().buttonStatus(ButtonPolicy::OKAY))
else
params_.setCmdName("verbatiminput");
}
+ params_["literal"] = literalCB->isChecked()
+ ? from_ascii("true") : from_ascii("false");
}
QString const docpath = toqstr(support::onlyPath(buffer().absFileName()));
return browseRelToParent(in_name, docpath, title, filters, false,
- qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+ qt_("D&ocuments"), toqstr(lyxrc.document_path));
}
-bool GuiInclude::initialiseParams(std::string const & data)
+bool GuiInclude::initialiseParams(std::string const & sdata)
{
- InsetCommand::string2params(data, params_);
+ InsetCommand::string2params(sdata, params_);
paramsToDialog(params_);
return true;
}