Skip to content
Permalink
Browse files

don't close database selection dialogs

  • Loading branch information
jef-n committed Jul 17, 2017
1 parent bae6d56 commit 205b7051dc44d7460df7b9909c918a9b60f6366c
@@ -729,6 +729,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
*/
void connectNotify( const char *signal ) override;
#endif

//! Make sure the datum transform store is properly populated
void updateDatumTransformEntries();

@@ -454,7 +454,7 @@ void QgsDb2SourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "DB2" ) );
if ( !mHoldDialogOpen->isChecked() )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -454,7 +454,7 @@ void QgsMssqlSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "mssql" ) );
if ( !mHoldDialogOpen->isChecked() )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -174,9 +174,10 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags f
{
setupUi( this );

if ( mWidgetMode == QgsProviderRegistry::WidgetMode::Embedded )
if ( mWidgetMode != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->button( QDialogButtonBox::Close )->hide();
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->hide();
}
else
{
@@ -190,11 +191,14 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags f
mBuildQueryButton->setToolTip( tr( "Set Filter" ) );
mBuildQueryButton->setDisabled( true );

buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addTables() ) );
if ( mWidgetMode != QgsProviderRegistry::WidgetMode::Manager )
{
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
connect( mAddButton, &QAbstractButton::clicked, this, &QgsOracleSourceSelect::addTables );

buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
connect( mBuildQueryButton, &QAbstractButton::clicked, this, &QgsOracleSourceSelect::buildQuery );
}

mSearchModeComboBox->addItem( tr( "Wildcard" ) );
mSearchModeComboBox->addItem( tr( "RegExp" ) );
@@ -220,7 +224,7 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WindowFlags f
mTablesTreeView->setEditTriggers( QAbstractItemView::CurrentChanged );
mTablesTreeView->setItemDelegate( mTablesTreeDelegate );

connect( mTablesTreeView->selectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection & ) ), this, SLOT( treeWidgetSelectionChanged( const QItemSelection &, const QItemSelection & ) ) );
connect( mTablesTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsOracleSourceSelect::treeWidgetSelectionChanged );

QgsSettings settings;
mTablesTreeView->setSelectionMode( settings.value( "qgis/addOracleDC", false ).toBool() ?
@@ -490,7 +494,7 @@ void QgsOracleSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, "oracle" );
if ( !mHoldDialogOpen->isChecked() )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -204,7 +204,6 @@ QgsPgSourceSelect::QgsPgSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsPr
if ( mWidgetMode != QgsProviderRegistry::WidgetMode::None )
{
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->setHidden( true );
mHoldDialogOpen->hide();
}
else
@@ -418,7 +418,7 @@ void QgsSpatiaLiteSourceSelect::addTables()
else
{
emit addDatabaseLayers( m_selectedTables, QStringLiteral( "spatialite" ) );
if ( mWidgetMode == QgsProviderRegistry::WidgetMode::None && ! mHoldDialogOpen->isChecked() )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
@@ -61,7 +61,6 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget *parent, Qt::WindowFlags fl, Qgs
// For some obscure reason hiding does not work!
// buttonBox->button( QDialogButtonBox::Close )->hide();
buttonBox->removeButton( buttonBox->button( QDialogButtonBox::Close ) );
mHoldDialogOpen->setHidden( true );
mHoldDialogOpen->hide();
}

@@ -405,7 +404,7 @@ void QgsWFSSourceSelect::addLayer()
emit addWfsLayer( mUri, layerName );
}

if ( ! mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}

0 comments on commit 205b705

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