Skip to content
Permalink
Browse files

Fixes #38979 : Fix oracle new connection greyed ok button

  • Loading branch information
troopa81 authored and nyalldawson committed Oct 5, 2020
1 parent 7f8c036 commit a3c4fe44ab55f184018fb81513e7d7c67d2728fd
Showing with 11 additions and 2 deletions.
  1. +6 −1 src/providers/oracle/qgsoraclenewconnection.cpp
  2. +5 −1 src/ui/qgsoraclenewconnectionbase.ui
@@ -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 );
}
@@ -55,7 +55,11 @@
</property>
<layout class="QGridLayout" name="gridLayout_1">
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="txtDatabase"/>
<widget class="QLineEdit" name="txtDatabase">
<property name="toolTip">
<string>Database name, or service name (described in tnsnames.ora) if no host and port has been set</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLineEdit" name="txtPort">

0 comments on commit a3c4fe4

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