Index: sources/gui/qml/pages/UserConfirmation.qml =================================================================== diff -u -rd949be21f2a9badd0978dddaaf436f6805de28dc -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/gui/qml/pages/UserConfirmation.qml (.../UserConfirmation.qml) (revision d949be21f2a9badd0978dddaaf436f6805de28dc) +++ sources/gui/qml/pages/UserConfirmation.qml (.../UserConfirmation.qml) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -29,86 +29,96 @@ SettingsBase { id: _root objectName : "UserConfirmation" // SquishQt testability - property bool isPassword : false - property bool showPasswordReEntryField : false - readonly property string password : _password.textInput.text - readonly property string passwordReEntry : _passwordReEntry.textInput.text - property alias message : _message.text + property bool isPassword : false + property bool passwordChangeMode : false + readonly property string passwordCurrent : _passwordCurrent.textInput.text + readonly property string passwordUpdated : _passwordUpdated.textInput.text + readonly property string passwordConfirm : _passwordConfirm.textInput.text + property alias message : _message.text - function clearPasswordReEntry() { - _passwordReEntry.textInput.text = "" + function clearPasswordCurrnet() { _passwordCurrent.textInput.text = "" } + function clearPasswordUpdated() { _passwordUpdated.textInput.text = "" } + function clearPasswordReEntry() { _passwordConfirm.textInput.text = "" } + function clearPasswords () { + clearPasswordCurrnet() + clearPasswordUpdated() + clearPasswordReEntry() } - function clearPassword() { - _password.textInput.text = "" - } + firstFocusInput : isPassword ? _passwordCurrent : undefined - firstFocusInput : isPassword ? _password : undefined - TextEntry { id : _password - clip : true - visible : _root.isPassword - textInput .width : 450 - nextInput : _passwordReEntry + Column { + visible: isPassword + anchors { - top : parent.top - topMargin : { - if(_root.showPasswordReEntryField) { - return topMarginContent + 120 - _passwordReEntry.height - } else { - return topMarginContent + 120 // moved a little down to be more on center and close to keyboard top edge. - } + top : parent.top + horizontalCenter : parent.horizontalCenter + topMargin : passwordChangeMode ? 0 : 120 + } + + PasswordEntry { id: _passwordCurrent + label.text : ! passwordChangeMode ? "" : qsTr("Current") + label.width : ! passwordChangeMode ? 0 : labelWidth + nextInput : _passwordUpdated + anchors { + top : parent.top + topMargin : topMarginContent + horizontalCenter : parent.horizontalCenter } - horizontalCenter: parent.horizontalCenter } - textInput.inputMethodHints : Qt.ImhNone - textInput.echoMode : TextInput.Password - } - Image { id : _showPassword - visible : _password.visible - anchors.left : _password.right - anchors.leftMargin : Variables.minVGap - anchors.verticalCenter : _password.verticalCenter - width : Variables.iconsDiameter - height : Variables.iconsDiameter - source : "qrc:/images/iEye" - } + PasswordEntry { id: _passwordUpdated + visible : passwordChangeMode + label.text : qsTr("New") + nextInput : _passwordConfirm + anchors { + top : _passwordCurrent.bottom + horizontalCenter : parent.horizontalCenter + } + } - MouseArea { - anchors.fill: _showPassword - anchors.margins: -20 - onPressed : _password.textInput.echoMode = TextInput.Normal - onReleased : _password.textInput.echoMode = TextInput.Password + PasswordEntry { id: _passwordConfirm + visible : passwordChangeMode + label.text : qsTr("Confirm") + anchors { + top : _passwordUpdated.bottom + horizontalCenter : parent.horizontalCenter + } + } } + component PasswordEntry : Item { + property alias textInput : _passwordEntry.textInput + property alias nextInput : _passwordEntry.nextInput + property alias label : _passwordEntry.label + property int labelWidth : 150 - TextEntry { id : _passwordReEntry - clip : true - visible : _root.showPasswordReEntryField - textInput .width : 450 - anchors { - top : _password.bottom - topMargin : height/2 // moved a little down to be more on center and close to keyboard top edge. - horizontalCenter: _password.horizontalCenter + height : 70 + label.width : labelWidth + + TextEntry { id: _passwordEntry + clip : true + textInput .width : 450 + textInput.inputMethodHints : Qt.ImhNone + textInput.echoMode : TextInput.Password + anchors.horizontalCenter : parent.horizontalCenter } - textInput.inputMethodHints : Qt.ImhNone - textInput.echoMode : TextInput.Password - } - Image { id : _showPasswordReEntryImage - visible : _passwordReEntry.visible - anchors.left : _passwordReEntry.right - anchors.leftMargin : Variables.minVGap - anchors.verticalCenter : _passwordReEntry.verticalCenter - width : Variables.iconsDiameter - height : Variables.iconsDiameter - source : "qrc:/images/iEye" - } + Image { + visible : _passwordEntry.visible + anchors.left : _passwordEntry.right + anchors.leftMargin : Variables.minVGap + anchors.verticalCenter : _passwordEntry.verticalCenter + width : Variables.iconsDiameter + height : Variables.iconsDiameter + source : "qrc:/images/iEye" - MouseArea { - anchors.fill: _showPasswordReEntryImage - anchors.margins: -20 - onPressed : _passwordReEntry.textInput.echoMode = TextInput.Normal - onReleased : _passwordReEntry.textInput.echoMode = TextInput.Password + MouseArea { + anchors.fill: parent + anchors.margins: -20 + onPressed : _passwordEntry.textInput.echoMode = TextInput.Normal + onReleased : _passwordEntry.textInput.echoMode = TextInput.Password + } + } } Text { id : _message