Skip to content
Permalink
Browse files

[ui] improve new geopackage layer dialog (#5682)

- move a number of options under a collapsible group
- rework wording for Z dimension and M values
- disable z and m checkboxes when geometry type is non spatial
  • Loading branch information
nirvn committed Nov 21, 2017
1 parent e05cca2 commit 0b3f86d0596c49755aaf8f78e14181165e4c4cef
Showing with 147 additions and 131 deletions.
  1. +4 −0 src/gui/qgsnewgeopackagelayerdialog.cpp
  2. +143 −131 src/ui/qgsnewgeopackagelayerdialogbase.ui
@@ -83,6 +83,8 @@ QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog( QWidget *parent, Qt::W
mGeometryTypeBox->addItem( tr( "Multi curve" ), wkbMultiCurve );
mGeometryTypeBox->addItem( tr( "Multi surface" ), wkbMultiSurface );

mGeometryWithZCheckBox->setEnabled( false );
mGeometryWithMCheckBox->setEnabled( false );
mGeometryColumnEdit->setEnabled( false );
mCheckBoxCreateSpatialIndex->setEnabled( false );
mCrsSelector->setEnabled( false );
@@ -141,6 +143,8 @@ void QgsNewGeoPackageLayerDialog::mGeometryTypeBox_currentIndexChanged( int )
OGRwkbGeometryType geomType = static_cast<OGRwkbGeometryType>
( mGeometryTypeBox->currentData( Qt::UserRole ).toInt() );
bool isSpatial = geomType != wkbNone;
mGeometryWithZCheckBox->setEnabled( isSpatial );
mGeometryWithMCheckBox->setEnabled( isSpatial );
mGeometryColumnEdit->setEnabled( isSpatial );
mCheckBoxCreateSpatialIndex->setEnabled( isSpatial );
mCrsSelector->setEnabled( isSpatial );
@@ -66,20 +66,10 @@
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="8" column="0">
<widget class="QCheckBox" name="mCheckBoxCreateSpatialIndex">
<property name="toolTip">
<string>Add an integer id field as the primary key for the new layer</string>
</property>
<property name="text">
<string>Create a spatial index</string>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_6"/>
</item>
<item row="9" column="0">
<item row="3" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>New field</string>
@@ -156,35 +146,6 @@
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="4" column="2">
<widget class="QLineEdit" name="mLayerIdentifierEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Human-readable identifier (e.g. short name) for the layer content&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLineEdit" name="mGeometryColumnEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of the geometry column&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>geometry</string>
</property>
</widget>
</item>
<item row="1" column="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@@ -212,17 +173,7 @@
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="mLayerDescriptionLabel">
<property name="text">
<string>Layer description</string>
</property>
<property name="buddy">
<cstring>mLayerIdentifierEdit</cstring>
</property>
</widget>
</item>
<item row="7" column="0">
<item row="3" column="0">
<widget class="QLabel" name="mGeometryTypeLabel">
<property name="enabled">
<bool>true</bool>
@@ -232,17 +183,7 @@
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="mGeometryColumnLabel">
<property name="text">
<string>Geometry column</string>
</property>
<property name="buddy">
<cstring>mGeometryColumnEdit</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
<item row="2" column="2">
<widget class="QLineEdit" name="mTableNameEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -255,19 +196,6 @@
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="mLayerDescriptionEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Human-readable description for the layer content&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mDatabaseLabel">
<property name="enabled">
@@ -278,7 +206,7 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="mTableNameLabel">
<property name="text">
<string>Table name</string>
@@ -288,17 +216,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="mLayerIdentifierLabel">
<property name="text">
<string>Layer identifier</string>
</property>
<property name="buddy">
<cstring>mLayerIdentifierEdit</cstring>
</property>
</widget>
</item>
<item row="7" column="2">
<item row="3" column="2">
<widget class="QComboBox" name="mGeometryTypeBox">
<property name="enabled">
<bool>true</bool>
@@ -314,35 +232,27 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="mFeatureIdLabel">
<property name="text">
<string>Feature id column</string>
</property>
<property name="buddy">
<cstring>mGeometryColumnEdit</cstring>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLineEdit" name="mFeatureIdColumnEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of the feature id column&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>fid</string>
</property>
</widget>
<item row="4" column="2">
<layout class="QHBoxLayout" name="horizontalZMLayout">
<item>
<widget class="QCheckBox" name="mGeometryWithZCheckBox">
<property name="text">
<string>Include Z dimension</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mGeometryWithMCheckBox">
<property name="text">
<string>Include M values</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="10" column="0">
<item row="4" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Fields list</string>
@@ -421,30 +331,132 @@
</layout>
</widget>
</item>
<item row="6" column="0">
<item row="2" column="0">
<widget class="QgsProjectionSelectionWidget" name="mCrsSelector">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalZMLayout">
<item>
<widget class="QCheckBox" name="mGeometryWithZCheckBox">
<property name="text">
<string>Geometries with Z coordinate</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mGeometryWithMCheckBox">
<property name="text">
<string>Geometries with M coordinate</string>
</property>
</widget>
</item>
</layout>
<item row="5" column="0">
<widget class="QgsCollapsibleGroupBox" name="groupBox">
<property name="title">
<string>Advanced options</string>
</property>
<property name="collapsed" stdset="0">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="0">
<widget class="QLabel" name="mLayerIdentifierLabel">
<property name="text">
<string>Layer identifier</string>
</property>
<property name="buddy">
<cstring>mLayerIdentifierEdit</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="mLayerIdentifierEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Human-readable identifier (e.g. short name) for the layer content&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mLayerDescriptionLabel">
<property name="text">
<string>Layer description</string>
</property>
<property name="buddy">
<cstring>mLayerIdentifierEdit</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="mLayerDescriptionEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Human-readable description for the layer content&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mFeatureIdLabel">
<property name="text">
<string>Feature id column</string>
</property>
<property name="buddy">
<cstring>mGeometryColumnEdit</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="mFeatureIdColumnEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of the feature id column&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>fid</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="mGeometryColumnLabel">
<property name="text">
<string>Geometry column</string>
</property>
<property name="buddy">
<cstring>mGeometryColumnEdit</cstring>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="mGeometryColumnEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of the geometry column&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>geometry</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QCheckBox" name="mCheckBoxCreateSpatialIndex">
<property name="toolTip">
<string>Add an integer id field as the primary key for the new layer</string>
</property>
<property name="text">
<string>Create a spatial index</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>

0 comments on commit 0b3f86d

Please sign in to comment.
You can’t perform that action at this time.