the fix for the enabling/disabling of the placement options (bug 1016) was not yet perfect. It should be now.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8586 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2004-04-01 16:06:34 +00:00
parent a6c8ac4791
commit 61290c38be
3 changed files with 27 additions and 24 deletions

View File

@ -1,3 +1,8 @@
2004-01-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* floatplacement.[Ch]: correct fix for enabling of placement
values (bug 1016)
2004-03-31 Angus Leeming <leeming@lyx.org>
* Dialogs2.C:

View File

@ -61,12 +61,7 @@ FloatPlacement::FloatPlacement(QWidget * parent, char * name)
toplayout->addLayout(layout);
connect(defaultsCB, SIGNAL(toggled(bool)), options, SLOT(setDisabled(bool)));
connect(defaultsCB, SIGNAL(toggled(bool)), ignoreCB, SLOT(setDisabled(bool)));
connect(defaultsCB, SIGNAL(toggled(bool)), pageCB, SLOT(setDisabled(bool)));
connect(defaultsCB, SIGNAL(toggled(bool)), heredefinitelyCB, SLOT(setDisabled(bool)));
connect(defaultsCB, SIGNAL(toggled(bool)), herepossiblyCB, SLOT(setDisabled(bool)));
connect(defaultsCB, SIGNAL(toggled(bool)), bottomCB, SLOT(setDisabled(bool)));
connect(defaultsCB, SIGNAL(toggled(bool)), topCB, SLOT(setDisabled(bool)));
connect(defaultsCB, SIGNAL(toggled(bool)), this, SLOT(defClicked()));
connect(heredefinitelyCB, SIGNAL(clicked()), this, SLOT(heredefinitelyClicked()));
connect(topCB, SIGNAL(clicked()), this, SLOT(tbhpClicked()));
@ -210,6 +205,12 @@ string const FloatPlacement::get() const
}
void FloatPlacement::defClicked()
{
checkAllowed();
}
void FloatPlacement::tbhpClicked()
{
heredefinitelyCB->setChecked(false);
@ -236,15 +237,9 @@ void FloatPlacement::heredefinitelyClicked()
void FloatPlacement::spanClicked()
{
bool const span(spanCB->isChecked());
checkAllowed();
if (!defaultsCB->isChecked()) {
herepossiblyCB->setEnabled(!span);
heredefinitelyCB->setEnabled(!span);
bottomCB->setEnabled(!span);
}
if (!span)
if (!spanCB->isChecked())
return;
herepossiblyCB->setChecked(false);
@ -255,24 +250,25 @@ void FloatPlacement::spanClicked()
void FloatPlacement::sidewaysClicked()
{
bool const sideways(sidewaysCB->isChecked());
bool const span(spanCB->isChecked());
checkAllowed();
}
void FloatPlacement::checkAllowed()
{
bool const defaults(defaultsCB->isChecked());
bool ignore(topCB->isChecked());
ignore |= bottomCB->isChecked();
ignore |= pageCB->isChecked();
ignore |= herepossiblyCB->isChecked();
bool const span(spanCB->isChecked());
bool const sideways(sidewaysCB->isChecked());
defaultsCB->setEnabled(!sideways);
topCB->setEnabled(!sideways && !defaults);
bottomCB->setEnabled(!sideways && !defaults);
bottomCB->setEnabled(!sideways && !defaults && !span);
pageCB->setEnabled(!sideways && !defaults);
spanCB->setEnabled(!sideways);
ignoreCB->setEnabled(!sideways && !defaults && ignore);
herepossiblyCB->setEnabled(!sideways && !defaults);
heredefinitelyCB->setEnabled(!sideways && !defaults);
if (!sideways && !defaults) {
herepossiblyCB->setEnabled(!span);
heredefinitelyCB->setEnabled(!span);
}
herepossiblyCB->setEnabled(!sideways && !defaults && !span);
heredefinitelyCB->setEnabled(!sideways && !defaults && !span);
}

View File

@ -28,11 +28,13 @@ public:
void set(InsetFloatParams const & params);
void set(std::string const & placement);
void checkAllowed();
std::string const get(bool & wide, bool & sideways) const;
std::string const get() const;
public slots:
void defClicked();
void tbhpClicked();
void heredefinitelyClicked();
void spanClicked();