1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 14:55:43 +02:00

wizardview: fix focus, tooltip, ModalTextEdit

- replaced all line edit with ModalTextEdit components
- fixed keyboard navigation
- fixed focus and tooltips

Change-Id: I5605e1b4a7efe2910c4031e49abb78b39b1955f6
This commit is contained in:
Fadi SHEHADEH 2023-02-17 13:33:45 -05:00 committed by Aline Gondim Santos
parent e932c37528
commit 05beb246e8
7 changed files with 120 additions and 205 deletions

View file

@ -609,7 +609,7 @@ Item {
"Use the \"Link Another Device\" feature to obtain a PIN.") "Use the \"Link Another Device\" feature to obtain a PIN.")
property string connectFromAnotherDevice: qsTr("Link device") property string connectFromAnotherDevice: qsTr("Link device")
property string importButton: qsTr("Import") property string importButton: qsTr("Import")
property string pin: qsTr("PIN") property string pin: qsTr("Enter the NIP code")
property string importFromDeviceDescription: qsTr("A PIN is required to use an existing Jami account on this device.") property string importFromDeviceDescription: qsTr("A PIN is required to use an existing Jami account on this device.")
property string importStep1: qsTr("Step 1") property string importStep1: qsTr("Step 1")
property string importStep2: qsTr("Step 2") property string importStep2: qsTr("Step 2")

View file

@ -43,9 +43,8 @@ Rectangle {
function clear() { function clear() {
openedPassword = false openedPassword = false
openedNickname = false openedNickname = false
displayNameLineEdit.text = "" passwordEdit.dynamicText = ""
passwordEdit.text = "" passwordConfirmEdit.dynamicText = ""
passwordConfirmEdit.text = ""
UtilsAdapter.setTempCreationImageFromString() UtilsAdapter.setTempCreationImageFromString()
} }
@ -190,41 +189,39 @@ Rectangle {
font.pixelSize: JamiTheme.headerFontSize font.pixelSize: JamiTheme.headerFontSize
} }
EditableLineEdit { PasswordTextEdit {
id: passwordEdit id: passwordEdit
visible: openedPassword visible: openedPassword
focus: openedPassword
firstEntry: true
placeholderText: JamiStrings.password
Layout.topMargin: 10
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: 325 Layout.preferredWidth: 325
KeyNavigation.tab: passwordConfirmEdit
echoMode: TextInput.Password KeyNavigation.down: passwordConfirmEdit
placeholderText: JamiStrings.password
secondIco: JamiResources.eye_cross_svg
onSecondIcoClicked: { toggleEchoMode() }
} }
EditableLineEdit { PasswordTextEdit {
id: passwordConfirmEdit id: passwordConfirmEdit
visible: openedPassword visible: openedPassword
placeholderText: JamiStrings.confirmPassword
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: 325 Layout.preferredWidth: 325
KeyNavigation.tab: passwordEdit
echoMode: TextInput.Password KeyNavigation.up: passwordEdit
KeyNavigation.down: setButton
placeholderText: JamiStrings.confirmPassword
secondIco: JamiResources.eye_cross_svg
onSecondIcoClicked: { toggleEchoMode() }
} }
MaterialButton { MaterialButton {
id: setButton
visible: openedPassword visible: openedPassword
Layout.topMargin: 10 Layout.topMargin: 10
@ -243,12 +240,12 @@ Rectangle {
function checkEnable() { function checkEnable() {
text = JamiStrings.setPassword text = JamiStrings.setPassword
return (passwordEdit.text === passwordConfirmEdit.text return (passwordEdit.dynamicText === passwordConfirmEdit.dynamicText
&& passwordEdit.text.length !== 0) && passwordEdit.dynamicText.length !== 0)
} }
onClicked: { onClicked: {
root.validatedPassword = passwordConfirmEdit.text root.validatedPassword = passwordConfirmEdit.dynamicText
text = JamiStrings.setPasswordSuccess text = JamiStrings.setPasswordSuccess
} }
@ -335,7 +332,6 @@ Rectangle {
} }
} }
Item { Item {
Layout.alignment: Qt.AlignRight | Qt.AlignTop Layout.alignment: Qt.AlignRight | Qt.AlignTop
@ -444,18 +440,17 @@ Rectangle {
} }
EditableLineEdit { ModalTextEdit {
id: displayNameLineEdit id: displayNameLineEdit
visible: openedNickname visible: openedNickname
focus: openedNickname
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: 280 Layout.preferredWidth: 280
placeholderText: JamiStrings.enterNickname placeholderText: JamiStrings.enterNickname
onEditingFinished: root.alias = text onAccepted: root.alias = displayNameLineEdit.dynamicText
} }
@ -550,7 +545,8 @@ Rectangle {
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2)
text: JamiStrings.optionSave text: JamiStrings.optionSave
onClicked: root.saveButtonClicked() onClicked: { root.saveButtonClicked()
root.alias = displayNameLineEdit.dynamicText}
} }
} }

