mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-21 16:05:26 +02:00
settingsview: updated lineEdits
- replaced line edits with ModalTextEdit components Change-Id: I0e386b443d6d46dcc412e36a6956add595337b58
This commit is contained in:
parent
c722ddb280
commit
e932c37528
17 changed files with 73 additions and 92 deletions
|
@ -95,4 +95,4 @@ BaseModalDialog {
|
|||
onClicked: close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,15 +85,15 @@ BaseModalDialog {
|
|||
function validatePassword() {
|
||||
switch (purpose) {
|
||||
case PasswordDialog.ExportAccount:
|
||||
btnConfirm.enabled = currentPasswordEdit.length > 0
|
||||
btnConfirm.enabled = currentPasswordEdit.dynamicText.length > 0
|
||||
break
|
||||
case PasswordDialog.SetPassword:
|
||||
btnConfirm.enabled = passwordEdit.length > 0 &&
|
||||
passwordEdit.text === confirmPasswordEdit.text
|
||||
passwordEdit.dynamicText === confirmPasswordEdit.dynamicText
|
||||
break
|
||||
default:
|
||||
btnConfirm.enabled = currentPasswordEdit.length > 0 &&
|
||||
passwordEdit.text === confirmPasswordEdit.text
|
||||
btnConfirm.enabled = currentPasswordEdit.dynamicText.length > 0 &&
|
||||
passwordEdit.dynamicText === confirmPasswordEdit.dynamicText
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ BaseModalDialog {
|
|||
success = AccountAdapter.exportToFile(
|
||||
LRCInstance.currentAccountId,
|
||||
path,
|
||||
currentPasswordEdit.text)
|
||||
currentPasswordEdit.dynamicText)
|
||||
}
|
||||
reportStatus(success)
|
||||
|
||||
|
@ -113,8 +113,8 @@ BaseModalDialog {
|
|||
function savePasswordQML() {
|
||||
var success = AccountAdapter.savePassword(
|
||||
LRCInstance.currentAccountId,
|
||||
currentPasswordEdit.text,
|
||||
passwordEdit.text)
|
||||
currentPasswordEdit.dynamicText,
|
||||
passwordEdit.dynamicText)
|
||||
reportStatus(success)
|
||||
close()
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ BaseModalDialog {
|
|||
}
|
||||
}
|
||||
|
||||
MaterialLineEdit {
|
||||
PasswordTextEdit {
|
||||
id: currentPasswordEdit
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
@ -145,15 +145,13 @@ BaseModalDialog {
|
|||
|
||||
visible: purpose === PasswordDialog.ChangePassword ||
|
||||
purpose === PasswordDialog.ExportAccount
|
||||
echoMode: TextInput.Password
|
||||
placeholderText: JamiStrings.enterCurrentPassword
|
||||
|
||||
onVisibleChanged: clear()
|
||||
onDynamicTextChanged: popupContentColumnLayout.validatePassword()
|
||||
|
||||
onTextChanged: popupContentColumnLayout.validatePassword()
|
||||
}
|
||||
|
||||
MaterialLineEdit {
|
||||
PasswordTextEdit {
|
||||
id: passwordEdit
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
@ -162,15 +160,13 @@ BaseModalDialog {
|
|||
|
||||
visible: purpose === PasswordDialog.ChangePassword ||
|
||||
purpose === PasswordDialog.SetPassword
|
||||
echoMode: TextInput.Password
|
||||
|
||||
placeholderText: JamiStrings.enterNewPassword
|
||||
|
||||
onVisibleChanged: clear()
|
||||
|
||||
onTextChanged: popupContentColumnLayout.validatePassword()
|
||||
onDynamicTextChanged: popupContentColumnLayout.validatePassword()
|
||||
}
|
||||
|
||||
MaterialLineEdit {
|
||||
PasswordTextEdit {
|
||||
id: confirmPasswordEdit
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
@ -179,12 +175,10 @@ BaseModalDialog {
|
|||
|
||||
visible: purpose === PasswordDialog.ChangePassword ||
|
||||
purpose === PasswordDialog.SetPassword
|
||||
echoMode: TextInput.Password
|
||||
|
||||
placeholderText: JamiStrings.confirmNewPassword
|
||||
|
||||
onVisibleChanged: clear()
|
||||
|
||||
onTextChanged: popupContentColumnLayout.validatePassword()
|
||||
onDynamicTextChanged: popupContentColumnLayout.validatePassword()
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
|
@ -89,6 +89,4 @@ Item {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -149,6 +149,9 @@ Item {
|
|||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||
fontPointSize: JamiTheme.textFontSize + 1
|
||||
staticText: hasRegisteredName ? registeredName : infohash
|
||||
editMode: false
|
||||
isPersistent: false
|
||||
|
||||
onAccepted: {
|
||||
if (dynamicText === '') {
|
||||
|
|
|
@ -26,6 +26,8 @@ import net.jami.Constants 1.1
|
|||
import "../../commoncomponents"
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
spacing: 8
|
||||
id: root
|
||||
|
||||
Connections {
|
||||
|
|
|
@ -122,12 +122,12 @@ ColumnLayout {
|
|||
|
||||
enabled: checkBoxTurnEnable.checked
|
||||
|
||||
textField: CurrentAccount.server_TURN
|
||||
staticText: CurrentAccount.server_TURN
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.turnAdress
|
||||
|
||||
onEditFinished: CurrentAccount.server_TURN = textField
|
||||
onEditFinished: CurrentAccount.server_TURN = dynamicText
|
||||
}
|
||||
|
||||
SettingsMaterialLineEdit {
|
||||
|
@ -138,12 +138,12 @@ ColumnLayout {
|
|||
|
||||
enabled: checkBoxTurnEnable.checked
|
||||
|
||||
textField: CurrentAccount.username_TURN
|
||||
staticText: CurrentAccount.username_TURN
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.turnUsername
|
||||
|
||||
onEditFinished: CurrentAccount.username_TURN = textField
|
||||
onEditFinished: CurrentAccount.username_TURN = dynamicText
|
||||
}
|
||||
|
||||
SettingsMaterialLineEdit {
|
||||
|
@ -154,12 +154,12 @@ ColumnLayout {
|
|||
|
||||
enabled: checkBoxTurnEnable.checked
|
||||
|
||||
textField: CurrentAccount.password_TURN
|
||||
staticText: CurrentAccount.password_TURN
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.turnPassword
|
||||
|
||||
onEditFinished: CurrentAccount.password_TURN = textField
|
||||
onEditFinished: CurrentAccount.password_TURN = dynamicText
|
||||
}
|
||||
|
||||
SettingsMaterialLineEdit {
|
||||
|
@ -170,12 +170,12 @@ ColumnLayout {
|
|||
|
||||
enabled: checkBoxTurnEnable.checked
|
||||
|
||||
textField: CurrentAccount.realm_TURN
|
||||
staticText: CurrentAccount.realm_TURN
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.turnRealm
|
||||
|
||||
onEditFinished: CurrentAccount.realm_TURN = textField
|
||||
onEditFinished: CurrentAccount.realm_TURN = dynamicText
|
||||
}
|
||||
|
||||
ToggleSwitch {
|
||||
|
@ -201,12 +201,12 @@ ColumnLayout {
|
|||
enabled: checkBoxSTUNEnable.checked
|
||||
visible: isSIP
|
||||
|
||||
textField: CurrentAccount.server_STUN
|
||||
staticText: CurrentAccount.server_STUN
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.stunAdress
|
||||
|
||||
onEditFinished: CurrentAccount.server_STUN = textField
|
||||
onEditFinished: CurrentAccount.server_STUN = dynamicText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,9 +131,9 @@ ColumnLayout {
|
|||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.privateKeyPassword
|
||||
|
||||
textField: CurrentAccount.password_TLS
|
||||
staticText: CurrentAccount.password_TLS
|
||||
|
||||
onEditFinished: CurrentAccount.password_TLS = textField
|
||||
onEditFinished: CurrentAccount.password_TLS = dynamicText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ ColumnLayout {
|
|||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.address
|
||||
|
||||
textField: CurrentAccount.uri_RingNS
|
||||
staticText: CurrentAccount.uri_RingNS
|
||||
|
||||
onEditFinished: CurrentAccount.uri_RingNS = textField
|
||||
onEditFinished: CurrentAccount.uri_RingNS = dynamicText
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,12 +82,12 @@ ColumnLayout {
|
|||
|
||||
enabled: checkBoxEnableProxy.checked
|
||||
|
||||
textField: CurrentAccount.proxyServer
|
||||
staticText: CurrentAccount.proxyServer
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.proxyAddress
|
||||
|
||||
onEditFinished: CurrentAccount.proxyServer = textField
|
||||
onEditFinished: CurrentAccount.proxyServer = dynamicText
|
||||
}
|
||||
|
||||
SettingsMaterialLineEdit {
|
||||
|
@ -96,12 +96,12 @@ ColumnLayout {
|
|||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
|
||||
textField: CurrentAccount.hostname
|
||||
staticText: CurrentAccount.hostname
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.bootstrap
|
||||
|
||||
onEditFinished: CurrentAccount.hostname = textField
|
||||
onEditFinished: CurrentAccount.hostname = dynamicText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,9 +83,9 @@ ColumnLayout {
|
|||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.address
|
||||
|
||||
textField: CurrentAccount.publishedAddress
|
||||
staticText: CurrentAccount.publishedAddress
|
||||
|
||||
onEditFinished: CurrentAccount.publishedAddress = textField
|
||||
onEditFinished: CurrentAccount.publishedAddress = dynamicText
|
||||
}
|
||||
|
||||
SettingSpinBox {
|
||||
|
|
|
@ -189,9 +189,9 @@ ColumnLayout {
|
|||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.privateKeyPassword
|
||||
|
||||
textField: CurrentAccount.password_TLS
|
||||
staticText: CurrentAccount.password_TLS
|
||||
|
||||
onEditFinished: CurrentAccount.password_TLS = textField
|
||||
onEditFinished: CurrentAccount.password_TLS = dynamicText
|
||||
}
|
||||
|
||||
ToggleSwitch {
|
||||
|
@ -270,9 +270,9 @@ ColumnLayout {
|
|||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.tlsServerName
|
||||
|
||||
textField: CurrentAccount.serverName_TLS
|
||||
staticText: CurrentAccount.serverName_TLS
|
||||
|
||||
onEditFinished: CurrentAccount.serverName_TLS = textField
|
||||
onEditFinished: CurrentAccount.serverName_TLS = dynamicText
|
||||
}
|
||||
|
||||
SettingSpinBox {
|
||||
|
|
|
@ -50,8 +50,8 @@ ColumnLayout {
|
|||
itemWidth: root.itemWidth
|
||||
titleField: JamiStrings.voiceMailDialCode
|
||||
|
||||
textField: CurrentAccount.mailbox
|
||||
staticText: CurrentAccount.mailbox
|
||||
|
||||
onEditFinished: CurrentAccount.mailbox = textField
|
||||
onEditFinished: CurrentAccount.mailbox = dynamicText
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,7 @@ ColumnLayout {
|
|||
text: CurrentAccount.registeredName
|
||||
readOnly: CurrentAccount.registeredName !== ""
|
||||
font.bold: CurrentAccount.registeredName !== ""
|
||||
|
||||
loseFocusWhenEnterPressed: btnRegisterName.visible
|
||||
|
||||
onEditingFinished: {
|
||||
|
|
|
@ -100,7 +100,6 @@ BaseModalDialog {
|
|||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
infoLabel.text = JamiStrings.pinTimerInfos
|
||||
passwordEdit.clear()
|
||||
|
||||
if(CurrentAccount.hasArchivePassword) {
|
||||
stackedWidget.currentIndex = enterPasswordPage.pageIndex
|
||||
|
@ -133,21 +132,17 @@ BaseModalDialog {
|
|||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
MaterialLineEdit {
|
||||
PasswordTextEdit {
|
||||
id: passwordEdit
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.preferredWidth: JamiTheme.preferredFieldWidth
|
||||
Layout.preferredHeight: 48
|
||||
|
||||
echoMode: TextInput.Password
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
placeholderText: JamiStrings.enterCurrentPassword
|
||||
|
||||
onTextChanged: {
|
||||
btnConfirm.enabled = text.length > 0
|
||||
onDynamicTextChanged: {
|
||||
btnConfirm.enabled = dynamicText.length > 0
|
||||
}
|
||||
|
||||
onAccepted: btnConfirm.clicked()
|
||||
|
|
|
@ -58,21 +58,17 @@ BaseModalDialog {
|
|||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
MaterialLineEdit {
|
||||
PasswordTextEdit {
|
||||
id: passwordEdit
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.preferredWidth: JamiTheme.preferredFieldWidth
|
||||
Layout.preferredHeight: visible ? 48 : 0
|
||||
|
||||
echoMode: TextInput.Password
|
||||
placeholderText: JamiStrings.enterCurrentPassword
|
||||
|
||||
onVisibleChanged: passwordEdit.clear()
|
||||
onDynamicTextChanged: btnRemove.enabled = dynamicText.length > 0
|
||||
|
||||
onTextChanged: {
|
||||
btnRemove.enabled = text.length > 0
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
|
@ -36,12 +36,12 @@ ColumnLayout {
|
|||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
|
||||
textField: CurrentAccount.username
|
||||
staticText: CurrentAccount.username
|
||||
|
||||
titleField: JamiStrings.username
|
||||
itemWidth: root.itemWidth
|
||||
|
||||
onEditFinished: CurrentAccount.username = textField
|
||||
onEditFinished: CurrentAccount.username = dynamicText
|
||||
}
|
||||
|
||||
SettingsMaterialLineEdit {
|
||||
|
@ -50,12 +50,12 @@ ColumnLayout {
|
|||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
|
||||
textField: CurrentAccount.hostname
|
||||
staticText: CurrentAccount.hostname
|
||||
|
||||
titleField: JamiStrings.server
|
||||
itemWidth: root.itemWidth
|
||||
|
||||
onEditFinished: CurrentAccount.hostname = textField
|
||||
onEditFinished: CurrentAccount.hostname = dynamicText
|
||||
}
|
||||
|
||||
SettingsMaterialLineEdit {
|
||||
|
@ -64,18 +64,18 @@ ColumnLayout {
|
|||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
|
||||
textField: CurrentAccount.routeset
|
||||
staticText: CurrentAccount.routeset
|
||||
|
||||
titleField: JamiStrings.proxy
|
||||
itemWidth: root.itemWidth
|
||||
|
||||
onEditFinished: CurrentAccount.routeset = textField
|
||||
onEditFinished: CurrentAccount.routeset = dynamicText
|
||||
}
|
||||
|
||||
SettingsMaterialLineEdit {
|
||||
id: passSIPlineEdit
|
||||
|
||||
textField: CurrentAccount.password
|
||||
staticText: CurrentAccount.password
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
|
@ -83,8 +83,7 @@ ColumnLayout {
|
|||
titleField: JamiStrings.password
|
||||
|
||||
itemWidth: root.itemWidth
|
||||
echoMode: TextInput.Password
|
||||
|
||||
onEditFinished: CurrentAccount.password = textField
|
||||
onEditFinished: CurrentAccount.password = dynamicText
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,12 +29,12 @@ RowLayout {
|
|||
id: root
|
||||
|
||||
property alias titleField: title.text
|
||||
property alias textField: materialLineEdit.text
|
||||
property alias enabled: materialLineEdit.enabled
|
||||
property alias staticText: modalTextEdit.staticText
|
||||
property alias placeholderText: modalTextEdit.placeholderText
|
||||
property alias enabled: modalTextEdit.enabled
|
||||
property alias dynamicText: modalTextEdit.dynamicText
|
||||
|
||||
property int itemWidth
|
||||
property int wrapMode: Text.NoWrap
|
||||
property int echoMode: TextInput.Normal
|
||||
|
||||
signal editFinished
|
||||
|
||||
|
@ -54,24 +54,17 @@ RowLayout {
|
|||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
MaterialLineEdit {
|
||||
id: materialLineEdit
|
||||
|
||||
ModalTextEdit {
|
||||
id: modalTextEdit
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.preferredWidth: itemWidth
|
||||
Layout.preferredHeight: root.height
|
||||
Layout.maximumHeight: 40
|
||||
staticText: staticText
|
||||
placeholderText: ""
|
||||
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
font.kerning: true
|
||||
onAccepted: {
|
||||
editFinished()
|
||||
}
|
||||
|
||||
padding: 8
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
loseFocusWhenEnterPressed: true
|
||||
wrapMode: root.wrapMode
|
||||
echoMode: root.echoMode
|
||||
|
||||
onEditingFinished: editFinished()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue