mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-19 16:38:28 +00:00
Fix chat received time. Fix account creation layouts (Busy indicator, dynamic sizes, text errors) Update SDK to 5.2.66
141 lines
3.1 KiB
QML
141 lines
3.1 KiB
QML
import QtQuick 2.7
|
|
|
|
import Common 1.0
|
|
import Linphone 1.0
|
|
|
|
import App.Styles 1.0
|
|
import Common.Styles 1.0
|
|
|
|
// =============================================================================
|
|
|
|
AssistantAbstractView {
|
|
id: view
|
|
|
|
property alias emailError: email.error
|
|
property alias passwordError: password.error
|
|
property alias usernameError: username.error
|
|
|
|
title: qsTr('createAppSipAccountTitle').replace('%1', Qt.application.name.toUpperCase())
|
|
|
|
mainAction: requestBlock.execute
|
|
mainActionEnabled: email.text.length
|
|
&& password.text.length
|
|
&& passwordConfirmation.text === password.text
|
|
&& username.text.length
|
|
&& !emailError.length
|
|
&& !passwordError.length
|
|
&& !requestBlock.loading
|
|
&& !usernameError.length
|
|
mainActionLabel: qsTr('confirmAction')
|
|
|
|
Column {
|
|
anchors.fill: parent
|
|
|
|
Form {
|
|
orientation: Qt.Vertical
|
|
width: FormHGroupStyle.content.maxWidth + FormHGroupStyle.spacing
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
FormLine {
|
|
FormGroup {
|
|
label: qsTr('usernameLabel')
|
|
|
|
TextField {
|
|
id: username
|
|
|
|
onTextChanged: assistantModel.username = text
|
|
}
|
|
}
|
|
|
|
FormGroup {
|
|
label: qsTr('displayNameLabel')
|
|
|
|
TextField {
|
|
onTextChanged: assistantModel.displayName = text
|
|
}
|
|
}
|
|
}
|
|
|
|
FormLine {
|
|
FormGroup {
|
|
label: qsTr('emailLabel')
|
|
|
|
TextField {
|
|
id: email
|
|
|
|
onTextChanged: assistantModel.email = text
|
|
}
|
|
}
|
|
}
|
|
|
|
FormLine {
|
|
FormGroup {
|
|
label: qsTr('passwordLabel')
|
|
|
|
PasswordField {
|
|
id: password
|
|
|
|
onTextChanged: {
|
|
assistantModel.password = text
|
|
assistantModel.checkPassword()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
FormLine {
|
|
FormGroup {
|
|
label: qsTr('passwordConfirmationLabel')
|
|
|
|
PasswordField {
|
|
id: passwordConfirmation
|
|
|
|
onTextChanged: assistantModel.checkPassword()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
RequestBlock {
|
|
id: requestBlock
|
|
|
|
action: assistantModel.create
|
|
width: parent.width
|
|
loading: assistantModel.isProcessing
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Assistant.
|
|
// ---------------------------------------------------------------------------
|
|
|
|
AssistantModel {
|
|
id: assistantModel
|
|
|
|
function checkPassword () {
|
|
passwordConfirmation.error = password.text !== passwordConfirmation.text
|
|
? qsTr('passwordConfirmationError')
|
|
: ''
|
|
}
|
|
|
|
configFilename: 'create-app-sip-account.rc'
|
|
|
|
onEmailChanged: emailError = error
|
|
onPasswordChanged: passwordError = error
|
|
onUsernameChanged: usernameError = error
|
|
|
|
onCreateStatusChanged: {
|
|
requestBlock.setText(error)
|
|
if (error.length) {
|
|
return
|
|
}
|
|
|
|
window.lockView({
|
|
descriptionText: qsTr('quitWarning')
|
|
})
|
|
assistant.pushView('ActivateAppSipAccountWithEmail', {
|
|
assistantModel: assistantModel
|
|
})
|
|
}
|
|
}
|
|
}
|