Skip to content

Commit

Permalink
[auth] Use explicit signal connections
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 2, 2017
1 parent 11eb9cf commit feeec8e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions python/gui/auth/qgsauthsettingswidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ class QgsAuthSettingsWidget : QWidget

public slots:

bool on_btnConvertToEncrypted_clicked( );
bool convertToEncrypted( );
%Docstring
on_btnConvertToEncrypted_clicked create a Basic authentication configuration from
convertToEncrypted is called when the convert to encrypted button is
clicked and it creates a Basic authentication configuration from
username and password specified in the Basic tab
:return: return true on success
:rtype: bool
Expand Down
3 changes: 2 additions & 1 deletion src/gui/auth/qgsauthsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ QgsAuthSettingsWidget::QgsAuthSettingsWidget( QWidget *parent,
{
tabAuth->setCurrentIndex( tabAuth->indexOf( tabBasic ) );
}
connect( btnConvertToEncrypted, &QPushButton::clicked, this, &QgsAuthSettingsWidget::convertToEncrypted );
updateConvertBtnState();
}

Expand Down Expand Up @@ -80,7 +81,7 @@ bool QgsAuthSettingsWidget::btnConvertToEncryptedIsEnabled() const
return btnConvertToEncrypted->isEnabled( );
}

bool QgsAuthSettingsWidget::on_btnConvertToEncrypted_clicked()
bool QgsAuthSettingsWidget::convertToEncrypted( )
{
tabAuth->setCurrentIndex( tabAuth->indexOf( tabConfigurations ) );
QgsAuthMethodConfig config( QStringLiteral( "Basic" ) );
Expand Down
5 changes: 3 additions & 2 deletions src/gui/auth/qgsauthsettingswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,12 @@ class GUI_EXPORT QgsAuthSettingsWidget : public QWidget, private Ui::QgsAuthSett
public slots:

/**
* \brief on_btnConvertToEncrypted_clicked create a Basic authentication configuration from
* \brief convertToEncrypted is called when the convert to encrypted button is
* clicked and it creates a Basic authentication configuration from
* username and password specified in the Basic tab
* \return return true on success
*/
bool on_btnConvertToEncrypted_clicked( );
bool convertToEncrypted( );

/**
* \brief on_txtUserName_textChanged set convert button state
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_authsettingswidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def testConvertToEncrypted(self):
self.assertEqual(w.configId(), '')
self.assertEqual(w.currentTabIndex(), 1)
self.assertTrue(w.btnConvertToEncryptedIsEnabled())
self.assertTrue(w.on_btnConvertToEncrypted_clicked())
self.assertTrue(w.convertToEncrypted())
self.assertNotEqual(w.configId(), '')
self.assertEqual(w.username(), '')
self.assertEqual(w.password(), '')
Expand Down

0 comments on commit feeec8e

Please sign in to comment.