GuiTabular.cpp:

- apply our naming scheme to unit comboboxes
- set default units

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36180 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2010-11-07 03:01:26 +00:00
parent 00e55e1d8c
commit 930729048f
2 changed files with 22 additions and 19 deletions

View File

@ -54,22 +54,25 @@ GuiTabular::GuiTabular(QWidget * parent)
interlinespaceED->setValidator(new LengthValidator(interlinespaceED));
widthUnitCB->setCurrentItem(Length::defaultUnit());
topspaceUnitCB->setCurrentItem(Length::defaultUnit());
bottomspaceUnitCB->setCurrentItem(Length::defaultUnit());
interlinespaceUnitCB->setCurrentItem(Length::defaultUnit());
connect(topspaceED, SIGNAL(textEdited(QString)),
this, SLOT(checkEnabled()));
connect(topspaceUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)),
connect(topspaceUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled()));
connect(topspaceCO, SIGNAL(activated(int)),
this, SLOT(checkEnabled()));
connect(bottomspaceED, SIGNAL(textEdited(QString)),
this, SLOT(checkEnabled()));
connect(bottomspaceUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)),
connect(bottomspaceUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled()));
connect(bottomspaceCO, SIGNAL(activated(int)),
this, SLOT(checkEnabled()));
connect(interlinespaceED, SIGNAL(textEdited(QString)),
this, SLOT(checkEnabled()));
connect(interlinespaceUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)),
connect(interlinespaceUnitCB, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(checkEnabled()));
connect(interlinespaceCO, SIGNAL(activated(int)),
this, SLOT(checkEnabled()));
@ -172,11 +175,11 @@ void GuiTabular::checkEnabled()
&& !widgetsToLength(widthED, widthUnitCB).empty());
topspaceED->setEnabled(topspaceCO->currentIndex() == 2);
topspaceUnit->setEnabled(topspaceCO->currentIndex() == 2);
topspaceUnitCB->setEnabled(topspaceCO->currentIndex() == 2);
bottomspaceED->setEnabled(bottomspaceCO->currentIndex() == 2);
bottomspaceUnit->setEnabled(bottomspaceCO->currentIndex() == 2);
bottomspaceUnitCB->setEnabled(bottomspaceCO->currentIndex() == 2);
interlinespaceED->setEnabled(interlinespaceCO->currentIndex() == 2);
interlinespaceUnit->setEnabled(interlinespaceCO->currentIndex() == 2);
interlinespaceUnitCB->setEnabled(interlinespaceCO->currentIndex() == 2);
// setting as longtable is not allowed when table is inside a float
longTabularCB->setEnabled(funcEnabled(Tabular::SET_LONGTABULAR));
@ -381,7 +384,7 @@ docstring GuiTabular::dialogToParams() const
case 2:
if (!topspaceED->text().isEmpty())
setParam(param_str, Tabular::SET_TOP_SPACE,
widgetsToLength(topspaceED, topspaceUnit));
widgetsToLength(topspaceED, topspaceUnitCB));
break;
}
@ -397,7 +400,7 @@ docstring GuiTabular::dialogToParams() const
if (!bottomspaceED->text().isEmpty())
setParam(param_str, Tabular::SET_BOTTOM_SPACE,
widgetsToLength(bottomspaceED,
bottomspaceUnit));
bottomspaceUnitCB));
break;
}
@ -413,7 +416,7 @@ docstring GuiTabular::dialogToParams() const
if (!interlinespaceED->text().isEmpty())
setParam(param_str, Tabular::SET_INTERLINE_SPACE,
widgetsToLength(interlinespaceED,
interlinespaceUnit));
interlinespaceUnitCB));
break;
}
@ -650,7 +653,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} else {
topspaceCO->setCurrentIndex(2);
lengthToWidgets(topspaceED,
topspaceUnit,
topspaceUnitCB,
tabular.row_info[row].top_space.asString(),
default_unit);
}
@ -663,7 +666,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} else {
bottomspaceCO->setCurrentIndex(2);
lengthToWidgets(bottomspaceED,
bottomspaceUnit,
bottomspaceUnitCB,
tabular.row_info[row].bottom_space.asString(),
default_unit);
}
@ -676,7 +679,7 @@ void GuiTabular::paramsToDialog(Inset const * inset)
} else {
interlinespaceCO->setCurrentIndex(2);
lengthToWidgets(interlinespaceED,
interlinespaceUnit,
interlinespaceUnitCB,
tabular.row_info[row].interline_space.asString(),
default_unit);
}

View File

@ -5,7 +5,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>433</width>
<width>439</width>
<height>376</height>
</rect>
</property>
@ -975,7 +975,7 @@
<widget class="QLineEdit" name="topspaceED"/>
</item>
<item row="0" column="3">
<widget class="LengthCombo" name="topspaceUnit"/>
<widget class="LengthCombo" name="topspaceUnitCB"/>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="topspaceCO">
@ -1016,7 +1016,7 @@
</widget>
</item>
<item row="1" column="3">
<widget class="LengthCombo" name="bottomspaceUnit"/>
<widget class="LengthCombo" name="bottomspaceUnitCB"/>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="bottomspaceED"/>
@ -1064,7 +1064,7 @@
</widget>
</item>
<item row="2" column="3">
<widget class="LengthCombo" name="interlinespaceUnit"/>
<widget class="LengthCombo" name="interlinespaceUnitCB"/>
</item>
</layout>
</widget>
@ -1473,15 +1473,15 @@
<tabstop>borderDefaultRB</tabstop>
<tabstop>booktabsRB</tabstop>
<tabstop>topspaceCO</tabstop>
<tabstop>bottomspaceUnit</tabstop>
<tabstop>bottomspaceUnitCB</tabstop>
<tabstop>topspaceED</tabstop>
<tabstop>topspaceUnit</tabstop>
<tabstop>topspaceUnitCB</tabstop>
<tabstop>bottomspaceCO</tabstop>
<tabstop>bottomspaceED</tabstop>
<tabstop>interlinespaceED</tabstop>
<tabstop>interlinespaceCO</tabstop>
<tabstop>longTabularCB</tabstop>
<tabstop>interlinespaceUnit</tabstop>
<tabstop>interlinespaceUnitCB</tabstop>
<tabstop>headerStatusCB</tabstop>
<tabstop>firstheaderNoContentsCB</tabstop>
<tabstop>headerBorderAboveCB</tabstop>