Skip to content
Permalink
Browse files

[Geometry checker] Allow adding a prefix to output layer names

  • Loading branch information
manisandro committed Jul 6, 2017
1 parent 6c088e7 commit f114b53178433e948bf4d7663cefc9582c7463a3
@@ -66,6 +66,8 @@ QgsGeometryCheckerSetupTab::QgsGeometryCheckerSetupTab( QgisInterface *iface, QD
}
ui.listWidgetInputLayers->setIconSize( QSize( 16, 16 ) );

ui.lineEditFilenamePrefix->setText( QSettings().value( "/geometry_checker/previous_values/filename_prefix", tr( "checked_" ) ).toString() );

connect( mRunButton, &QAbstractButton::clicked, this, &QgsGeometryCheckerSetupTab::runChecks );
connect( ui.listWidgetInputLayers, &QListWidget::itemChanged, this, &QgsGeometryCheckerSetupTab::validateInput );
connect( QgsProject::instance(), &QgsProject::layersAdded, this, &QgsGeometryCheckerSetupTab::updateLayers );
@@ -294,11 +296,13 @@ void QgsGeometryCheckerSetupTab::runChecks()
QString outputExtension = metadata.ext;

// List over input layers, check which existing project layers need to be removed and create output layers
QString filenamePrefix = ui.lineEditFilenamePrefix->text();
QSettings().setValue( "/geometry_checker/previous_values/filename_prefix", filenamePrefix );
QStringList toRemove;
QStringList createErrors;
for ( QgsVectorLayer *layer : layers )
{
QString outputPath = outputDir.absoluteFilePath( layer->name() + "." + outputExtension );
QString outputPath = outputDir.absoluteFilePath( filenamePrefix + layer->name() + "." + outputExtension );

// Remove existing layer with same uri from project
for ( QgsVectorLayer *projectLayer : QgsProject::instance()->layers<QgsVectorLayer *>() )
@@ -41,9 +41,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-215</y>
<width>626</width>
<height>941</height>
<height>966</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
@@ -731,6 +731,20 @@
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="comboBoxOutputFormat"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelFilenamePrefix">
<property name="text">
<string>Filename prefix:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="lineEditFilenamePrefix">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>

0 comments on commit f114b53

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