Skip to content

Commit

Permalink
[addlayerbutton] Add embedded option to spatialite dlg
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jun 2, 2017
1 parent 129e00d commit 220d125
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/providers/spatialite/qgsspatialitesourceselect.cpp
Expand Up @@ -39,11 +39,13 @@ email : a.furieri@lqt.it
#define strcasecmp(a,b) stricmp(a,b)
#endif

QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, bool embedded ):
QDialog( parent, fl )
QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QWidget *parent, Qt::WindowFlags fl, bool embeddedMode ):
QDialog( parent, fl ),
mEmbeddedMode( embeddedMode )
{
setupUi( this );


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

if ( embedded )
if ( mEmbeddedMode )
{
buttonBox->button( QDialogButtonBox::Close )->hide();
}
Expand Down
3 changes: 2 additions & 1 deletion src/providers/spatialite/qgsspatialitesourceselect.h
Expand Up @@ -50,7 +50,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsDbSourceSelectBa
static bool newConnection( QWidget *parent );

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

~QgsSpatiaLiteSourceSelect();
//! Populate the connection list combo box
Expand Down Expand Up @@ -129,6 +129,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsDbSourceSelectBa
QPushButton *mBuildQueryButton = nullptr;
QPushButton *mAddButton = nullptr;
QPushButton *mStatsButton = nullptr;
bool mEmbeddedMode;
};

#endif // QGSSPATIALITESOURCESELECT_H

0 comments on commit 220d125

Please sign in to comment.