* Validator.{cpp, h}:

- add usignedGlueLengthValidator

* GuiVSpace.cpp:
	- re-allow the insertion of glue lengths (regression of the qt4 frontend)
	  (bug 6097)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30692 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2009-07-19 16:53:50 +00:00
parent 768b216c83
commit 3020ec058f
3 changed files with 16 additions and 1 deletions

View File

@ -59,7 +59,7 @@ GuiVSpace::GuiVSpace(GuiView & lv)
connect(unitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(change_adaptor()));
valueLE->setValidator(unsignedLengthValidator(valueLE));
valueLE->setValidator(unsignedGlueLengthValidator(valueLE));
// Manage the ok, apply, restore and cancel/close buttons
bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);

View File

@ -89,6 +89,14 @@ LengthValidator * unsignedLengthValidator(QLineEdit * ed)
}
LengthValidator * unsignedGlueLengthValidator(QLineEdit * ed)
{
LengthValidator * v = new LengthValidator(ed);
v->setBottom(GlueLength());
return v;
}
LengthAutoValidator::LengthAutoValidator(QWidget * parent, QString const autotext)
: LengthValidator(parent),
autotext_(autotext)

View File

@ -75,6 +75,13 @@ private:
/// @returns a new @c LengthValidator that does not accept negative lengths.
LengthValidator * unsignedLengthValidator(QLineEdit *);
/** @returns a new @c LengthValidator that does not accept negative lengths.
* but glue lengths.
*/
LengthValidator * unsignedGlueLengthValidator(QLineEdit *);
/** A class to ascertain whether the data passed to the @c validate()
* member function can be interpretted as a GlueLength or is @param autotext.
*/