Skip to content

Commit

Permalink
update dialogs to use new password lineedit widget
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Mar 14, 2017
1 parent f6e4c2b commit ff2d1ad
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 109 deletions.
10 changes: 0 additions & 10 deletions src/gui/auth/qgsauthmasterpassresetdialog.cpp
Expand Up @@ -80,16 +80,6 @@ void QgsMasterPasswordResetDialog::on_leMasterPassNew_textChanged( const QString
validatePasswords();
}

void QgsMasterPasswordResetDialog::on_chkPassShowCurrent_stateChanged( int state )
{
leMasterPassCurrent->setEchoMode( ( state > 0 ) ? QLineEdit::Normal : QLineEdit::Password );
}

void QgsMasterPasswordResetDialog::on_chkPassShowNew_stateChanged( int state )
{
leMasterPassNew->setEchoMode( ( state > 0 ) ? QLineEdit::Normal : QLineEdit::Password );
}

void QgsMasterPasswordResetDialog::validatePasswords()
{
QString ss1 = mPassCurOk ? QgsAuthGuiUtils::greenTextStyleSheet( QStringLiteral( "QLineEdit" ) )
Expand Down
3 changes: 0 additions & 3 deletions src/gui/auth/qgsauthmasterpassresetdialog.h
Expand Up @@ -45,9 +45,6 @@ class GUI_EXPORT QgsMasterPasswordResetDialog : public QDialog, private Ui::QgsM
void on_leMasterPassCurrent_textChanged( const QString &pass );
void on_leMasterPassNew_textChanged( const QString &pass );

void on_chkPassShowCurrent_stateChanged( int state );
void on_chkPassShowNew_stateChanged( int state );

private:
void validatePasswords();

Expand Down
77 changes: 21 additions & 56 deletions src/ui/auth/qgsauthmasterpassresetdialog.ui
Expand Up @@ -29,34 +29,14 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>6</number>
<widget class="QgsPasswordLineEdit" name="leMasterPassCurrent">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<item>
<widget class="QLineEdit" name="leMasterPassCurrent">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string>Required</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkPassShowCurrent">
<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>
</layout>
<property name="placeholderText">
<string>Required</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
Expand All @@ -73,34 +53,14 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
<widget class="QgsPasswordLineEdit" name="leMasterPassNew">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<item>
<widget class="QLineEdit" name="leMasterPassNew">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string>Required</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkPassShowNew">
<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>
</layout>
<property name="placeholderText">
<string>Required</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
Expand Down Expand Up @@ -170,11 +130,16 @@ and re-encrypted using new password</string>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsPasswordLineEdit</class>
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>leMasterPassCurrent</tabstop>
<tabstop>chkPassShowCurrent</tabstop>
<tabstop>leMasterPassNew</tabstop>
<tabstop>chkPassShowNew</tabstop>
<tabstop>chkKeepBackup</tabstop>
</tabstops>
<resources/>
Expand Down
9 changes: 8 additions & 1 deletion src/ui/qgscredentialdialog.ui
Expand Up @@ -81,7 +81,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lePassword">
<widget class="QgsPasswordLineEdit" name="lePassword">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
Expand Down Expand Up @@ -220,6 +220,13 @@ font-style: italic;
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsPasswordLineEdit</class>
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>leUsername</tabstop>
<tabstop>lePassword</tabstop>
Expand Down
22 changes: 19 additions & 3 deletions src/ui/qgsdb2newconnectionbase.ui
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>445</width>
<height>386</height>
<height>399</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -120,7 +120,16 @@
<string>Authentication</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item row="0" column="0">
Expand All @@ -134,7 +143,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtPassword">
<widget class="QgsPasswordLineEdit" name="txtPassword">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
Expand Down Expand Up @@ -189,6 +198,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsPasswordLineEdit</class>
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>txtName</tabstop>
<tabstop>txtService</tabstop>
Expand Down
7 changes: 6 additions & 1 deletion src/ui/qgsmssqlnewconnectionbase.ui
Expand Up @@ -154,7 +154,7 @@
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="txtPassword">
<widget class="QgsPasswordLineEdit" name="txtPassword">
<property name="enabled">
<bool>false</bool>
</property>
Expand Down Expand Up @@ -270,6 +270,11 @@ Untick save if you don't wish to be the case.</string>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QgsPasswordLineEdit</class>
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
<customwidget>
<class>QgsMessageBar</class>
<extends>QWidget</extends>
Expand Down
9 changes: 8 additions & 1 deletion src/ui/qgsnewhttpconnectionbase.ui
Expand Up @@ -92,7 +92,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="txtPassword">
<widget class="QgsPasswordLineEdit" name="txtPassword">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
Expand Down Expand Up @@ -262,6 +262,13 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QgsPasswordLineEdit</class>
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>txtName</tabstop>
<tabstop>txtUrl</tabstop>
Expand Down
20 changes: 18 additions & 2 deletions src/ui/qgsnewogrconnectionbase.ui
Expand Up @@ -26,7 +26,16 @@
<bool>true</bool>
</property>
<layout class="QGridLayout">
<property name="margin">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
Expand Down Expand Up @@ -135,7 +144,7 @@
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QLineEdit" name="txtPassword">
<widget class="QgsPasswordLineEdit" name="txtPassword">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
Expand Down Expand Up @@ -168,6 +177,13 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QgsPasswordLineEdit</class>
<extends>QLineEdit</extends>
<header>qgspasswordlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>cmbDatabaseTypes</tabstop>
<tabstop>txtName</tabstop>
Expand Down

0 comments on commit ff2d1ad

Please sign in to comment.