Skip to content
Permalink
Browse files

Merge pull request #2634 from alexbruy/wfs-dialog

option to keep WFS dialog open after adding layer(s)
  • Loading branch information
alexbruy committed Jan 20, 2016
2 parents 1c3f066 + af30b29 commit 63af3e27650b57e477aab435efc957fa5ac6bb8c
Showing with 89 additions and 69 deletions.
  1. +7 −1 src/providers/wfs/qgswfssourceselect.cpp
  2. +82 −68 src/ui/qgswfssourceselectbase.ui
@@ -81,6 +81,7 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WindowFlags fl, boo
QgsDebugMsg( "restoring settings" );
restoreGeometry( settings.value( "/Windows/WFSSourceSelect/geometry" ).toByteArray() );
cbxUseTitleLayerName->setChecked( settings.value( "/Windows/WFSSourceSelect/UseTitleLayerName", false ).toBool() );
mHoldDialogOpen->setChecked( settings.value( "/Windows/WFSSourceSelect/HoldDialogOpen", false ).toBool() );

mModel = new QStandardItemModel();
mModel->setHorizontalHeaderItem( 0, new QStandardItem( "Title" ) );
@@ -104,6 +105,7 @@ QgsWFSSourceSelect::~QgsWFSSourceSelect()
QgsDebugMsg( "saving settings" );
settings.setValue( "/Windows/WFSSourceSelect/geometry", saveGeometry() );
settings.setValue( "/Windows/WFSSourceSelect/UseTitleLayerName", cbxUseTitleLayerName->isChecked() );
settings.setValue( "/Windows/WFSSourceSelect/HoldDialogOpen", mHoldDialogOpen->isChecked() );

delete mItemDelegate;
delete mProjectionSelector;
@@ -419,7 +421,11 @@ void QgsWFSSourceSelect::addLayer()
}
emit addWfsLayer( mUri, layerName );
}
accept();

if ( !mHoldDialogOpen->isChecked() )
{
accept();
}
}

void QgsWFSSourceSelect::buildQuery( const QModelIndex& index )
@@ -14,13 +14,29 @@
<string>Add WFS Layer from a Server</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="6" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="2" column="0">
<widget class="QTreeView" name="treeView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerVisible">
<bool>true</bool>
</attribute>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="cbxFeatureCurrentViewExtent">
<property name="text">
<string>Only request features overlapping the current view extent</string>
</property>
</widget>
</item>
@@ -113,7 +129,47 @@
</layout>
</widget>
</item>
<item row="5" column="0">
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayoutFilter">
<item>
<widget class="QLabel" name="labelFilter">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Filter:</string>
</property>
<property name="buddy">
<cstring>lineFilter</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineFilter">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Display WFS FeatureTypes containing this word in the title, name or abstract</string>
</property>
<property name="whatsThis">
<string>Display WFS FeatureTypes containing this word in the title, name or abstract</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QGroupBox" name="gbCRS">
<property name="title">
<string>Coordinate reference system</string>
@@ -122,16 +178,7 @@
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>9</number>
</property>
<item>
@@ -170,69 +217,37 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="cbxUseTitleLayerName">
<property name="text">
<string>Use title for layer name</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QTreeView" name="treeView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerVisible">
<bool>true</bool>
</attribute>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayoutFilter">
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="labelFilter">
<property name="enabled">
<bool>true</bool>
</property>
<widget class="QCheckBox" name="cbxUseTitleLayerName">
<property name="text">
<string>Filter:</string>
</property>
<property name="buddy">
<cstring>lineFilter</cstring>
<string>Use title for layer name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineFilter">
<property name="enabled">
<bool>true</bool>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="toolTip">
<string>Display WFS FeatureTypes containing this word in the title, name or abstract</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<property name="whatsThis">
<string>Display WFS FeatureTypes containing this word in the title, name or abstract</string>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="mHoldDialogOpen">
<property name="text">
<string>Keep dialog open</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="cbxFeatureCurrentViewExtent">
<property name="text">
<string>Only request features overlapping the current view extent</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
@@ -245,7 +260,6 @@
<tabstop>btnSave</tabstop>
<tabstop>lineFilter</tabstop>
<tabstop>treeView</tabstop>
<tabstop>cbxUseTitleLayerName</tabstop>
<tabstop>cbxFeatureCurrentViewExtent</tabstop>
<tabstop>btnChangeSpatialRefSys</tabstop>
</tabstops>

0 comments on commit 63af3e2

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