Fix bug 8880: do not try to validate custom value if it is disabled

This commit is contained in:
Juergen Spitzmueller 2013-11-12 15:48:34 +01:00
parent 6f488a9ef2
commit 7e22abec5d
2 changed files with 9 additions and 1 deletions

View File

@ -104,12 +104,16 @@ void GuiHSpace::enableWidgets()
QString const selection = spacingCO->itemData(spacingCO->currentIndex()).toString();
bool const custom = selection == "custom";
valueLE->setEnabled(custom);
valueL->setEnabled(custom);
unitCO->setEnabled(custom);
fillPatternCO->setEnabled(!math_mode_ && selection == "hfill");
fillPatternL->setEnabled(!math_mode_ && selection == "hfill");
bool const no_pattern = fillPatternCO->currentIndex() == 0 || math_mode_;
bool const enable_keep =
selection == "normal" || selection == "halfquad" || (selection == "hfill" && no_pattern) || custom;
selection == "normal" || selection == "halfquad"
|| (selection == "hfill" && no_pattern) || custom;
keepCB->setEnabled(enable_keep);
keepL->setEnabled(enable_keep);
}

View File

@ -29,6 +29,10 @@ CheckedWidget::CheckedWidget(QLineEdit * input, QWidget * label)
bool CheckedWidget::check() const
{
// Ignore if widget is disabled.
if (!input_->isEnabled())
return true;
bool const valid = input_->hasAcceptableInput();
// Visual feedback.
setValid(input_, valid);