attempt at consistency in widget naming in tabular dialog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37489 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2011-02-04 13:11:48 +00:00
parent 36b16f4745
commit 7d7b96be78
2 changed files with 106 additions and 107 deletions

View File

@ -49,30 +49,30 @@ GuiTabular::GuiTabular(QWidget * parent)
setupUi(this); setupUi(this);
tabularWidthED->setValidator(unsignedLengthValidator(tabularWidthED)); tabularWidthED->setValidator(unsignedLengthValidator(tabularWidthED));
widthED->setValidator(unsignedLengthValidator(widthED)); columnWidthED->setValidator(unsignedLengthValidator(columnWidthED));
multirowOffsetED->setValidator(new LengthValidator(multirowOffsetED)); multirowOffsetED->setValidator(new LengthValidator(multirowOffsetED));
topspaceED->setValidator(new LengthValidator(topspaceED)); topspaceED->setValidator(new LengthValidator(topspaceED));
bottomspaceED->setValidator(new LengthValidator(bottomspaceED)); bottomspaceED->setValidator(new LengthValidator(bottomspaceED));
interlinespaceED->setValidator(new LengthValidator(interlinespaceED)); interlinespaceED->setValidator(new LengthValidator(interlinespaceED));
tabularWidthUnitCB->setCurrentItem(Length::defaultUnit()); tabularWidthUnitLC->setCurrentItem(Length::defaultUnit());
widthUnitCB->setCurrentItem(Length::defaultUnit()); columnWidthUnitLC->setCurrentItem(Length::defaultUnit());
multirowOffsetUnitCB->setCurrentItem(Length::defaultUnit()); multirowOffsetUnitLC->setCurrentItem(Length::defaultUnit());
topspaceUnitCB->setCurrentItem(Length::defaultUnit()); topspaceUnitLC->setCurrentItem(Length::defaultUnit());
bottomspaceUnitCB->setCurrentItem(Length::defaultUnit()); bottomspaceUnitLC->setCurrentItem(Length::defaultUnit());
interlinespaceUnitCB->setCurrentItem(Length::defaultUnit()); interlinespaceUnitLC->setCurrentItem(Length::defaultUnit());
connect(topspaceED, SIGNAL(editingFinished()), connect(topspaceED, SIGNAL(textEdited(const QString &)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(topspaceUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)), connect(topspaceUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(bottomspaceED, SIGNAL(editingFinished()), connect(bottomspaceED, SIGNAL(textEdited(const QString &)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(bottomspaceUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)), connect(bottomspaceUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(interlinespaceED, SIGNAL(editingFinished()), connect(interlinespaceED, SIGNAL(textEdited(const QString &)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(interlinespaceUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)), connect(interlinespaceUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(booktabsRB, SIGNAL(clicked(bool)), connect(booktabsRB, SIGNAL(clicked(bool)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
@ -82,17 +82,17 @@ GuiTabular::GuiTabular(QWidget * parent)
this, SLOT(borderSet_clicked())); this, SLOT(borderSet_clicked()));
connect(borderUnsetPB, SIGNAL(clicked()), connect(borderUnsetPB, SIGNAL(clicked()),
this, SLOT(borderUnset_clicked())); this, SLOT(borderUnset_clicked()));
connect(hAlignCB, SIGNAL(activated(int)), connect(hAlignCO, SIGNAL(activated(int)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(vAlignCB, SIGNAL(activated(int)), connect(vAlignCO, SIGNAL(activated(int)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(multicolumnCB, SIGNAL(clicked()), connect(multicolumnCB, SIGNAL(clicked()),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(multirowCB, SIGNAL(clicked()), connect(multirowCB, SIGNAL(clicked()),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(multirowOffsetED, SIGNAL(editingFinished()), connect(multirowOffsetED, SIGNAL(textEdited(const QString &)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(multirowOffsetUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)), connect(multirowOffsetUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(newpageCB, SIGNAL(clicked()), connect(newpageCB, SIGNAL(clicked()),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
@ -128,9 +128,9 @@ GuiTabular::GuiTabular(QWidget * parent)
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(specialAlignmentED, SIGNAL(editingFinished()), connect(specialAlignmentED, SIGNAL(editingFinished()),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(widthED, SIGNAL(editingFinished()), connect(columnWidthED, SIGNAL(textEdited(const QString &)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(widthUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)), connect(columnWidthUnitLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(borders, SIGNAL(topSet(bool)), connect(borders, SIGNAL(topSet(bool)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
@ -144,7 +144,7 @@ GuiTabular::GuiTabular(QWidget * parent)
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(rotateCellCB, SIGNAL(clicked()), connect(rotateCellCB, SIGNAL(clicked()),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(TableAlignCB, SIGNAL(activated(int)), connect(TableAlignCO, SIGNAL(activated(int)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
connect(longTabularCB, SIGNAL(clicked()), connect(longTabularCB, SIGNAL(clicked()),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
@ -157,16 +157,16 @@ GuiTabular::GuiTabular(QWidget * parent)
connect(tabularWidthED, SIGNAL(textEdited(const QString &)), connect(tabularWidthED, SIGNAL(textEdited(const QString &)),
this, SLOT(checkEnabled())); this, SLOT(checkEnabled()));
decimalPointLE->setInputMask("X; "); decimalPointED->setInputMask("X; ");
decimalPointLE->setMaxLength(1); decimalPointED->setMaxLength(1);
// initialize the length validator // initialize the length validator
addCheckedWidget(widthED, fixedWidthColLA); addCheckedWidget(columnWidthED, columnWidthLA);
addCheckedWidget(multirowOffsetED, multirowOffsetLA); addCheckedWidget(multirowOffsetED, multirowOffsetLA);
addCheckedWidget(topspaceED, topspaceLA); addCheckedWidget(topspaceED, topspaceLA);
addCheckedWidget(bottomspaceED, bottomspaceLA); addCheckedWidget(bottomspaceED, bottomspaceLA);
addCheckedWidget(interlinespaceED, interlinespaceLA); addCheckedWidget(interlinespaceED, interlinespaceLA);
addCheckedWidget(tabularWidthED, tabularWidthL); addCheckedWidget(tabularWidthED, tabularWidthLA);
} }
@ -174,7 +174,7 @@ void GuiTabular::on_topspaceCO_activated(int index)
{ {
bool const enable = (index == 2); bool const enable = (index == 2);
topspaceED->setEnabled(enable); topspaceED->setEnabled(enable);
topspaceUnitCB->setEnabled(enable); topspaceUnitLC->setEnabled(enable);
} }
@ -182,7 +182,7 @@ void GuiTabular::on_bottomspaceCO_activated(int index)
{ {
bool const enable = (index == 2); bool const enable = (index == 2);
bottomspaceED->setEnabled(enable); bottomspaceED->setEnabled(enable);
bottomspaceUnitCB->setEnabled(enable); bottomspaceUnitLC->setEnabled(enable);
} }
@ -190,7 +190,7 @@ void GuiTabular::on_interlinespaceCO_activated(int index)
{ {
bool const enable = (index == 2); bool const enable = (index == 2);
interlinespaceED->setEnabled(enable); interlinespaceED->setEnabled(enable);
interlinespaceUnitCB->setEnabled(enable); interlinespaceUnitLC->setEnabled(enable);
} }
@ -198,37 +198,37 @@ void GuiTabular::checkEnabled()
{ {
// if there is a LaTeX argument, the width and alignment will be overwritten // if there is a LaTeX argument, the width and alignment will be overwritten
// therefore disable them in this case // therefore disable them in this case
widthED->setEnabled(specialAlignmentED->text().isEmpty()); columnWidthED->setEnabled(specialAlignmentED->text().isEmpty());
// if the column has a width, multirows are always left-aligned // if the column has a width, multirows are always left-aligned
// therefore disable hAlignCB in this case // therefore disable hAlignCB in this case
hAlignCB->setEnabled(!(multirowCB->isChecked() hAlignCO->setEnabled(!(multirowCB->isChecked()
&& !widgetsToLength(widthED, widthUnitCB).empty()) && !widgetsToLength(columnWidthED, columnWidthUnitLC).empty())
&& specialAlignmentED->text().isEmpty()); && specialAlignmentED->text().isEmpty());
bool const dalign = bool const dalign =
hAlignCB->itemData(hAlignCB->currentIndex()).toString() == QString("decimal"); hAlignCO->itemData(hAlignCO->currentIndex()).toString() == QString("decimal");
decimalPointLE->setEnabled(dalign); decimalPointED->setEnabled(dalign);
decimalL->setEnabled(dalign); decimalLA->setEnabled(dalign);
bool const setwidth = TableAlignCB->currentText() == qt_("Middle") bool const setwidth = TableAlignCO->currentText() == qt_("Middle")
&& !longTabularCB->isChecked() && !rotateTabularCB->isChecked(); && !longTabularCB->isChecked() && !rotateTabularCB->isChecked();
tabularWidthL->setEnabled(setwidth); tabularWidthLA->setEnabled(setwidth);
tabularWidthED->setEnabled(setwidth); tabularWidthED->setEnabled(setwidth);
tabularWidthUnitCB->setEnabled(setwidth); tabularWidthUnitLC->setEnabled(setwidth);
bool const is_tabular_star = !tabularWidthED->text().isEmpty(); bool const is_tabular_star = !tabularWidthED->text().isEmpty();
rotateTabularCB->setDisabled(is_tabular_star); rotateTabularCB->setDisabled(is_tabular_star);
vAlignCB->setEnabled(!multirowCB->isChecked() vAlignCO->setEnabled(!multirowCB->isChecked()
&& !widgetsToLength(widthED, widthUnitCB).empty() && !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
&& specialAlignmentED->text().isEmpty()); && specialAlignmentED->text().isEmpty());
topspaceED->setEnabled(topspaceCO->currentIndex() == 2); topspaceED->setEnabled(topspaceCO->currentIndex() == 2);
topspaceED->setEnabled(topspaceCO->currentIndex() == 2); topspaceED->setEnabled(topspaceCO->currentIndex() == 2);
topspaceUnitCB->setEnabled(topspaceCO->currentIndex() == 2); topspaceUnitLC->setEnabled(topspaceCO->currentIndex() == 2);
bottomspaceED->setEnabled(bottomspaceCO->currentIndex() == 2); bottomspaceED->setEnabled(bottomspaceCO->currentIndex() == 2);
bottomspaceUnitCB->setEnabled(bottomspaceCO->currentIndex() == 2); bottomspaceUnitLC->setEnabled(bottomspaceCO->currentIndex() == 2);
interlinespaceED->setEnabled(interlinespaceCO->currentIndex() == 2); interlinespaceED->setEnabled(interlinespaceCO->currentIndex() == 2);
interlinespaceUnitCB->setEnabled(interlinespaceCO->currentIndex() == 2); interlinespaceUnitLC->setEnabled(interlinespaceCO->currentIndex() == 2);
// setting as longtable is not allowed when table is inside a float // setting as longtable is not allowed when table is inside a float
longTabularCB->setEnabled(!is_tabular_star && funcEnabled(Tabular::SET_LONGTABULAR)); longTabularCB->setEnabled(!is_tabular_star && funcEnabled(Tabular::SET_LONGTABULAR));
@ -237,9 +237,8 @@ void GuiTabular::checkEnabled()
newpageCB->setEnabled(longtabular); newpageCB->setEnabled(longtabular);
alignmentGB->setEnabled(longtabular); alignmentGB->setEnabled(longtabular);
// longtables and tabular* cannot have a vertical alignment // longtables and tabular* cannot have a vertical alignment
TableAlignCB->setDisabled(is_tabular_star || longtabular); TableAlignLA->setDisabled(is_tabular_star || longtabular);
TableAlignCO->setDisabled(is_tabular_star || longtabular); TableAlignCO->setDisabled(is_tabular_star || longtabular);
TableAlignCB->setDisabled(is_tabular_star || longtabular);
// FIXME: This Dialog is really horrible, disabling/enabling a checkbox // FIXME: This Dialog is really horrible, disabling/enabling a checkbox
// depending on the cursor position is very very unintuitive... // depending on the cursor position is very very unintuitive...
@ -289,7 +288,7 @@ void GuiTabular::checkEnabled()
multicolumnCB->setEnabled(funcEnabled(Tabular::MULTICOLUMN)); multicolumnCB->setEnabled(funcEnabled(Tabular::MULTICOLUMN));
multirowCB->setEnabled(funcEnabled(Tabular::MULTIROW)); multirowCB->setEnabled(funcEnabled(Tabular::MULTIROW));
multirowOffsetED->setEnabled(multirowCB->isChecked()); multirowOffsetED->setEnabled(multirowCB->isChecked());
multirowOffsetUnitCB->setEnabled(multirowCB->isChecked()); multirowOffsetUnitLC->setEnabled(multirowCB->isChecked());
changed(); changed();
} }
@ -331,7 +330,7 @@ void GuiTabular::setHAlign(string & param_str) const
Tabular::Feature num = Tabular::ALIGN_LEFT; Tabular::Feature num = Tabular::ALIGN_LEFT;
Tabular::Feature multi_num = Tabular::M_ALIGN_LEFT; Tabular::Feature multi_num = Tabular::M_ALIGN_LEFT;
string const align = string const align =
fromqstr(hAlignCB->itemData(hAlignCB->currentIndex()).toString()); fromqstr(hAlignCO->itemData(hAlignCO->currentIndex()).toString());
if (align == "left") { if (align == "left") {
num = Tabular::ALIGN_LEFT; num = Tabular::ALIGN_LEFT;
multi_num = Tabular::M_ALIGN_LEFT; multi_num = Tabular::M_ALIGN_LEFT;
@ -358,7 +357,7 @@ void GuiTabular::setHAlign(string & param_str) const
void GuiTabular::setVAlign(string & param_str) const void GuiTabular::setVAlign(string & param_str) const
{ {
int const align = vAlignCB->currentIndex(); int const align = vAlignCO->currentIndex();
enum VALIGN { TOP, MIDDLE, BOTTOM }; enum VALIGN { TOP, MIDDLE, BOTTOM };
VALIGN v = TOP; VALIGN v = TOP;
@ -394,7 +393,7 @@ void GuiTabular::setVAlign(string & param_str) const
void GuiTabular::setTableAlignment(string & param_str) const void GuiTabular::setTableAlignment(string & param_str) const
{ {
int const align = TableAlignCB->currentIndex(); int const align = TableAlignCO->currentIndex();
switch (align) { switch (align) {
case 0: setParam(param_str, Tabular::TABULAR_VALIGN_TOP); case 0: setParam(param_str, Tabular::TABULAR_VALIGN_TOP);
break; break;
@ -412,7 +411,7 @@ docstring GuiTabular::dialogToParams() const
string param_str = "tabular"; string param_str = "tabular";
// table width // table width
string tabwidth = widgetsToLength(tabularWidthED, tabularWidthUnitCB); string tabwidth = widgetsToLength(tabularWidthED, tabularWidthUnitLC);
if (tabwidth.empty()) if (tabwidth.empty())
tabwidth = "0pt"; tabwidth = "0pt";
setParam(param_str, Tabular::SET_TABULAR_WIDTH, tabwidth); setParam(param_str, Tabular::SET_TABULAR_WIDTH, tabwidth);
@ -420,7 +419,7 @@ docstring GuiTabular::dialogToParams() const
// apply the fixed width values // apply the fixed width values
// this must be done before applying the column alignment // this must be done before applying the column alignment
// because its value influences the alignment of multirow cells // because its value influences the alignment of multirow cells
string width = widgetsToLength(widthED, widthUnitCB); string width = widgetsToLength(columnWidthED, columnWidthUnitLC);
if (width.empty()) if (width.empty())
width = "0pt"; width = "0pt";
if (multicolumnCB->isChecked()) if (multicolumnCB->isChecked())
@ -432,7 +431,7 @@ docstring GuiTabular::dialogToParams() const
setHAlign(param_str); setHAlign(param_str);
// SET_DECIMAL_POINT must come after setHAlign() (ALIGN_DECIMAL) // SET_DECIMAL_POINT must come after setHAlign() (ALIGN_DECIMAL)
string decimal_point = fromqstr(decimalPointLE->text()); string decimal_point = fromqstr(decimalPointED->text());
if (decimal_point.empty()) if (decimal_point.empty())
decimal_point = lyxrc.default_decimal_point; decimal_point = lyxrc.default_decimal_point;
setParam(param_str, Tabular::SET_DECIMAL_POINT, decimal_point); setParam(param_str, Tabular::SET_DECIMAL_POINT, decimal_point);
@ -456,7 +455,7 @@ docstring GuiTabular::dialogToParams() const
case 2: case 2:
if (!topspaceED->text().isEmpty()) if (!topspaceED->text().isEmpty())
setParam(param_str, Tabular::SET_TOP_SPACE, setParam(param_str, Tabular::SET_TOP_SPACE,
widgetsToLength(topspaceED, topspaceUnitCB)); widgetsToLength(topspaceED, topspaceUnitLC));
break; break;
} }
@ -472,7 +471,7 @@ docstring GuiTabular::dialogToParams() const
if (!bottomspaceED->text().isEmpty()) if (!bottomspaceED->text().isEmpty())
setParam(param_str, Tabular::SET_BOTTOM_SPACE, setParam(param_str, Tabular::SET_BOTTOM_SPACE,
widgetsToLength(bottomspaceED, widgetsToLength(bottomspaceED,
bottomspaceUnitCB)); bottomspaceUnitLC));
break; break;
} }
@ -488,7 +487,7 @@ docstring GuiTabular::dialogToParams() const
if (!interlinespaceED->text().isEmpty()) if (!interlinespaceED->text().isEmpty())
setParam(param_str, Tabular::SET_INTERLINE_SPACE, setParam(param_str, Tabular::SET_INTERLINE_SPACE,
widgetsToLength(interlinespaceED, widgetsToLength(interlinespaceED,
interlinespaceUnitCB)); interlinespaceUnitLC));
break; break;
} }
@ -526,7 +525,7 @@ docstring GuiTabular::dialogToParams() const
setParam(param_str, Tabular::UNSET_MULTICOLUMN); setParam(param_str, Tabular::UNSET_MULTICOLUMN);
// apply the multirow offset // apply the multirow offset
string mroffset = widgetsToLength(multirowOffsetED, multirowOffsetUnitCB); string mroffset = widgetsToLength(multirowOffsetED, multirowOffsetUnitLC);
if (mroffset.empty()) if (mroffset.empty())
mroffset = "0pt"; mroffset = "0pt";
if (multirowCB->isChecked()) if (multirowCB->isChecked())
@ -702,7 +701,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
if (tabwidth.zero()) if (tabwidth.zero())
tabularWidthED->clear(); tabularWidthED->clear();
else else
lengthToWidgets(tabularWidthED, tabularWidthUnitCB, lengthToWidgets(tabularWidthED, tabularWidthUnitLC,
tabwidth.asString(), default_unit); tabwidth.asString(), default_unit);
Length pwidth; Length pwidth;
@ -718,10 +717,10 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} }
string colwidth; string colwidth;
if (pwidth.zero()) if (pwidth.zero())
widthED->clear(); columnWidthED->clear();
else { else {
colwidth = pwidth.asString(); colwidth = pwidth.asString();
lengthToWidgets(widthED, widthUnitCB, lengthToWidgets(columnWidthED, columnWidthUnitLC,
colwidth, default_unit); colwidth, default_unit);
} }
Length mroffset; Length mroffset;
@ -732,7 +731,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
multirowOffsetED->clear(); multirowOffsetED->clear();
else { else {
offset = mroffset.asString(); offset = mroffset.asString();
lengthToWidgets(multirowOffsetED, multirowOffsetUnitCB, lengthToWidgets(multirowOffsetED, multirowOffsetUnitLC,
offset, default_unit); offset, default_unit);
} }
specialAlignmentED->setText(toqstr(special)); specialAlignmentED->setText(toqstr(special));
@ -750,7 +749,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} else { } else {
topspaceCO->setCurrentIndex(2); topspaceCO->setCurrentIndex(2);
lengthToWidgets(topspaceED, lengthToWidgets(topspaceED,
topspaceUnitCB, topspaceUnitLC,
tabular.row_info[row].top_space.asString(), tabular.row_info[row].top_space.asString(),
default_unit); default_unit);
} }
@ -763,7 +762,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} else { } else {
bottomspaceCO->setCurrentIndex(2); bottomspaceCO->setCurrentIndex(2);
lengthToWidgets(bottomspaceED, lengthToWidgets(bottomspaceED,
bottomspaceUnitCB, bottomspaceUnitLC,
tabular.row_info[row].bottom_space.asString(), tabular.row_info[row].bottom_space.asString(),
default_unit); default_unit);
} }
@ -776,19 +775,19 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} else { } else {
interlinespaceCO->setCurrentIndex(2); interlinespaceCO->setCurrentIndex(2);
lengthToWidgets(interlinespaceED, lengthToWidgets(interlinespaceED,
interlinespaceUnitCB, interlinespaceUnitLC,
tabular.row_info[row].interline_space.asString(), tabular.row_info[row].interline_space.asString(),
default_unit); default_unit);
} }
hAlignCB->clear(); hAlignCO->clear();
hAlignCB->addItem(qt_("Left"), toqstr("left")); hAlignCO->addItem(qt_("Left"), toqstr("left"));
hAlignCB->addItem(qt_("Center"), toqstr("center")); hAlignCO->addItem(qt_("Center"), toqstr("center"));
hAlignCB->addItem(qt_("Right"), toqstr("right")); hAlignCO->addItem(qt_("Right"), toqstr("right"));
if (!multicol && !pwidth.zero()) if (!multicol && !pwidth.zero())
hAlignCB->addItem(qt_("Justified"), toqstr("justified")); hAlignCO->addItem(qt_("Justified"), toqstr("justified"));
if (!multicol) if (!multicol)
hAlignCB->addItem(qt_("At Decimal Separator"), toqstr("decimal")); hAlignCO->addItem(qt_("At Decimal Separator"), toqstr("decimal"));
string align; string align;
switch (tabular.getAlignment(cell)) { switch (tabular.getAlignment(cell)) {
@ -817,13 +816,13 @@ void GuiTabular::paramsToDialog(Inset const * inset)
// we should never end up here // we should never end up here
break; break;
} }
hAlignCB->setCurrentIndex(hAlignCB->findData(toqstr(align))); hAlignCO->setCurrentIndex(hAlignCO->findData(toqstr(align)));
// //
QString decimal_point = toqstr(tabular.column_info[col].decimal_point); QString decimal_point = toqstr(tabular.column_info[col].decimal_point);
if (decimal_point.isEmpty()) if (decimal_point.isEmpty())
decimal_point = toqstr(from_utf8(lyxrc.default_decimal_point)); decimal_point = toqstr(from_utf8(lyxrc.default_decimal_point));
decimalPointLE->setText(decimal_point); decimalPointED->setText(decimal_point);
int valign = 0; int valign = 0;
switch (tabular.getVAlignment(cell)) { switch (tabular.getVAlignment(cell)) {
@ -842,7 +841,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} }
if (pwidth.zero()) if (pwidth.zero())
valign = 0; valign = 0;
vAlignCB->setCurrentIndex(valign); vAlignCO->setCurrentIndex(valign);
int tableValign = 1; int tableValign = 1;
switch (tabular.tabular_valignment) { switch (tabular.tabular_valignment) {
@ -859,7 +858,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
tableValign = 0; tableValign = 0;
break; break;
} }
TableAlignCB->setCurrentIndex(tableValign); TableAlignCO->setCurrentIndex(tableValign);
if (!tabular.is_long_tabular) { if (!tabular.is_long_tabular) {
headerStatusCB->setChecked(false); headerStatusCB->setChecked(false);
@ -884,7 +883,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
return; return;
} else { } else {
// longtables cannot have a vertical alignment // longtables cannot have a vertical alignment
TableAlignCB->setCurrentIndex(Tabular::LYX_VALIGN_MIDDLE); TableAlignCO->setCurrentIndex(Tabular::LYX_VALIGN_MIDDLE);
} }
switch (tabular.longtabular_alignment) { switch (tabular.longtabular_alignment) {
case Tabular::LYX_LONGTABULAR_ALIGN_LEFT: case Tabular::LYX_LONGTABULAR_ALIGN_LEFT:

View File

@ -42,17 +42,17 @@
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="hAlignCO"> <widget class="QLabel" name="hAlignLA">
<property name="text"> <property name="text">
<string>&amp;Horizontal alignment:</string> <string>&amp;Horizontal alignment:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>hAlignCB</cstring> <cstring>hAlignCO</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QComboBox" name="hAlignCB"> <widget class="QComboBox" name="hAlignCO">
<property name="toolTip"> <property name="toolTip">
<string>Horizontal alignment in column</string> <string>Horizontal alignment in column</string>
</property> </property>
@ -102,7 +102,7 @@
<item row="0" column="3" colspan="2"> <item row="0" column="3" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="decimalL"> <widget class="QLabel" name="decimalLA">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -110,12 +110,12 @@
<string>&amp;Decimal separator:</string> <string>&amp;Decimal separator:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>decimalPointLE</cstring> <cstring>decimalPointED</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="decimalPointLE"> <widget class="QLineEdit" name="decimalPointED">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -148,19 +148,19 @@
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="fixedWidthColLA"> <widget class="QLabel" name="columnWidthLA">
<property name="text"> <property name="text">
<string>&amp;Width:</string> <string>&amp;Width:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>widthED</cstring> <cstring>columnWidthED</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" colspan="3"> <item row="1" column="1" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLineEdit" name="widthED"> <widget class="QLineEdit" name="columnWidthED">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -173,7 +173,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="LengthCombo" name="widthUnitCB"/> <widget class="LengthCombo" name="columnWidthUnitLC"/>
</item> </item>
</layout> </layout>
</item> </item>
@ -191,17 +191,17 @@
</spacer> </spacer>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="vAlignCO"> <widget class="QLabel" name="vAlignLA">
<property name="text"> <property name="text">
<string>&amp;Vertical alignment in row:</string> <string>&amp;Vertical alignment in row:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>vAlignCB</cstring> <cstring>vAlignCO</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QComboBox" name="vAlignCB"> <widget class="QComboBox" name="vAlignCO">
<property name="toolTip"> <property name="toolTip">
<string>Specifies the vertical alignment of this cell in relation to the baseline of the row.</string> <string>Specifies the vertical alignment of this cell in relation to the baseline of the row.</string>
</property> </property>
@ -262,7 +262,7 @@
<string>&amp;Vertical Offset:</string> <string>&amp;Vertical Offset:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>widthED</cstring> <cstring>columnWidthED</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -280,7 +280,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="LengthCombo" name="multirowOffsetUnitCB"/> <widget class="LengthCombo" name="multirowOffsetUnitLC"/>
</item> </item>
</layout> </layout>
</item> </item>
@ -333,7 +333,7 @@
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="tabularWidthL"> <widget class="QLabel" name="tabularWidthLA">
<property name="text"> <property name="text">
<string>Table w&amp;idth:</string> <string>Table w&amp;idth:</string>
</property> </property>
@ -343,23 +343,23 @@
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="LengthCombo" name="tabularWidthUnitCB"/> <widget class="LengthCombo" name="tabularWidthUnitLC"/>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="tabularWidthED"/> <widget class="QLineEdit" name="tabularWidthED"/>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="TableAlignCO"> <widget class="QLabel" name="TableAlignLA">
<property name="text"> <property name="text">
<string>Verti&amp;cal alignment:</string> <string>Verti&amp;cal alignment:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>vAlignCB</cstring> <cstring>vAlignCO</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QComboBox" name="TableAlignCB"> <widget class="QComboBox" name="TableAlignCO">
<property name="toolTip"> <property name="toolTip">
<string>Vertical alignment of the table</string> <string>Vertical alignment of the table</string>
</property> </property>
@ -1028,7 +1028,7 @@
<widget class="QLineEdit" name="topspaceED"/> <widget class="QLineEdit" name="topspaceED"/>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="LengthCombo" name="topspaceUnitCB"/> <widget class="LengthCombo" name="topspaceUnitLC"/>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QComboBox" name="topspaceCO"> <widget class="QComboBox" name="topspaceCO">
@ -1069,7 +1069,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="1" column="3">
<widget class="LengthCombo" name="bottomspaceUnitCB"/> <widget class="LengthCombo" name="bottomspaceUnitLC"/>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QLineEdit" name="bottomspaceED"/> <widget class="QLineEdit" name="bottomspaceED"/>
@ -1117,7 +1117,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="2" column="3">
<widget class="LengthCombo" name="interlinespaceUnitCB"/> <widget class="LengthCombo" name="interlinespaceUnitLC"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -1512,19 +1512,19 @@
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>TabWidget</tabstop> <tabstop>TabWidget</tabstop>
<tabstop>hAlignCB</tabstop> <tabstop>hAlignCO</tabstop>
<tabstop>decimalPointLE</tabstop> <tabstop>decimalPointED</tabstop>
<tabstop>widthED</tabstop> <tabstop>columnWidthED</tabstop>
<tabstop>widthUnitCB</tabstop> <tabstop>columnWidthUnitLC</tabstop>
<tabstop>vAlignCB</tabstop> <tabstop>vAlignCO</tabstop>
<tabstop>multicolumnCB</tabstop> <tabstop>multicolumnCB</tabstop>
<tabstop>multirowCB</tabstop> <tabstop>multirowCB</tabstop>
<tabstop>multirowOffsetED</tabstop> <tabstop>multirowOffsetED</tabstop>
<tabstop>multirowOffsetUnitCB</tabstop> <tabstop>multirowOffsetUnitLC</tabstop>
<tabstop>rotateCellCB</tabstop> <tabstop>rotateCellCB</tabstop>
<tabstop>tabularWidthED</tabstop> <tabstop>tabularWidthED</tabstop>
<tabstop>tabularWidthUnitCB</tabstop> <tabstop>tabularWidthUnitLC</tabstop>
<tabstop>TableAlignCB</tabstop> <tabstop>TableAlignCO</tabstop>
<tabstop>rotateTabularCB</tabstop> <tabstop>rotateTabularCB</tabstop>
<tabstop>specialAlignmentED</tabstop> <tabstop>specialAlignmentED</tabstop>
<tabstop>borderSetPB</tabstop> <tabstop>borderSetPB</tabstop>
@ -1533,13 +1533,13 @@
<tabstop>booktabsRB</tabstop> <tabstop>booktabsRB</tabstop>
<tabstop>topspaceCO</tabstop> <tabstop>topspaceCO</tabstop>
<tabstop>topspaceED</tabstop> <tabstop>topspaceED</tabstop>
<tabstop>topspaceUnitCB</tabstop> <tabstop>topspaceUnitLC</tabstop>
<tabstop>bottomspaceCO</tabstop> <tabstop>bottomspaceCO</tabstop>
<tabstop>bottomspaceED</tabstop> <tabstop>bottomspaceED</tabstop>
<tabstop>bottomspaceUnitCB</tabstop> <tabstop>bottomspaceUnitLC</tabstop>
<tabstop>interlinespaceCO</tabstop> <tabstop>interlinespaceCO</tabstop>
<tabstop>interlinespaceED</tabstop> <tabstop>interlinespaceED</tabstop>
<tabstop>interlinespaceUnitCB</tabstop> <tabstop>interlinespaceUnitLC</tabstop>
<tabstop>longTabularCB</tabstop> <tabstop>longTabularCB</tabstop>
<tabstop>headerStatusCB</tabstop> <tabstop>headerStatusCB</tabstop>
<tabstop>headerBorderAboveCB</tabstop> <tabstop>headerBorderAboveCB</tabstop>