Skip to content

Commit

Permalink
Automatically sample on field calculator and gui tidy ups
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14665 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 14, 2010
1 parent d373f12 commit 0ba9cbf
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 64 deletions.
9 changes: 4 additions & 5 deletions src/app/qgsfieldcalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,6 @@ void QgsFieldCalculator::on_mConcatButton_clicked()
mExpressionTextEdit->insertPlainText( "||" );
}

void QgsFieldCalculator::on_mSamplePushButton_clicked()
{
getFieldValues( 25 );
}

void QgsFieldCalculator::on_mAllPushButton_clicked()
{
getFieldValues( 0 );
Expand Down Expand Up @@ -504,3 +499,7 @@ void QgsFieldCalculator::setOkButtonState()
}


void QgsFieldCalculator::on_mFieldsListWidget_currentItemChanged(QListWidgetItem * current, QListWidgetItem * previous )
{
getFieldValues( 25 );
}
2 changes: 1 addition & 1 deletion src/app/qgsfieldcalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ class QgsFieldCalculator: public QDialog, private Ui::QgsFieldCalculatorBase
void on_mAreaButton_clicked();
void on_mRowNumButton_clicked();
void on_mConcatButton_clicked();
void on_mSamplePushButton_clicked();
void on_mAllPushButton_clicked();
void on_mOutputFieldNameLineEdit_textChanged( const QString& text );
void on_mExpressionTextEdit_textChanged();
void on_mOutputFieldTypeComboBox_activated( int index );
void on_mFieldsListWidget_currentItemChanged(QListWidgetItem * current, QListWidgetItem * previous );

void on_mButtonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

Expand Down
151 changes: 93 additions & 58 deletions src/ui/qgsfieldcalculatorbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,40 @@
<rect>
<x>0</x>
<y>0</y>
<width>624</width>
<height>686</height>
<width>689</width>
<height>569</height>
</rect>
</property>
<property name="windowTitle">
<string>Field calculator</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="mUpdateExistingFieldCheckBox">
<widget class="QCheckBox" name="mOnlyUpdateSelectedCheckBox">
<property name="text">
<string>Update existing field</string>
<string>Only update selected features</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="mExistingFieldComboBox"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="mOnlyUpdateSelectedCheckBox">
<widget class="QCheckBox" name="mUpdateExistingFieldCheckBox">
<property name="text">
<string>Only update selected features</string>
<string>Update existing field</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="0" column="2">
<widget class="QComboBox" name="mExistingFieldComboBox"/>
</item>
<item row="1" column="0" colspan="3">
<widget class="QGroupBox" name="mNewFieldGroupBox">
<property name="title">
<string>New field</string>
</property>
<layout class="QGridLayout">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="mFieldNameLabel">
<property name="text">
Expand Down Expand Up @@ -74,56 +77,32 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="mOuputFieldWidthSpinBox"/>
<widget class="QSpinBox" name="mOuputFieldWidthSpinBox">
<property name="toolTip">
<string>Width of complete output. For example 123,456 means 6 as field width.</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="mOutputFieldPrecisionLabel">
<property name="text">
<string>Output field precision</string>
<string>Precision</string>
</property>
<property name="buddy">
<cstring>mOutputFieldPrecisionSpinBox</cstring>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QSpinBox" name="mOutputFieldPrecisionSpinBox"/>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="mFieldsGroupBox">
<property name="title">
<string>Fields</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QListWidget" name="mFieldsListWidget"/>
</item>
</layout>
</widget>
</item>
<item row="3" column="2">
<widget class="QGroupBox" name="mValuesGroupBox">
<property name="title">
<string>Values</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0" colspan="2">
<widget class="QListWidget" name="mValueListWidget"/>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="mSamplePushButton">
<property name="text">
<string>Sample</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="mAllPushButton">
<property name="text">
<string>All</string>
<widget class="QSpinBox" name="mOutputFieldPrecisionSpinBox">
<property name="value">
<number>2</number>
</property>
</widget>
</item>
Expand All @@ -136,6 +115,12 @@
<string>Operators</string>
</property>
<layout class="QGridLayout" name="gridLayout_1">
<property name="topMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="mPlusPushButton">
<property name="text">
Expand Down Expand Up @@ -309,19 +294,69 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QFrame" name="frame">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1" rowspan="2" colspan="2">
<widget class="QFrame" name="mValuesFrame">
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="2" column="2">
<widget class="QPushButton" name="mAllPushButton">
<property name="text">
<string>All</string>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="3">
<widget class="QListWidget" name="mValueListWidget"/>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QListWidget" name="mFieldsListWidget"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Fields</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Values</string>
</property>
</widget>
</item>
</layout>
<zorder>mValuesFrame</zorder>
<zorder>mFieldsListWidget</zorder>
<zorder>label</zorder>
<zorder>label_2</zorder>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>mUpdateExistingFieldCheckBox</tabstop>
<tabstop>mExistingFieldComboBox</tabstop>
<tabstop>mOnlyUpdateSelectedCheckBox</tabstop>
<tabstop>mOutputFieldNameLineEdit</tabstop>
<tabstop>mOutputFieldTypeComboBox</tabstop>
<tabstop>mOuputFieldWidthSpinBox</tabstop>
<tabstop>mOutputFieldPrecisionSpinBox</tabstop>
<tabstop>mFieldsListWidget</tabstop>
<tabstop>mValueListWidget</tabstop>
<tabstop>mSamplePushButton</tabstop>
<tabstop>mAllPushButton</tabstop>
<tabstop>mPlusPushButton</tabstop>
<tabstop>mMultiplyPushButton</tabstop>
Expand Down Expand Up @@ -355,8 +390,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>321</x>
<y>676</y>
<x>679</x>
<y>559</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
Expand All @@ -371,8 +406,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>321</x>
<y>676</y>
<x>679</x>
<y>559</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
Expand Down

0 comments on commit 0ba9cbf

Please sign in to comment.