Fix a few enable/disable problems for longtables:

- set header, set first-header-empty, unset first-header-empty,
- set header, set first-header-empty, unset header

The same also for footers.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29716 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-05-17 18:27:39 +00:00
parent 34479058ad
commit 7ff6379445

View File

@ -448,9 +448,6 @@ void GuiTabular::ltHeaderStatus_clicked()
set(Tabular::SET_LTHEAD, ""); set(Tabular::SET_LTHEAD, "");
else else
set(Tabular::UNSET_LTHEAD, ""); set(Tabular::UNSET_LTHEAD, "");
headerBorderAboveCB->setEnabled(enable);
headerBorderBelowCB->setEnabled(enable);
firstheaderNoContentsCB->setEnabled(enable);
changed(); changed();
} }
@ -502,8 +499,6 @@ void GuiTabular::ltFirstHeaderStatus_clicked()
set(Tabular::SET_LTFIRSTHEAD, ""); set(Tabular::SET_LTFIRSTHEAD, "");
else else
set(Tabular::UNSET_LTFIRSTHEAD, ""); set(Tabular::UNSET_LTFIRSTHEAD, "");
firstheaderBorderAboveCB->setEnabled(enable);
firstheaderBorderBelowCB->setEnabled(enable);
changed(); changed();
} }
@ -515,9 +510,6 @@ void GuiTabular::ltFirstHeaderEmpty_clicked()
set(Tabular::SET_LTFIRSTHEAD, "empty"); set(Tabular::SET_LTFIRSTHEAD, "empty");
else else
set(Tabular::UNSET_LTFIRSTHEAD, "empty"); set(Tabular::UNSET_LTFIRSTHEAD, "empty");
firstheaderStatusCB->setEnabled(!enable);
firstheaderBorderAboveCB->setEnabled(!enable);
firstheaderBorderBelowCB->setEnabled(!enable);
changed(); changed();
} }
@ -529,9 +521,6 @@ void GuiTabular::ltFooterStatus_clicked()
set(Tabular::SET_LTFOOT, ""); set(Tabular::SET_LTFOOT, "");
else else
set(Tabular::UNSET_LTFOOT, ""); set(Tabular::UNSET_LTFOOT, "");
footerBorderAboveCB->setEnabled(enable);
footerBorderBelowCB->setEnabled(enable);
lastfooterNoContentsCB->setEnabled(enable);
changed(); changed();
} }
@ -563,8 +552,6 @@ void GuiTabular::ltLastFooterStatus_clicked()
set(Tabular::SET_LTLASTFOOT, ""); set(Tabular::SET_LTLASTFOOT, "");
else else
set(Tabular::UNSET_LTLASTFOOT, ""); set(Tabular::UNSET_LTLASTFOOT, "");
lastfooterBorderAboveCB->setEnabled(enable);
lastfooterBorderBelowCB->setEnabled(enable);
changed(); changed();
} }
@ -596,9 +583,6 @@ void GuiTabular::ltLastFooterEmpty_clicked()
set(Tabular::SET_LTLASTFOOT, "empty"); set(Tabular::SET_LTLASTFOOT, "empty");
else else
set(Tabular::UNSET_LTLASTFOOT, "empty"); set(Tabular::UNSET_LTLASTFOOT, "empty");
lastfooterStatusCB->setEnabled(!enable);
lastfooterBorderAboveCB->setEnabled(!enable);
lastfooterBorderBelowCB->setEnabled(!enable);
changed(); changed();
} }
@ -838,12 +822,7 @@ void GuiTabular::updateContents()
// first header can only be suppressed when there is a header // first header can only be suppressed when there is a header
firstheaderNoContentsCB->setEnabled(tabular_.haveLTHead() firstheaderNoContentsCB->setEnabled(tabular_.haveLTHead()
&& !tabular_.haveLTFirstHead()); && !tabular_.haveLTFirstHead());
// check if setting a first header is allowed
// additionally check firstheaderStatusCB because when this is the
// case a first header makes no sense
firstheaderStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTFIRSTHEAD)
&& !firstheaderNoContentsCB->isChecked());
//firstheaderStatusCB->setEnabled( //firstheaderStatusCB->setEnabled(
// !firstheaderNoContentsCB->isChecked()); // !firstheaderNoContentsCB->isChecked());
headerBorderAboveCB->setEnabled(funcEnabled(Tabular::SET_LTHEAD)); headerBorderAboveCB->setEnabled(funcEnabled(Tabular::SET_LTHEAD));
@ -859,12 +838,7 @@ void GuiTabular::updateContents()
// last footer can only be suppressed when there is a footer // last footer can only be suppressed when there is a footer
lastfooterNoContentsCB->setEnabled(tabular_.haveLTFoot() lastfooterNoContentsCB->setEnabled(tabular_.haveLTFoot()
&& !tabular_.haveLTLastFoot()); && !tabular_.haveLTLastFoot());
// check if setting a last footer is allowed
// additionally check lastfooterNoContentsCB because when this is
// the case a last footer makes no sense
lastfooterStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTLASTFOOT)
&& !lastfooterNoContentsCB->isChecked());
captionStatusCB->setEnabled( captionStatusCB->setEnabled(
funcEnabled(Tabular::TOGGLE_LTCAPTION)); funcEnabled(Tabular::TOGGLE_LTCAPTION));
// When a row is set as longtable caption, it must not be allowed // When a row is set as longtable caption, it must not be allowed
@ -890,6 +864,12 @@ void GuiTabular::updateContents()
} }
row_set = tabular_.getRowOfLTFirstHead(row, ltt); row_set = tabular_.getRowOfLTFirstHead(row, ltt);
// check if setting a first header is allowed
// additionally check firstheaderStatusCB because when this is the
// case a first header makes no sense
firstheaderStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTFIRSTHEAD)
&& !firstheaderNoContentsCB->isChecked());
firstheaderStatusCB->setChecked(row_set); firstheaderStatusCB->setChecked(row_set);
if (ltt.set && (!ltt.empty || !use_empty)) { if (ltt.set && (!ltt.empty || !use_empty)) {
firstheaderBorderAboveCB->setChecked(ltt.topDL); firstheaderBorderAboveCB->setChecked(ltt.topDL);
@ -922,6 +902,12 @@ void GuiTabular::updateContents()
} }
row_set = tabular_.getRowOfLTLastFoot(row, ltt); row_set = tabular_.getRowOfLTLastFoot(row, ltt);
// check if setting a last footer is allowed
// additionally check lastfooterNoContentsCB because when this is
// the case a last footer makes no sense
lastfooterStatusCB->setEnabled(
funcEnabled(Tabular::SET_LTLASTFOOT)
&& !lastfooterNoContentsCB->isChecked());
lastfooterStatusCB->setChecked(row_set); lastfooterStatusCB->setChecked(row_set);
if (ltt.set && (!ltt.empty || !use_empty)) { if (ltt.set && (!ltt.empty || !use_empty)) {
lastfooterBorderAboveCB->setChecked(ltt.topDL); lastfooterBorderAboveCB->setChecked(ltt.topDL);