Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
New Shapefile Layer: reorganise additional dimensions checkboxes
because shapefiles could only be
- plain X,Y
- with M values: X,Y,M
- with Z and M values: X,Y,Z,M
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Feb 6, 2019
1 parent 31ab3bb commit daab33c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/gui/qgsnewvectorlayerdialog.cpp
Expand Up @@ -170,10 +170,10 @@ QgsWkbTypes::Type QgsNewVectorLayerDialog::selectedType() const
wkbType = static_cast<QgsWkbTypes::Type>
( mGeometryTypeBox->currentData( Qt::UserRole ).toInt() );

if ( mGeometryWithZCheckBox->isChecked() )
if ( mGeometryWithZRadioButton->isChecked() )
wkbType = QgsWkbTypes::addZ( wkbType );

if ( mGeometryWithMCheckBox->isChecked() )
if ( mGeometryWithMRadioButton->isChecked() )
wkbType = QgsWkbTypes::addM( wkbType );

return wkbType;
Expand Down
67 changes: 50 additions & 17 deletions src/ui/qgsnewvectorlayerdialogbase.ui
Expand Up @@ -17,7 +17,7 @@
<bool>true</bool>
</property>
<layout class="QGridLayout">
<item row="14" column="0" colspan="2">
<item row="14" column="0" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -27,7 +27,7 @@
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<item row="10" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>New Field</string>
Expand Down Expand Up @@ -127,13 +127,13 @@
</layout>
</widget>
</item>
<item row="12" column="0" colspan="2">
<item row="12" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Fields List</string>
</property>
<layout class="QGridLayout">
<item row="2" column="0" colspan="2">
<item row="2" column="0" colspan="3">
<widget class="QTreeWidget" name="mAttributeView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
Expand Down Expand Up @@ -211,7 +211,7 @@
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="4" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_3">
<item row="3" column="0">
<widget class="QLabel" name="mGeometryTypeLabel">
Expand Down Expand Up @@ -271,14 +271,43 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="mAdditionalDimensionsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Additional dimensions</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="mGeometryWithZCheckBox">
<widget class="QRadioButton" name="mGeometryWithNoneRadioButton">
<property name="text">
<string>None</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QRadioButton" name="mGeometryWithZRadioButton">
<property name="text">
<string>Include Z dimension</string>
<string>Z (+ M values)</string>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<item row="5" column="1" colspan="3">
<widget class="QgsProjectionSelectionWidget" name="mCrsSelector" native="true">
<property name="minimumSize">
<size>
Expand All @@ -291,28 +320,31 @@
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="mGeometryWithMCheckBox">
<item row="4" column="3">
<widget class="QRadioButton" name="mGeometryWithMRadioButton">
<property name="text">
<string>Include M values</string>
<string>M values</string>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<item row="1" column="1" colspan="3">
<widget class="QComboBox" name="mFileEncoding">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<item row="2" column="1" colspan="3">
<widget class="QComboBox" name="mFileFormatComboBox">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<item row="3" column="1" colspan="3">
<widget class="QComboBox" name="mGeometryTypeBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
Expand All @@ -322,7 +354,7 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<item row="0" column="1" colspan="3">
<widget class="QgsFileWidget" name="mFileName" native="true"/>
</item>
</layout>
Expand All @@ -348,8 +380,9 @@
<tabstop>mFileEncoding</tabstop>
<tabstop>mFileFormatComboBox</tabstop>
<tabstop>mGeometryTypeBox</tabstop>
<tabstop>mGeometryWithZCheckBox</tabstop>
<tabstop>mGeometryWithMCheckBox</tabstop>
<tabstop>mGeometryWithNoneRadioButton</tabstop>
<tabstop>mGeometryWithZRadioButton</tabstop>
<tabstop>mGeometryWithMRadioButton</tabstop>
<tabstop>mCrsSelector</tabstop>
<tabstop>mNameEdit</tabstop>
<tabstop>mTypeBox</tabstop>
Expand Down

0 comments on commit daab33c

Please sign in to comment.