Minor tweaking of EditVariablesDialog.
This commit is contained in:
@@ -67,6 +67,8 @@ namespace glabels
|
||||
{
|
||||
incrementCombo->addItem( model::Variable::incrementToI18nString( type ) );
|
||||
}
|
||||
|
||||
stepSizeEdit->setText( "1" );
|
||||
}
|
||||
|
||||
|
||||
@@ -157,28 +159,16 @@ namespace glabels
|
||||
case model::Variable::Type::INTEGER:
|
||||
valueEdit->setValidator( new QIntValidator() );
|
||||
stepSizeEdit->setValidator( new QIntValidator() );
|
||||
|
||||
if ( increment == model::Variable::Increment::NEVER )
|
||||
{
|
||||
stepSizeEdit->setText( "0" );
|
||||
}
|
||||
break;
|
||||
|
||||
case model::Variable::Type::FLOATING_POINT:
|
||||
valueEdit->setValidator( new QDoubleValidator() );
|
||||
stepSizeEdit->setValidator( new QDoubleValidator() );
|
||||
|
||||
if ( increment == model::Variable::Increment::NEVER )
|
||||
{
|
||||
stepSizeEdit->setText( "0" );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
valueEdit->setValidator( nullptr );
|
||||
stepSizeEdit->setValidator( nullptr );
|
||||
incrementCombo->setCurrentIndex( static_cast<int>(model::Variable::Increment::NEVER) );
|
||||
stepSizeEdit->setText( "" );
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -186,8 +176,7 @@ namespace glabels
|
||||
bool isNumeric = ( type == model::Variable::Type::INTEGER ) ||
|
||||
( type == model::Variable::Type::FLOATING_POINT );
|
||||
|
||||
incrementLabel->setEnabled( isNumeric );
|
||||
incrementCombo->setEnabled( isNumeric );
|
||||
incrementGroup->setVisible( isNumeric );
|
||||
stepSizeLabel->setEnabled( isNumeric && (increment != model::Variable::Increment::NEVER) );
|
||||
stepSizeEdit->setEnabled( isNumeric && (increment != model::Variable::Increment::NEVER) );
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace glabels
|
||||
"x",
|
||||
"0",
|
||||
model::Variable::Increment::NEVER,
|
||||
"0" );
|
||||
"1" );
|
||||
dialog.setVariable( v );
|
||||
dialog.setWindowTitle( tr("Add Variable") );
|
||||
|
||||
|
||||
@@ -6,73 +6,44 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>471</width>
|
||||
<height>237</height>
|
||||
<width>469</width>
|
||||
<height>297</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Variable type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="typeCombo"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="nameEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Initial value:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="valueEdit"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="incrementLabel">
|
||||
<property name="text">
|
||||
<string>Increment:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="incrementCombo"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="stepSizeLabel">
|
||||
<property name="text">
|
||||
<string>Step size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="stepSizeEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<property name="verticalSpacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="incrementGroup">
|
||||
<property name="title">
|
||||
<string>Increment</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="incrementCombo"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="stepSizeLabel">
|
||||
<property name="text">
|
||||
<string>Step size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="stepSizeEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -85,7 +56,50 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Variable</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="nameEdit"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="valueEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Value:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="typeCombo"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
||||
+16
-12
@@ -184,26 +184,30 @@
|
||||
<source>Dialog</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Variable type:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Initial value:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Increment:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Step size:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Increment</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Variable</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Type:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Value:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Factory</name>
|
||||
|
||||
Reference in New Issue
Block a user