* Licence details can be found in the file COPYING.
*
* \author Bo Peng
+ * \author Jürgen Spitzmüller
*
* Full author contact details are available in file CREDITS.
*/
connect(breaklinesCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(spaceCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(extendedcharsCB, 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(validate_listings_params()));
bool left = numberLeftCB->checkState() == Qt::Checked;
bool right = numberRightCB->checkState() == Qt::Checked;
- string step = fromqstr(numberStepLE->text());
+ string stepnumber = fromqstr(numberStepLE->text());
string numberfontsize = fromqstr(numberFontSizeCO->currentText());
string firstline = fromqstr(firstlineLE->text());
string lastline = fromqstr(lastlineLE->text());
basicstyle += "\\" + fontstyle;
bool breakline = breaklinesCB->checkState() == Qt::Checked;
bool space = spaceCB->checkState() == Qt::Checked;
- bool extendedchar = extendedcharsCB->checkState() == Qt::Checked;
-
- string caption = fromqstr(captionLE->text());
- string label = fromqstr(labelLE->text());
-
+ bool extendedchars = extendedcharsCB->checkState() == Qt::Checked;
string extra = fromqstr(listingsED->toPlainText());
// compose a string
par.addParam("firstline", firstline);
if (!lastline.empty())
par.addParam("lastline", lastline);
- if (basicstyle != "")
+ if (!stepnumber.empty())
+ par.addParam("stepnumber", stepnumber);
+ if (!basicstyle.empty())
par.addParam("basicstyle", basicstyle);
if (breakline)
par.addParam("breaklines", "true");
if (space)
par.addParam("showspaces", "true");
- if (extendedchar)
+ if (extendedchars)
par.addParam("extendedchars", "true");
- if (!caption.empty())
- par.addParam("caption", "{" + caption + "}");
- if (!label.empty())
- par.addParam("label", "{" + label + "}");
par.addParams(extra);
return par.params();
}
InsetListingsParams par(construct_params());
if (!isOK) {
isOK = true;
- // listingsTB->setTextColor("black");
- listingsTB->setPlainText("Input listings parameters below. Enter ? for a list of parameters.");
+ listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters.");
okPB->setEnabled(true);
}
} catch (invalidParam & e) {
isOK = false;
- // listingsTB->setTextColor("red");
listingsTB->setPlainText(e.what());
okPB->setEnabled(false);
}
bcview().setOK(dialog_->okPB);
bcview().setCancel(dialog_->closePB);
- dialog_->listingsTB->setPlainText("Input listings parameters below. Enter ? for a list of parameters.");
+ dialog_->listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters.");
update_contents();
}
dialog_->lastlineLE->setValidator(new QIntValidator(0, 1000000, this));
dialog_->placementLE->setValidator(new QRegExpValidator(QRegExp("[tbph]*"), this));
- //
- dialog_->listingsTB->setPlainText("Input listings parameters below. Enter ? for a list of parameters.");
+ // set default values
+ dialog_->listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters.");
+ dialog_->languageCO->setCurrentIndex(
+ dialog_->languageCO->findText(toqstr("no language")));
+ dialog_->floatCB->setChecked(false);
+ dialog_->placementLE->clear();
+ dialog_->numberLeftCB->setChecked(false);
+ dialog_->numberRightCB->setChecked(false);
+ dialog_->numberStepLE->clear();
+ dialog_->numberFontSizeCO->setCurrentIndex(
+ dialog_->numberFontSizeCO->findText(toqstr("default")));
+ dialog_->firstlineLE->clear();
+ dialog_->lastlineLE->clear();
+ dialog_->fontstyleCO->setCurrentIndex(
+ dialog_->fontstyleCO->findText(toqstr("default")));
+ dialog_->fontsizeCO->setCurrentIndex(
+ dialog_->fontsizeCO->findText(toqstr("default")));
+ dialog_->breaklinesCB->setChecked(false);
+ dialog_->spaceCB->setChecked(false);
+ dialog_->extendedcharsCB->setChecked(false);
// set values from param string
InsetListingsParams & params = controller().params();
*it = "";
}
} else if (prefixIs(*it, "breaklines=")) {
- dialog_->breaklinesCB->setChecked(prefixIs(*it, "true"));
+ dialog_->breaklinesCB->setChecked(contains(*it, "true"));
*it = "";
} else if (prefixIs(*it, "showspaces=")) {
- dialog_->spaceCB->setChecked(prefixIs(*it, "true"));
+ dialog_->spaceCB->setChecked(contains(*it, "true"));
*it = "";
} else if (prefixIs(*it, "extendedchars=")) {
- dialog_->extendedcharsCB->setChecked(prefixIs(*it, "true"));
- *it = "";
- } else if (prefixIs(*it, "caption=")) {
- string cap = it->substr(8);
- if ((cap[0] == '{' && cap[cap.size()-1] == '}') ||
- (cap[0] == '"' && cap[cap.size()-1] == '"') )
- dialog_->captionLE->setText(toqstr(cap.substr(1, cap.size()-2)));
- else
- dialog_->captionLE->setText(toqstr(cap));
- *it = "";
- } else if (prefixIs(*it, "label=")) {
- string lbl = it->substr(6);
- if ((lbl[0] == '{' && lbl[lbl.size()-1] == '}') ||
- (lbl[0] == '"' && lbl[lbl.size()-1] == '"') )
- dialog_->labelLE->setText(toqstr(lbl.substr(1, lbl.size()-2)));
- else
- dialog_->labelLE->setText(toqstr(lbl));
+ dialog_->extendedcharsCB->setChecked(contains(*it, "true"));
*it = "";
}
}