Skip to content

Commit

Permalink
Fix the behaviour of the trusted connection checkbox (#6262)
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest committed Mar 5, 2013
1 parent 2b52f49 commit 6d1eb26
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/providers/mssql/qgsmssqlnewconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ QgsMssqlNewConnection::QgsMssqlNewConnection( QWidget *parent, const QString& co
{
txtUsername->setText( settings.value( key + "/username" ).toString() );
chkStoreUsername->setChecked( true );
cb_trustedConnection->setChecked (false);
}

if ( settings.value( key + "/savePassword" ).toString() == "true" )
Expand All @@ -71,6 +72,7 @@ QgsMssqlNewConnection::QgsMssqlNewConnection( QWidget *parent, const QString& co

txtName->setText( connName );
}
on_cb_trustedConnection_clicked();
}
/** Autoconnected SLOTS **/
void QgsMssqlNewConnection::accept()
Expand Down Expand Up @@ -127,6 +129,22 @@ void QgsMssqlNewConnection::on_btnConnect_clicked()
testConnection();
}

void QgsMssqlNewConnection::on_cb_trustedConnection_clicked()
{
if ( cb_trustedConnection->checkState() == Qt::Checked )
{
txtUsername->setEnabled( false );
txtUsername->setText( "" );
txtPassword->setEnabled( false );
txtPassword->setText( "" );
}
else
{
txtUsername->setEnabled( true );
txtPassword->setEnabled( true );
}
}

/** end Autoconnected SLOTS **/

QgsMssqlNewConnection::~QgsMssqlNewConnection()
Expand Down
1 change: 1 addition & 0 deletions src/providers/mssql/qgsmssqlnewconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class QgsMssqlNewConnection : public QDialog, private Ui::QgsMssqlNewConnectionB
public slots:
void accept();
void on_btnConnect_clicked();
void on_cb_trustedConnection_clicked();
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
private:
QString mOriginalConnName; //store initial name to delete entry in case of rename
Expand Down

0 comments on commit 6d1eb26

Please sign in to comment.