* Licence details can be found in the file COPYING.
*
* \author Bo Peng
- * \author Jürgen Spitzmüller
+ * \author Jürgen Spitzmüller
*
* Full author contact details are available in file CREDITS.
*/
#include "insets/InsetListings.h"
#include "insets/InsetListingsParams.h"
+#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
#include "support/lstrings.h"
this, SLOT(change_adaptor()));
connect(spaceInStringCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
+ connect(tabsizeSB, SIGNAL(valueChanged(int)),
+ this, SLOT(change_adaptor()));
connect(extendedcharsCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()),
this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()),
- this, SLOT(set_listings_msg()));
+ this, SLOT(setListingsMsg()));
connect(bypassCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(bypassCB, SIGNAL(clicked()),
- this, SLOT(set_listings_msg()));
+ this, SLOT(setListingsMsg()));
for (int n = 0; languages[n][0]; ++n)
languageCO->addItem(qt_(languages_gui[n]));
lastlineLE->setValidator(new QIntValidator(0, 1000000, this));
placementLE->setValidator(new QRegExpValidator(QRegExp("[\\*tbph]*"), this));
+ bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
bc().setOK(okPB);
bc().setApply(applyPB);
bc().setCancel(closePB);
basicstyle += "\\" + fontstyle;
bool breakline = breaklinesCB->isChecked();
bool space = spaceCB->isChecked();
+ int tabsize = tabsizeSB->value();
bool spaceInString = spaceInStringCB->isChecked();
bool extendedchars = extendedcharsCB->isChecked();
string extra = fromqstr(listingsED->toPlainText());
par.addParam("showspaces", "true");
if (!spaceInString)
par.addParam("showstringspaces", "false");
+ if (tabsize != 8)
+ par.addParam("tabsize", convert<string>(tabsize));
if (extendedchars)
par.addParam("extendedchars", "true");
par.addParams(extra);
}
-void GuiListings::set_listings_msg()
+void GuiListings::setListingsMsg()
{
static bool isOK = true;
docstring msg = validate_listings_params();
breaklinesCB->setChecked(false);
spaceCB->setChecked(false);
spaceInStringCB->setChecked(true);
+ tabsizeSB->setValue(8);
extendedcharsCB->setChecked(false);
// set values from param string
} else if (prefixIs(*it, "showstringspaces=")) {
spaceInStringCB->setChecked(contains(*it, "true"));
*it = "";
+ } else if (prefixIs(*it, "tabsize=")) {
+ tabsizeSB->setValue(convert<int>(plainParam(it->substr(8))));
+ *it = "";
} else if (prefixIs(*it, "extendedchars=")) {
extendedcharsCB->setChecked(contains(*it, "true"));
*it = "";
} // namespace lyx
-#include "GuiListings_moc.cpp"
+#include "moc_GuiListings.cpp"