Skip to content

Commit 220d125

Browse files
committed
[addlayerbutton] Add embedded option to spatialite dlg
1 parent 129e00d commit 220d125

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/providers/spatialite/qgsspatialitesourceselect.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ email : a.furieri@lqt.it
3939
#define strcasecmp(a,b) stricmp(a,b)
4040
#endif
4141

42-
QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, bool embedded ):
43-
QDialog( parent, fl )
42+
QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, bool embeddedMode ):
43+
QDialog( parent, fl ),
44+
mEmbeddedMode( embeddedMode )
4445
{
4546
setupUi( this );
4647

48+
4749
QgsSettings settings;
4850
restoreGeometry( settings.value( QStringLiteral( "Windows/SpatiaLiteSourceSelect/geometry" ) ).toByteArray() );
4951
mHoldDialogOpen->setChecked( settings.value( QStringLiteral( "Windows/SpatiaLiteSourceSelect/HoldDialogOpen" ), false ).toBool() );
@@ -65,7 +67,7 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::Windo
6567
connect( mBuildQueryButton, &QAbstractButton::clicked, this, &QgsSpatiaLiteSourceSelect::buildQuery );
6668
mBuildQueryButton->setEnabled( false );
6769

68-
if ( embedded )
70+
if ( mEmbeddedMode )
6971
{
7072
buttonBox->button( QDialogButtonBox::Close )->hide();
7173
}

src/providers/spatialite/qgsspatialitesourceselect.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsDbSourceSelectBa
5050
static bool newConnection( QWidget *parent );
5151

5252
//! Constructor
53-
QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, bool embedded = false );
53+
QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, bool embeddedMode = false );
5454

5555
~QgsSpatiaLiteSourceSelect();
5656
//! Populate the connection list combo box
@@ -129,6 +129,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsDbSourceSelectBa
129129
QPushButton *mBuildQueryButton = nullptr;
130130
QPushButton *mAddButton = nullptr;
131131
QPushButton *mStatsButton = nullptr;
132+
bool mEmbeddedMode;
132133
};
133134

134135
#endif // QGSSPATIALITESOURCESELECT_H

0 commit comments

Comments
 (0)