Skip to content

Commit

Permalink
don't close database selection dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 17, 2017
1 parent bae6d56 commit 205b705
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/gui/qgsmapcanvas.h
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/providers/db2/qgsdb2sourceselect.cpp
Expand Up @@ -454,7 +454,7 @@ void QgsDb2SourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "DB2" ) );
if ( !mHoldDialogOpen->isChecked() )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/mssql/qgsmssqlsourceselect.cpp
Expand Up @@ -454,7 +454,7 @@ void QgsMssqlSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, QStringLiteral( "mssql" ) );
if ( !mHoldDialogOpen->isChecked() )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
Expand Down
20 changes: 12 additions & 8 deletions src/providers/oracle/qgsoraclesourceselect.cpp
Expand Up @@ -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
{
Expand All @@ -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" ) );
Expand All @@ -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() ?
Expand Down Expand Up @@ -490,7 +494,7 @@ void QgsOracleSourceSelect::addTables()
else
{
emit addDatabaseLayers( mSelectedTables, "oracle" );
if ( !mHoldDialogOpen->isChecked() )
if ( !mHoldDialogOpen->isChecked() && mWidgetMode == QgsProviderRegistry::WidgetMode::None )
{
accept();
}
Expand Down
1 change: 0 additions & 1 deletion src/providers/postgres/qgspgsourceselect.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialitesourceselect.cpp
Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions src/providers/wfs/qgswfssourceselect.cpp
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 205b705

Please sign in to comment.