mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[Geometry checker] Allow adding a prefix to output layer names
This commit is contained in:
parent
6c088e7b94
commit
f114b53178
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user