Skip to content
Permalink
Browse files

[need-docs] reorganize the new spatialite layer dialog (#5824)

  • Loading branch information
nirvn committed Dec 8, 2017
1 parent 15e7d57 commit 11c1f3a718c140561bed72f61b108d71b14d6f96
Showing with 142 additions and 192 deletions.
  1. +8 −28 src/app/qgsnewspatialitelayerdialog.cpp
  2. +134 −164 src/ui/qgsnewspatialitelayerdialogbase.ui
@@ -55,13 +55,19 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/NewSpatiaLiteLayer/geometry" ) ).toByteArray() );

mGeometryTypeBox->addItem( tr( "Point" ), QStringLiteral( "POINT" ) );
mGeometryTypeBox->addItem( tr( "Line" ), QStringLiteral( "LINE" ) );
mGeometryTypeBox->addItem( tr( "Polygon" ), QStringLiteral( "POLYGON" ) );
mGeometryTypeBox->addItem( tr( "MultiPoint" ), QStringLiteral( "MULTIPOINT" ) );
mGeometryTypeBox->addItem( tr( "MultiLine" ), QStringLiteral( "MULTILINE" ) );
mGeometryTypeBox->addItem( tr( "MultiPolygon" ), QStringLiteral( "MULTIPOLYGON" ) );

mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewAttribute.svg" ) ) );
mRemoveAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteAttribute.svg" ) ) );
mTypeBox->addItem( tr( "Text data" ), "text" );
mTypeBox->addItem( tr( "Whole number" ), "integer" );
mTypeBox->addItem( tr( "Decimal number" ), "real" );

mPointRadioButton->setChecked( true );
// Populate the database list from the stored connections
settings.beginGroup( QStringLiteral( "SpatiaLite/connections" ) );
QStringList keys = settings.childGroups();
@@ -137,33 +143,7 @@ void QgsNewSpatialiteLayerDialog::toolButtonNewDatabase_clicked()

QString QgsNewSpatialiteLayerDialog::selectedType() const
{
if ( mPointRadioButton->isChecked() )
{
return QStringLiteral( "POINT" );
}
else if ( mLineRadioButton->isChecked() )
{
return QStringLiteral( "LINESTRING" );
}
else if ( mPolygonRadioButton->isChecked() )
{
return QStringLiteral( "POLYGON" );
}
else if ( mMultipointRadioButton->isChecked() )
{
return QStringLiteral( "MULTIPOINT" );
}
else if ( mMultilineRadioButton->isChecked() )
{
return QStringLiteral( "MULTILINESTRING" );
}
else if ( mMultipolygonRadioButton->isChecked() )
{
return QStringLiteral( "MULTIPOLYGON" );
}

Q_ASSERT( !"no type selected" );
return QLatin1String( "" );
return mGeometryTypeBox->currentData( Qt::UserRole ).toString();
}

void QgsNewSpatialiteLayerDialog::checkOk()

0 comments on commit 11c1f3a

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