diff --git a/src/providers/oracle/qgsoraclenewconnection.cpp b/src/providers/oracle/qgsoraclenewconnection.cpp index 8eb73459ecf..9976743c4b0 100644 --- a/src/providers/oracle/qgsoraclenewconnection.cpp +++ b/src/providers/oracle/qgsoraclenewconnection.cpp @@ -195,6 +195,11 @@ void QgsOracleNewConnection::showHelp() void QgsOracleNewConnection::updateOkButtonState() { - bool enabled = !txtName->text().isEmpty() && !txtHost->text().isEmpty() && !txtPort->text().isEmpty() && !txtDatabase->text().isEmpty(); + // User can set database without host and port, meaning he is using a service (tnsnames.ora) + // if he sets host, port has to be set also (and vice versa) + // https://github.com/qgis/QGIS/issues/38979 + + bool enabled = !txtName->text().isEmpty() && !txtDatabase->text().isEmpty() + && ( txtHost->text().isEmpty() == txtPort->text().isEmpty() ); buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled ); } diff --git a/src/ui/qgsoraclenewconnectionbase.ui b/src/ui/qgsoraclenewconnectionbase.ui index d9dfaf8a127..a21c1ad313c 100644 --- a/src/ui/qgsoraclenewconnectionbase.ui +++ b/src/ui/qgsoraclenewconnectionbase.ui @@ -55,7 +55,11 @@ - + + + Database name, or service name (described in tnsnames.ora) if no host and port has been set + +