Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hide create layer group if conn does not support SQL layers
  • Loading branch information
elpaso committed Jul 6, 2021
1 parent 73103f0 commit b6d1800
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/browser/qgsinbuiltdataitemproviders.cpp
Expand Up @@ -1077,7 +1077,7 @@ void QgsDatabaseItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *
}
QgsDialog dialog;
dialog.setObjectName( QStringLiteral( "SQLCommandsDialog" ) );
dialog.setWindowTitle( tr( "Run SQL Commands" ) );
dialog.setWindowTitle( tr( "%1 — Run SQL Commands" ).arg( collectionItem->name() ) );
QgsGui::enableAutoGeometryRestore( &dialog );
QgsQueryResultWidget *widget { new QgsQueryResultWidget( &dialog, conn2.release() ) };
widget->layout()->setMargin( 0 );
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsqueryresultwidget.cpp
Expand Up @@ -161,10 +161,10 @@ void QgsQueryResultWidget::updateButtons()
{
mFilterToolButton->setEnabled( false );
mExecuteButton->setEnabled( ! mSqlEditor->text().isEmpty() );
mLoadAsNewLayerGroupBox->setVisible( mConnection->capabilities().testFlag( QgsAbstractDatabaseProviderConnection::Capability::SqlLayers ) );
mLoadAsNewLayerGroupBox->setEnabled(
mSqlErrorMessage.isEmpty() &&
mFirstRowFetched && mConnection &&
mConnection->capabilities().testFlag( QgsAbstractDatabaseProviderConnection::Capability::SqlLayers )
mFirstRowFetched
);
}

Expand Down

0 comments on commit b6d1800

Please sign in to comment.