void GuiPrintNomencl::paramsToDialog(InsetCommandParams const & /*icp*/) { setWidthCO->setCurrentIndex( setWidthCO->findData(toqstr(params_["set_width"]))); lengthToWidgets(valueLE, unitLC, params_["width"], Length::defaultUnit()); bc().setValid(isValid()); }
void lengthToWidgets(QLineEdit * input, LengthCombo * combo, string const & len, Length::UNIT defaultUnit) { if (len.empty()) { // no length (UNIT_NONE) combo->setCurrentItem(defaultUnit); input->setText(""); } else if (!isValidLength(len) && !isStrDbl(len)) { // use input field only for gluelengths combo->setCurrentItem(defaultUnit); input->setText(toqstr(len)); } else { lengthToWidgets(input, combo, Length(len), defaultUnit); } }
void lengthToWidgets(QLineEdit * input, LengthCombo * combo, docstring const & len, Length::UNIT defaultUnit) { lengthToWidgets(input, combo, to_utf8(len), defaultUnit); }