Skip to content
Permalink
Browse files

[auth] Use explicit signal connections

  • Loading branch information
elpaso committed Oct 2, 2017
1 parent 11eb9cf commit feeec8e0bfaf6a695999edc162ee22a19cc5cc1f
@@ -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
@@ -42,6 +42,7 @@ QgsAuthSettingsWidget::QgsAuthSettingsWidget( QWidget *parent,
{
tabAuth->setCurrentIndex( tabAuth->indexOf( tabBasic ) );
}
connect( btnConvertToEncrypted, &QPushButton::clicked, this, &QgsAuthSettingsWidget::convertToEncrypted );
updateConvertBtnState();
}

@@ -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" ) );
@@ -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
@@ -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(), '')

0 comments on commit feeec8e

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