Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[geometry-checker-ui] use qgsmalayercombobox for layers list
  • Loading branch information
slarosa committed Sep 29, 2015
1 parent dfb7819 commit 1437433
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Expand Up @@ -45,6 +45,7 @@ QgsGeometryCheckerSetupTab::QgsGeometryCheckerSetupTab( QgisInterface* iface , Q
ui.setupUi( this );
ui.progressBar->hide();
ui.labelStatus->hide();
ui.comboBoxInputLayer->setFilters( QgsMapLayerProxyModel::HasGeometry );
mRunButton = ui.buttonBox->addButton( tr( "Run" ), QDialogButtonBox::ActionRole );
mAbortButton = new QPushButton( tr( "Abort" ) );
mRunButton->setEnabled( false );
Expand Down Expand Up @@ -107,8 +108,8 @@ QgsVectorLayer* QgsGeometryCheckerSetupTab::getSelectedLayer()
{
return 0;
}
QString inputLayerId = ui.comboBoxInputLayer->itemData( inputIdx ).toString();
return static_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( inputLayerId ) );
QgsVectorLayer *layer = dynamic_cast<QgsVectorLayer*>( ui.comboBoxInputLayer->currentLayer() );
return layer;
}

void QgsGeometryCheckerSetupTab::validateInput()
Expand Down
11 changes: 9 additions & 2 deletions src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.ui
Expand Up @@ -32,7 +32,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-276</y>
<y>0</y>
<width>625</width>
<height>767</height>
</rect>
Expand Down Expand Up @@ -72,7 +72,7 @@
<number>2</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxInputLayer"/>
<widget class="QgsMapLayerComboBox" name="comboBoxInputLayer"/>
</item>
<item>
<widget class="QCheckBox" name="checkBoxInputSelectedOnly">
Expand Down Expand Up @@ -616,6 +616,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsMapLayerComboBox</class>
<extends>QComboBox</extends>
<header location="global">qgsmaplayercombobox.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../pluginres.qrc"/>
</resources>
Expand Down

0 comments on commit 1437433

Please sign in to comment.