Author: uwestoehr
Date: Sun Nov 7 04:01:26 2010
New Revision: 36180
URL: http://www.lyx.org/trac/changeset/36180
Log:
GuiTabular.cpp:
- apply our naming scheme to unit comboboxes
- set default units
Modified:
lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp
lyx-devel/trunk/src/frontends/qt4/ui/TabularUi.ui
Modified: lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp Sun Nov 7 02:54:47
2010 (r36179)
+++ lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp Sun Nov 7 04:01:26
2010 (r36180)
@@ -54,22 +54,25 @@
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 @@
&& !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 @@
case 2:
if (!topspaceED->text().isEmpty())
setParam(param_str, Tabular::SET_TOP_SPACE,
- widgetsToLength(topspaceED,
topspaceUnit));
+ widgetsToLength(topspaceED,
topspaceUnitCB));
break;
}
@@ -397,7 +400,7 @@
if (!bottomspaceED->text().isEmpty())
setParam(param_str, Tabular::SET_BOTTOM_SPACE,
widgetsToLength(bottomspaceED,
- bottomspaceUnit));
+ bottomspaceUnitCB));
break;
}
@@ -413,7 +416,7 @@
if (!interlinespaceED->text().isEmpty())
setParam(param_str,
Tabular::SET_INTERLINE_SPACE,
widgetsToLength(interlinespaceED,
- interlinespaceUnit));
+ interlinespaceUnitCB));
break;
}
@@ -650,7 +653,7 @@
} else {
topspaceCO->setCurrentIndex(2);
lengthToWidgets(topspaceED,
- topspaceUnit,
+ topspaceUnitCB,
tabular.row_info[row].top_space.asString(),
default_unit);
}
@@ -663,7 +666,7 @@
} else {
bottomspaceCO->setCurrentIndex(2);
lengthToWidgets(bottomspaceED,
- bottomspaceUnit,
+ bottomspaceUnitCB,
tabular.row_info[row].bottom_space.asString(),
default_unit);
}
@@ -676,7 +679,7 @@
} else {
interlinespaceCO->setCurrentIndex(2);
lengthToWidgets(interlinespaceED,
- interlinespaceUnit,
+ interlinespaceUnitCB,
tabular.row_info[row].interline_space.asString(),
default_unit);
}
Modified: lyx-devel/trunk/src/frontends/qt4/ui/TabularUi.ui
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/ui/TabularUi.ui Sun Nov 7 02:54:47
2010 (r36179)
+++ lyx-devel/trunk/src/frontends/qt4/ui/TabularUi.ui Sun Nov 7 04:01:26
2010 (r36180)
@@ -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>