Skip to content

Commit 30e4892

Browse files
committed
WFS: do not show ok/cancel when embedded in qbrowser
1 parent 318a36b commit 30e4892

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/providers/wfs/qgswfsdataitems.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ QList<QAction*> QgsWFSRootItem::actions()
149149

150150
QWidget * QgsWFSRootItem::paramWidget()
151151
{
152-
QgsWFSSourceSelect *select = new QgsWFSSourceSelect( 0, 0 );
152+
QgsWFSSourceSelect *select = new QgsWFSSourceSelect( 0, 0, true );
153153
connect( select, SIGNAL( connectionsChanged() ), this, SLOT( connectionsChanged() ) );
154154
return select;
155155
}

src/providers/wfs/qgswfssourceselect.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,25 @@
3434
#include <QFileDialog>
3535

3636

37-
QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl )
37+
QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool embeddedMode )
3838
: QDialog( parent, fl )
3939
, mConn( NULL )
4040
{
4141
setupUi( this );
42+
4243
btnAdd = buttonBox->button( QDialogButtonBox::Ok );
4344
btnAdd->setEnabled( false );
4445

46+
if ( embeddedMode )
47+
{
48+
buttonBox->button( QDialogButtonBox::Ok )->hide();
49+
buttonBox->button( QDialogButtonBox::Cancel )->hide();
50+
}
51+
52+
// keep the "use current view extent" checkbox hidden until
53+
// the functionality is reintroduced [MD]
54+
mBboxCheckBox->hide();
55+
4556
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( addLayer() ) );
4657
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
4758
connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );

src/providers/wfs/qgswfssourceselect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
3030

3131
public:
3232

33-
QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl );
33+
QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool embeddedMode = false );
3434
~QgsWFSSourceSelect();
3535

3636
signals:

0 commit comments

Comments
 (0)