]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiInclude.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiInclude.cpp
index 8e7a57c5b389ed6397aa646d5ef1120e1b3773d6..c55d71fa7f21ddb116bef58f36c13e3cac16f3d8 100644 (file)
@@ -51,8 +51,8 @@ GuiInclude::GuiInclude(GuiView & lv)
 {
        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 &)),
@@ -64,6 +64,7 @@ GuiInclude::GuiInclude(GuiView & lv)
        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()));
@@ -72,8 +73,8 @@ GuiInclude::GuiInclude(GuiView & lv)
        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);
@@ -153,10 +154,6 @@ void GuiInclude::typeChanged(int v)
                        listingsGB->setEnabled(false);
                        break;
        }
-       //see this thread
-       //  http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg118471.html
-       //for the reason this is here.
-       okPB->setDefault(true);
 }
 
 
@@ -227,6 +224,7 @@ void GuiInclude::paramsToDialog(InsetCommandParams const & icp)
                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))
@@ -265,6 +263,8 @@ void GuiInclude::applyView()
                else
                        params_.setCmdName("verbatiminput");
        }
+       params_["literal"] = literalCB->isChecked()
+                       ? from_ascii("true") : from_ascii("false");
 }