Skip to content
Permalink
Browse files
Hide create layer group if conn does not support SQL layers
  • Loading branch information
elpaso committed Jul 6, 2021
1 parent 73103f0 commit b6d1800fd4ed0754a7637e1be11220c1daacf682
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/app/browser/qgsinbuiltdataitemproviders.cpp
  2. +2 −2 src/gui/qgsqueryresultwidget.cpp
@@ -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 );
@@ -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
);
}

0 comments on commit b6d1800

Please sign in to comment.