}
-void GuiPrintNomencl::on_setWidthCO_activated(int i)
+void GuiPrintNomencl::on_setWidthCO_activated(int /*i*/)
{
- bool const custom =
- (setWidthCO->itemData(i).toString()
- == "custom");
- valueLE->setEnabled(custom);
- unitLC->setEnabled(custom);
- valueLA->setEnabled(custom);
changed();
}
{
setWidthCO->setCurrentIndex(
setWidthCO->findData(toqstr(params["set_width"])));
-
- lengthToWidgets(valueLE,
- unitLC,
- params["width"],
- Length::defaultUnit());
+
+ lengthToWidgets(valueLE, unitLC,
+ params["width"], Length::defaultUnit());
}
}
-bool GuiPrintNomencl::checkWidgets() const
+bool GuiPrintNomencl::checkWidgets(bool readonly) const
{
+ valueLE->setReadOnly(readonly);
+ if (readonly) {
+ setWidthCO->setEnabled(false);
+ unitLC->setEnabled(false);
+ valueLA->setEnabled(false);
+ } else {
+ bool const custom =
+ (setWidthCO->itemData(setWidthCO->currentIndex()).toString() == "custom");
+ valueLE->setEnabled(custom);
+ unitLC->setEnabled(custom);
+ valueLA->setEnabled(custom);
+ }
+
if (!InsetParamsWidget::checkWidgets())
return false;
return setWidthCO->itemData(