View file

@ -36,9 +36,6 @@ Rectangle {
function clearAllTextFields() { function clearAllTextFields() {
connectBtn.spinnerTriggered = false connectBtn.spinnerTriggered = false
usernameManagerEdit.clear()
passwordManagerEdit.clear()
accountManagerEdit.clear()
errorText = "" errorText = ""
} }
@ -104,7 +101,7 @@ Rectangle {
wrapMode : Text.WordWrap wrapMode : Text.WordWrap
} }
EditableLineEdit { ModalTextEdit {
id: accountManagerEdit id: accountManagerEdit
objectName: "accountManagerEdit" objectName: "accountManagerEdit"
@ -112,22 +109,15 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
fontSize: 15
Layout.topMargin: 5 Layout.topMargin: 5
focus: visible focus: visible
secondIco: JamiResources.outline_info_24dp_svg placeholderText: JamiStrings.jamiManagementServerURL
selectByMouse: true
placeholderText: JamiStrings.jamiManagementServerURL //problem with resize
font.pointSize: JamiTheme.textFontSize
font.kerning: true
KeyNavigation.tab: usernameManagerEdit
KeyNavigation.up: backButton KeyNavigation.up: backButton
KeyNavigation.down: usernameManagerEdit KeyNavigation.down: usernameManagerEdit
KeyNavigation.tab: KeyNavigation.down
onTextChanged: errorText = ""
onAccepted: usernameManagerEdit.forceActiveFocus() onAccepted: usernameManagerEdit.forceActiveFocus()
} }
@ -152,7 +142,7 @@ Rectangle {
credentialsLabel.font, credentialsLabel.text).height credentialsLabel.font, credentialsLabel.text).height
} }
EditableLineEdit { ModalTextEdit {
id: usernameManagerEdit id: usernameManagerEdit
@ -161,24 +151,16 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
fontSize: 15
secondIco: JamiResources.outline_info_24dp_svg
selectByMouse: true
placeholderText: JamiStrings.username placeholderText: JamiStrings.username
font.pointSize: JamiTheme.textFontSize
font.kerning: true
KeyNavigation.tab: passwordManagerEdit
KeyNavigation.up: accountManagerEdit KeyNavigation.up: accountManagerEdit
KeyNavigation.down: passwordManagerEdit KeyNavigation.down: passwordManagerEdit
KeyNavigation.tab: KeyNavigation.down
onTextChanged: errorText = "" onAccepted: passwordManagerEdit.forceActiveFocus()
} }
EditableLineEdit { PasswordTextEdit {
id: passwordManagerEdit id: passwordManagerEdit
@ -187,25 +169,15 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
selectByMouse: true
placeholderText: JamiStrings.password placeholderText: JamiStrings.password
font.pointSize: JamiTheme.textFontSize
font.kerning: true
Layout.topMargin: 10 Layout.topMargin: 10
secondIco: JamiResources.eye_cross_svg
thirdIco: JamiResources.outline_info_24dp_svg
fontSize: 15
echoMode: TextInput.Password
KeyNavigation.tab: connectBtn.enabled ? connectBtn : backButton
KeyNavigation.up: usernameManagerEdit KeyNavigation.up: usernameManagerEdit
KeyNavigation.down: connectBtn.enabled ? connectBtn : backButton KeyNavigation.down: connectBtn.enabled ? connectBtn : backButton
KeyNavigation.tab: KeyNavigation.down
onTextChanged: errorText = "" onAccepted: connectBtn.forceActiveFocus()
onSecondIcoClicked: { toggleEchoMode() }
} }
@ -223,16 +195,17 @@ Rectangle {
spinnerTriggeredtext: JamiStrings.creatingAccount spinnerTriggeredtext: JamiStrings.creatingAccount
normalText: JamiStrings.connect normalText: JamiStrings.connect
enabled: accountManagerEdit.text.length !== 0 enabled: accountManagerEdit.dynamicText.length !== 0
&& usernameManagerEdit.text.length !== 0 && usernameManagerEdit.dynamicText.length !== 0
&& passwordManagerEdit.text.length !== 0 && passwordManagerEdit.dynamicText.length !== 0
&& !spinnerTriggered && !spinnerTriggered
color: JamiTheme.tintedBlue color: JamiTheme.tintedBlue
KeyNavigation.tab: backButton
KeyNavigation.up: passwordManagerEdit KeyNavigation.up: passwordManagerEdit
KeyNavigation.down: backButton KeyNavigation.down: backButton
KeyNavigation.tab: KeyNavigation.down
onClicked: { onClicked: {
if (connectBtn.focus) if (connectBtn.focus)
@ -275,13 +248,14 @@ Rectangle {
preferredSize: JamiTheme.wizardViewPageBackButtonSize preferredSize: JamiTheme.wizardViewPageBackButtonSize
KeyNavigation.tab: accountManagerEdit
KeyNavigation.up: { KeyNavigation.up: {
if (connectBtn.enabled) if (connectBtn.enabled)
return connectBtn return connectBtn
return passwordManagerEdit return passwordManagerEdit
} }
KeyNavigation.down: KeyNavigation.tab KeyNavigation.down: accountManagerEdit
KeyNavigation.tab: KeyNavigation.down
onClicked: WizardViewStepModel.previousStep() onClicked: WizardViewStepModel.previousStep()
} }

View file

@ -48,7 +48,7 @@ Rectangle {
function clearAllTextFields() { function clearAllTextFields() {
chooseUsernameButton.enabled = true chooseUsernameButton.enabled = true
showAdvancedButton.enabled = true showAdvancedButton.enabled = true
usernameEdit.clear() usernameEdit.dynamicText = ""
advancedAccountSettingsPage.clear() advancedAccountSettingsPage.clear()
} }
@ -127,20 +127,19 @@ Rectangle {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
UsernameLineEdit { UsernameTextEdit {
id: usernameEdit id: usernameEdit
objectName: "usernameEdit" objectName: "usernameEdit"
accountId: "" // During creation
Layout.topMargin: 15 Layout.topMargin: 15
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
placeholderText: root.isRendezVous ? JamiStrings.chooseAName : placeholderText: root.isRendezVous ? JamiStrings.chooseAName :
JamiStrings.chooseYourUserName JamiStrings.chooseYourUserName
staticText: ""
editMode: true
focus: visible focus: visible
fontSize: 18
KeyNavigation.tab: chooseUsernameButton KeyNavigation.tab: chooseUsernameButton
KeyNavigation.up: backButton KeyNavigation.up: backButton
@ -154,10 +153,12 @@ Rectangle {
} }
} }
Label {
Layout.alignment: Qt.AlignHCenter
Label {
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
visible: text.length !==0 || usernameEdit.selected visible: text.length !==0 || usernameEdit.selected
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
text: { text: {
switch(usernameEdit.nameRegistrationState){ switch(usernameEdit.nameRegistrationState){
@ -176,7 +177,7 @@ Rectangle {
} }
} }
font.pointSize: JamiTheme.textFontSize font.pointSize: JamiTheme.textFontSize
color: JamiTheme.redColor color: "#CC0022"
} }
MaterialButton { MaterialButton {
@ -205,7 +206,7 @@ Rectangle {
WizardViewStepModel.accountCreationInfo = WizardViewStepModel.accountCreationInfo =
JamiQmlUtils.setUpAccountCreationInputPara( JamiQmlUtils.setUpAccountCreationInputPara(
{ {
registeredName : usernameEdit.text, registeredName : usernameEdit.dynamicText,
alias: advancedAccountSettingsPage.alias, alias: advancedAccountSettingsPage.alias,
password: advancedAccountSettingsPage.validatedPassword, password: advancedAccountSettingsPage.validatedPassword,
avatar: UtilsAdapter.tempCreationImage(), avatar: UtilsAdapter.tempCreationImage(),
@ -289,6 +290,7 @@ Rectangle {
KeyNavigation.down: usernameEdit KeyNavigation.down: usernameEdit
onClicked: { onClicked: {
if (createAccountStack.currentIndex > 0) { if (createAccountStack.currentIndex > 0) {
createAccountStack.currentIndex-- createAccountStack.currentIndex--
} else { } else {

View file

@ -35,11 +35,6 @@ Rectangle {
signal showThisPage signal showThisPage
function clearAllTextFields() { function clearAllTextFields() {
sipUsernameEdit.clear()
sipPasswordEdit.clear()
sipServernameEdit.clear()
sipProxyEdit.clear()
displayNameLineEdit.clear()
UtilsAdapter.setTempCreationImageFromString() UtilsAdapter.setTempCreationImageFromString()
} }
@ -106,7 +101,7 @@ Rectangle {
color: JamiTheme.textColor color: JamiTheme.textColor
} }
EditableLineEdit { ModalTextEdit {
id: sipServernameEdit id: sipServernameEdit
objectName: "sipServernameEdit" objectName: "sipServernameEdit"
@ -115,19 +110,17 @@ Rectangle {
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
focus: visible focus: visible
selectByMouse: true
placeholderText: JamiStrings.server placeholderText: JamiStrings.server
font.pointSize: JamiTheme.textFontSize
font.kerning: true
KeyNavigation.tab: sipProxyEdit
KeyNavigation.up: backButton KeyNavigation.up: backButton
KeyNavigation.down: sipProxyEdit KeyNavigation.down: sipProxyEdit
KeyNavigation.tab: KeyNavigation.down
onAccepted: sipProxyEdit.forceActiveFocus()
onEditingFinished: sipProxyEdit.forceActiveFocus()
} }
EditableLineEdit { ModalTextEdit {
id: sipProxyEdit id: sipProxyEdit
objectName: "sipProxyEdit" objectName: "sipProxyEdit"
@ -135,20 +128,17 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
focus: visible
selectByMouse: true
placeholderText: JamiStrings.proxy placeholderText: JamiStrings.proxy
font.pointSize: JamiTheme.textFontSize
font.kerning: true
KeyNavigation.tab: sipUsernameEdit
KeyNavigation.up: sipServernameEdit KeyNavigation.up: sipServernameEdit
KeyNavigation.down: sipUsernameEdit KeyNavigation.down: sipUsernameEdit
KeyNavigation.tab: KeyNavigation.down
onAccepted: sipUsernameEdit.forceActiveFocus()
onEditingFinished: sipUsernameEdit.forceActiveFocus()
} }
EditableLineEdit { ModalTextEdit {
id: sipUsernameEdit id: sipUsernameEdit
objectName: "sipUsernameEdit" objectName: "sipUsernameEdit"
@ -156,19 +146,16 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
selectByMouse: true
placeholderText: JamiStrings.username placeholderText: JamiStrings.username
font.pointSize: JamiTheme.textFontSize
font.kerning: true
KeyNavigation.tab: sipPasswordEdit
KeyNavigation.up: sipProxyEdit KeyNavigation.up: sipProxyEdit
KeyNavigation.down: sipPasswordEdit KeyNavigation.down: sipPasswordEdit
KeyNavigation.tab: KeyNavigation.down
onEditingFinished: sipPasswordEdit.forceActiveFocus() onAccepted: sipPasswordEdit.forceActiveFocus()
} }
EditableLineEdit { PasswordTextEdit {
id: sipPasswordEdit id: sipPasswordEdit
objectName: "sipPasswordEdit" objectName: "sipPasswordEdit"
@ -176,23 +163,14 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
selectByMouse: true
echoMode: TextInput.Password
placeholderText: JamiStrings.password placeholderText: JamiStrings.password
font.pointSize: JamiTheme.textFontSize
font.kerning: true
KeyNavigation.tab: createAccountButton
KeyNavigation.up: sipUsernameEdit KeyNavigation.up: sipUsernameEdit
KeyNavigation.down: createAccountButton KeyNavigation.down: createAccountButton
KeyNavigation.tab: KeyNavigation.down
secondIco: JamiResources.eye_cross_svg onAccepted: createAccountButton.forceActiveFocus()
onEditingFinished: createAccountButton.forceActiveFocus()
onSecondIcoClicked: { toggleEchoMode() }
} }
MaterialButton { MaterialButton {
@ -207,18 +185,18 @@ Rectangle {
text: JamiStrings.addSip text: JamiStrings.addSip
KeyNavigation.tab: personalizeAccount
KeyNavigation.up: sipPasswordEdit KeyNavigation.up: sipPasswordEdit
KeyNavigation.down: personalizeAccount KeyNavigation.down: personalizeAccount
KeyNavigation.tab: KeyNavigation.down
onClicked: { onClicked: {
WizardViewStepModel.accountCreationInfo = WizardViewStepModel.accountCreationInfo =
JamiQmlUtils.setUpAccountCreationInputPara( JamiQmlUtils.setUpAccountCreationInputPara(
{hostname : sipServernameEdit.text, {hostname : sipServernameEdit.dynamicText,
alias: displayNameLineEdit.text, alias: displayNameLineEdit.dynamicText,
username : sipUsernameEdit.text, username : sipUsernameEdit.dynamicText,
password : sipPasswordEdit.text, password : sipPasswordEdit.dynamicText,
proxy : sipProxyEdit.text, proxy : sipProxyEdit.dynamicText,
avatar: UtilsAdapter.tempCreationImage()}) avatar: UtilsAdapter.tempCreationImage()})
WizardViewStepModel.nextStep() WizardViewStepModel.nextStep()
} }
@ -235,9 +213,9 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: JamiTheme.wizardViewPageBackButtonMargins*2 Layout.bottomMargin: JamiTheme.wizardViewPageBackButtonMargins*2
KeyNavigation.tab: backButton
KeyNavigation.up: createAccountButton KeyNavigation.up: createAccountButton
KeyNavigation.down: backButton KeyNavigation.down: backButton
KeyNavigation.tab: KeyNavigation.down
onClicked: createAccountStack.currentIndex += 1 onClicked: createAccountStack.currentIndex += 1
} }
@ -286,20 +264,14 @@ Rectangle {
buttonSize: JamiTheme.smartListAvatarSize buttonSize: JamiTheme.smartListAvatarSize
} }
EditableLineEdit { ModalTextEdit {
id: displayNameLineEdit id: displayNameLineEdit
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(300, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(300, root.width - JamiTheme.preferredMarginSize * 2)
Layout.topMargin: 30 Layout.topMargin: 30
verticalAlignment: Text.AlignVCenter
font.pointSize: JamiTheme.textFontSize
placeholderText: JamiStrings.enterNickname placeholderText: JamiStrings.enterNickname
color: JamiTheme.textColor
} }
Text { Text {
@ -315,11 +287,8 @@ Rectangle {
font.pixelSize: JamiTheme.headerFontSize font.pixelSize: JamiTheme.headerFontSize
color: JamiTheme.textColor color: JamiTheme.textColor
} }
} }
} }
} }
BackButton { BackButton {
@ -333,9 +302,9 @@ Rectangle {
preferredSize: JamiTheme.wizardViewPageBackButtonSize preferredSize: JamiTheme.wizardViewPageBackButtonSize
KeyNavigation.tab: sipServernameEdit
KeyNavigation.up: personalizeAccount KeyNavigation.up: personalizeAccount
KeyNavigation.down: sipServernameEdit KeyNavigation.down: sipServernameEdit
KeyNavigation.tab: KeyNavigation.down
onClicked: { onClicked: {
if (createAccountStack.currentIndex !== 0) { if (createAccountStack.currentIndex !== 0) {

View file

@ -41,7 +41,6 @@ Rectangle {
function clearAllTextFields() { function clearAllTextFields() {
connectBtn.spinnerTriggered = false connectBtn.spinnerTriggered = false
passwordFromBackupEdit.clear()
filePath = "" filePath = ""
errorText = "" errorText = ""
fileImportBtnText = JamiStrings.selectArchiveFile fileImportBtnText = JamiStrings.selectArchiveFile
@ -113,6 +112,7 @@ Rectangle {
secondary: true secondary: true
color: JamiTheme.secAndTertiTextColor color: JamiTheme.secAndTertiTextColor
secHoveredColor: JamiTheme.secAndTertiHoveredBackgroundColor secHoveredColor: JamiTheme.secAndTertiHoveredBackgroundColor
focus: visible
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.topMargin: 35 Layout.topMargin: 35
@ -122,9 +122,9 @@ Rectangle {
text: fileImportBtnText text: fileImportBtnText
toolTipText: JamiStrings.importAccountArchive toolTipText: JamiStrings.importAccountArchive
KeyNavigation.tab: passwordFromBackupEdit
KeyNavigation.up: backButton KeyNavigation.up: backButton
KeyNavigation.down: passwordFromBackupEdit KeyNavigation.down: passwordFromBackupEdit
KeyNavigation.tab: KeyNavigation.down
onClicked: { onClicked: {
errorText = "" errorText = ""
@ -143,6 +143,7 @@ Rectangle {
filePath = file filePath = file
if (file.length !== "") { if (file.length !== "") {
fileImportBtnText = UtilsAdapter.toFileInfoName(file) fileImportBtnText = UtilsAdapter.toFileInfoName(file)
passwordFromBackupEdit.forceActiveFocus()
} else { } else {
fileImportBtnText = JamiStrings.archive fileImportBtnText = JamiStrings.archive
} }
@ -153,7 +154,7 @@ Rectangle {
} }
} }
EditableLineEdit { PasswordTextEdit {
id: passwordFromBackupEdit id: passwordFromBackupEdit
objectName: "passwordFromBackupEdit" objectName: "passwordFromBackupEdit"
@ -162,25 +163,13 @@ Rectangle {
Layout.topMargin: 20 Layout.topMargin: 20
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2) Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
focus: visible placeholderText: JamiStrings.enterPassword
selectByMouse: true
placeholderText: JamiStrings.password
font.pointSize: JamiTheme.textFontSize
font.kerning: true
secondIco: JamiResources.eye_cross_svg
echoMode: TextInput.Password
KeyNavigation.tab: connectBtn.enabled ? connectBtn : backButton
KeyNavigation.up: fileImportBtn KeyNavigation.up: fileImportBtn
KeyNavigation.down: connectBtn.enabled ? connectBtn : backButton KeyNavigation.down: connectBtn.enabled ? connectBtn : backButton
KeyNavigation.tab: KeyNavigation.down
onTextChanged: errorText = "" onAccepted: connectBtn.forceActiveFocus()
onSecondIcoClicked: { toggleEchoMode() }
} }
SpinnerButton { SpinnerButton {
@ -207,9 +196,9 @@ Rectangle {
return false return false
} }
KeyNavigation.tab: backButton
KeyNavigation.up: passwordFromBackupEdit KeyNavigation.up: passwordFromBackupEdit
KeyNavigation.down: backButton KeyNavigation.down: backButton
KeyNavigation.tab: KeyNavigation.down
onClicked: { onClicked: {
if (connectBtn.focus) if (connectBtn.focus)
@ -219,7 +208,7 @@ Rectangle {
WizardViewStepModel.accountCreationInfo = WizardViewStepModel.accountCreationInfo =
JamiQmlUtils.setUpAccountCreationInputPara( JamiQmlUtils.setUpAccountCreationInputPara(
{archivePath : UtilsAdapter.getAbsPath(filePath), {archivePath : UtilsAdapter.getAbsPath(filePath),
password : passwordFromBackupEdit.text}) password : passwordFromBackupEdit.dynamicText})
WizardViewStepModel.nextStep() WizardViewStepModel.nextStep()
} }
} }

View file

@ -40,8 +40,6 @@ Rectangle {
function clearAllTextFields() { function clearAllTextFields() {
connectBtn.spinnerTriggered = false connectBtn.spinnerTriggered = false
pinFromDevice.clear()
passwordFromDevice.clear()
} }
function errorOccured(errorMessage) { function errorOccured(errorMessage) {
@ -139,10 +137,9 @@ Rectangle {
} }
EditableLineEdit { ModalTextEdit {
id: pinFromDevice id: pinFromDevice
objectName: "pinFromDevice" objectName: "pinFromDevice"
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
@ -151,52 +148,40 @@ Rectangle {
focus: visible focus: visible
selectByMouse: true
placeholderText: JamiStrings.pin placeholderText: JamiStrings.pin
font.pointSize: JamiTheme.textFontSize staticText: ""
font.kerning: true
KeyNavigation.tab: { KeyNavigation.up: backButton
KeyNavigation.down: passwordFromDevice
KeyNavigation.tab: KeyNavigation.down
onAccepted: passwordFromDevice.forceActiveFocus()
}
PasswordTextEdit {
id: passwordFromDevice
objectName: "passwordFromDevice"
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
placeholderText: JamiStrings.enterPassword
KeyNavigation.up: pinFromDevice
KeyNavigation.down: {
if (connectBtn.enabled) if (connectBtn.enabled)
return connectBtn return connectBtn
else if (connectBtn.spinnerTriggered) else if (connectBtn.spinnerTriggered)
return passwordFromDevice return passwordFromDevice
return backButton return backButton
} }
KeyNavigation.up: passwordFromDevice KeyNavigation.tab: KeyNavigation.down
KeyNavigation.down: KeyNavigation.tab
onTextChanged: errorText = "" onAccepted: pinFromDevice.forceActiveFocus()
} }
EditableLineEdit {
id: passwordFromDevice
objectName: "passwordFromDevice"
underlined: true
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Math.min(440, root.width - JamiTheme.preferredMarginSize * 2)
secondIco: JamiResources.eye_cross_svg
selectByMouse: true
placeholderText: JamiStrings.password
font.pointSize: JamiTheme.textFontSize
font.kerning: true
echoMode: TextInput.Password
KeyNavigation.tab: connectBtn.enabled ? connectBtn : backButton
KeyNavigation.up: pinFromDevice
KeyNavigation.down: connectBtn.enabled ? connectBtn : backButton
onTextChanged: errorText = ""
onEditingFinished: pinFromDevice.forceActiveFocus()
onSecondIcoClicked: { toggleEchoMode() }
}
SpinnerButton { SpinnerButton {
id: connectBtn id: connectBtn
color: JamiTheme.tintedBlue color: JamiTheme.tintedBlue
@ -212,7 +197,7 @@ Rectangle {
spinnerTriggeredtext: JamiStrings.generatingAccount spinnerTriggeredtext: JamiStrings.generatingAccount
normalText: JamiStrings.connectFromAnotherDevice normalText: JamiStrings.connectFromAnotherDevice
enabled: pinFromDevice.text.length !== 0 && !spinnerTriggered enabled: pinFromDevice.dynamicText.length !== 0 && !spinnerTriggered
KeyNavigation.tab: backButton KeyNavigation.tab: backButton
KeyNavigation.up: passwordFromDevice KeyNavigation.up: passwordFromDevice
@ -223,8 +208,8 @@ Rectangle {
WizardViewStepModel.accountCreationInfo = WizardViewStepModel.accountCreationInfo =
JamiQmlUtils.setUpAccountCreationInputPara( JamiQmlUtils.setUpAccountCreationInputPara(
{archivePin : pinFromDevice.text, {archivePin : pinFromDevice.dynamicText,
password : passwordFromDevice.text}) password : passwordFromDevice.dynamicText})
WizardViewStepModel.nextStep() WizardViewStepModel.nextStep()
} }
} }