]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiPrintindex.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiPrintindex.cpp
index c639fd9e4735e978c96872bac29c31c4898f4a6b..1244c62e495d4ad00eb6f9aae057969a9debd086 100644 (file)
@@ -39,14 +39,15 @@ GuiPrintindex::GuiPrintindex(GuiView & lv)
 {
        setupUi(this);
 
-       connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
-       connect(cancelPB, SIGNAL(clicked()), this, SLOT(slotClose()));
+       connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+               this, SLOT(slotButtonBox(QAbstractButton *)));
        connect(indicesCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
        connect(subindexCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
+       connect(literalCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 
        bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
-       bc().setOK(okPB);
-       bc().setCancel(cancelPB);
+       bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
+       bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
 }
 
 
@@ -78,6 +79,7 @@ void GuiPrintindex::updateContents()
        int const pos = indicesCO->findData(toqstr(cur_index));
        indicesCO->setCurrentIndex(pos);
        subindexCB->setChecked(params_.getCmdName() == "printsubindex");
+       literalCB->setChecked(params_["literal"] == "true");
 }
 
 
@@ -95,6 +97,8 @@ void GuiPrintindex::applyView()
                params_["type"] = docstring();
        else
                params_["type"] = qstring_to_ucs4(index);
+       params_["literal"] = literalCB->isChecked()
+                       ? from_ascii("true") : from_ascii("false");
 }
 
 
@@ -105,15 +109,16 @@ void GuiPrintindex::paramsToDialog(InsetCommandParams const & /*icp*/)
                indicesCO->findData(toqstr(params_["type"]));
        subindexCB->setChecked(params_.getCmdName() == "printsubindex");
        indicesCO->setCurrentIndex(pos);
+       literalCB->setChecked(params_["literal"] == "true");
        bc().setValid(isValid());
 }
 
 
-bool GuiPrintindex::initialiseParams(string const & data)
+bool GuiPrintindex::initialiseParams(string const & sdata)
 {
        // The name passed with LFUN_INSET_APPLY is also the name
        // used to identify the mailer.
-       InsetCommand::string2params("index_print", data, params_);
+       InsetCommand::string2params(sdata, params_);
        paramsToDialog(params_);
        return true;
 }
@@ -121,7 +126,7 @@ bool GuiPrintindex::initialiseParams(string const & data)
 
 void GuiPrintindex::dispatchParams()
 {
-       std::string const lfun = InsetCommand::params2string("index_print", params_);
+       std::string const lfun = InsetCommand::params2string(params_);
        dispatch(FuncRequest(getLfun(), lfun));
 }