Skip to content
Permalink
Browse files
Merge pull request #4363 from alexbruy/passwordlineedits
[needs-docs] use QgsPasswordLineEdit in the master password dialog
  • Loading branch information
alexbruy committed Apr 17, 2017
2 parents 8c20d99 + 8578815 commit c749057f0270fa437acd96b08d7bb3c4dc0f1634
Showing with 44 additions and 39 deletions.
  1. +0 −1 python/auto_sip.blacklist
  2. +32 −8 python/gui/qgscredentialdialog.sip
  3. +0 −7 src/gui/qgscredentialdialog.cpp
  4. +7 −4 src/gui/qgscredentialdialog.h
  5. +5 −19 src/ui/qgscredentialdialog.ui
@@ -347,7 +347,6 @@ gui/qgscomposerruler.sip
gui/qgscomposerview.sip
gui/qgscompoundcolorwidget.sip
gui/qgsconfigureshortcutsdialog.sip
gui/qgscredentialdialog.sip
gui/qgscustomdrophandler.sip
gui/qgscurveeditorwidget.sip
gui/qgsdetaileditemdata.sip
@@ -1,18 +1,42 @@
/** \ingroup gui
* A generic dialog for requesting credentials
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgscredentialdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsCredentialDialog : QDialog, QgsCredentials
{
%TypeHeaderCode
#include <qgscredentialdialog.h>
%Docstring
A generic dialog for requesting credentials
%End

%TypeHeaderCode
#include "qgscredentialdialog.h"
%End
public:
QgsCredentialDialog( QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );
~QgsCredentialDialog();
QgsCredentialDialog( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
%Docstring
QgsCredentialDialog constructor
%End


protected:
virtual bool request( const QString& realm, QString &username /In,Out/, QString &password /In,Out/, const QString& message = QString::null );
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );

virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgscredentialdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -208,7 +208,6 @@ void QgsCredentialDialog::requestCredentialsMasterPassword( QString *password, b

// don't leave master password in singleton's text field, or the ability to show it
leMasterPass->clear();
chkMasterPassShow->setChecked( false );
leMasterPassVerify->clear();

chkbxEraseAuthDb->setChecked( false );
@@ -226,12 +225,6 @@ void QgsCredentialDialog::requestCredentialsMasterPassword( QString *password, b
}
}

void QgsCredentialDialog::on_chkMasterPassShow_stateChanged( int state )
{
leMasterPass->setEchoMode( ( state > 0 ) ? QLineEdit::Normal : QLineEdit::Password );
leMasterPassVerify->setEchoMode( ( state > 0 ) ? QLineEdit::Normal : QLineEdit::Password );
}

void QgsCredentialDialog::on_leMasterPass_textChanged( const QString &pass )
{
leMasterPass->setStyleSheet( QLatin1String( "" ) );
@@ -22,6 +22,7 @@
#include "qgscredentials.h"

#include <QString>
#include "qgis.h"
#include "qgis_gui.h"

class QPushButton;
@@ -33,30 +34,32 @@ class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, pr
{
Q_OBJECT
public:
QgsCredentialDialog( QWidget *parent = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
//! QgsCredentialDialog constructor
QgsCredentialDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );

#ifndef SIP_RUN
signals:

//! \note not available in Python bindings
void credentialsRequested( const QString &, QString *, QString *, const QString &, bool * );

//! \note not available in Python bindings
void credentialsRequestedMasterPassword( QString *, bool, bool * );
#endif

private slots:
void requestCredentials( const QString &, QString *, QString *, const QString &, bool * );

void requestCredentialsMasterPassword( QString *password, bool stored, bool *ok );

void on_chkMasterPassShow_stateChanged( int state );
void on_leMasterPass_textChanged( const QString &pass );
void on_leMasterPassVerify_textChanged( const QString &pass );
void on_chkbxEraseAuthDb_toggled( bool checked );

protected:
virtual bool request( const QString &realm, QString &username, QString &password, const QString &message = QString::null ) override;
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null ) override;

virtual bool requestMasterPassword( QString &password, bool stored = false ) override;
virtual bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;

private:
QPushButton *mOkButton = nullptr;
@@ -121,29 +121,16 @@
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLineEdit" name="leMasterPass">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QgsPasswordLineEdit" name="leMasterPass">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="chkMasterPassShow">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Show</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLineEdit" name="leMasterPassVerify">
<item>
<widget class="QgsPasswordLineEdit" name="leMasterPassVerify">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
@@ -239,7 +226,6 @@ font-style: italic;
<tabstop>lePassword</tabstop>
<tabstop>leMasterPass</tabstop>
<tabstop>leMasterPassVerify</tabstop>
<tabstop>chkMasterPassShow</tabstop>
<tabstop>chkbxEraseAuthDb</tabstop>
</tabstops>
<resources/>

0 comments on commit c749057

Please sign in to comment.