2020-08-03 13:27:42 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 by Savoir-faire Linux
|
|
|
|
* Author: Yang Wang <yang.wang@savoirfairelinux.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
|
|
|
|
import "../../constant"
|
|
|
|
import "../../commoncomponents"
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
property alias text_sipServernameEditAlias: sipServernameEdit.text
|
|
|
|
property alias text_sipProxyEditAlias: sipProxyEdit.text
|
|
|
|
property alias text_sipUsernameEditAlias: sipUsernameEdit.text
|
|
|
|
property alias text_sipPasswordEditAlias: sipPasswordEdit.text
|
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
property var boothImgBase64: null
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-09-04 14:57:36 -04:00
|
|
|
signal createAccount
|
|
|
|
signal leavePage
|
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
function initializeOnShowUp() {
|
|
|
|
clearAllTextFields()
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearAllTextFields() {
|
|
|
|
sipUsernameEdit.clear()
|
|
|
|
sipPasswordEdit.clear()
|
|
|
|
sipServernameEdit.clear()
|
|
|
|
sipProxyEdit.clear()
|
|
|
|
sipUsernameEdit.clear()
|
|
|
|
}
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
color: JamiTheme.backgroundColor
|
2020-08-03 13:27:42 -04:00
|
|
|
|
2020-09-04 14:57:36 -04:00
|
|
|
onVisibleChanged: {
|
|
|
|
if (visible)
|
|
|
|
sipServernameEdit.focus = true
|
|
|
|
}
|
|
|
|
|
2020-08-03 13:27:42 -04:00
|
|
|
ColumnLayout {
|
2020-09-03 09:58:01 -04:00
|
|
|
spacing: layoutSpacing
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
anchors.centerIn: parent
|
2020-08-04 20:54:02 -04:00
|
|
|
|
|
|
|
RowLayout {
|
2020-09-03 09:58:01 -04:00
|
|
|
spacing: layoutSpacing
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredWidth: createAccountButton.width
|
2020-08-04 20:54:02 -04:00
|
|
|
|
|
|
|
Label {
|
2020-09-11 17:30:46 -04:00
|
|
|
text: JamiStrings.configureExistingSIP
|
2020-09-03 09:58:01 -04:00
|
|
|
font.pointSize: JamiTheme.textFontSize + 3
|
2020-08-04 20:54:02 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
2020-09-11 17:30:46 -04:00
|
|
|
text: JamiStrings.optional
|
2020-09-03 09:58:01 -04:00
|
|
|
color: "white"
|
2020-08-04 20:54:02 -04:00
|
|
|
padding: 8
|
|
|
|
|
|
|
|
background: Rectangle {
|
2020-09-03 09:58:01 -04:00
|
|
|
color: "#28b1ed"
|
2020-08-04 20:54:02 -04:00
|
|
|
radius: 24
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
}
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
MaterialLineEdit {
|
2020-08-03 13:27:42 -04:00
|
|
|
id: sipServernameEdit
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredHeight: fieldLayoutHeight
|
|
|
|
Layout.preferredWidth: createAccountButton.width
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
selectByMouse: true
|
2020-09-11 17:30:46 -04:00
|
|
|
placeholderText: JamiStrings.server
|
2020-09-03 09:58:01 -04:00
|
|
|
font.pointSize: 9
|
2020-08-03 13:27:42 -04:00
|
|
|
font.kerning: true
|
|
|
|
}
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
MaterialLineEdit {
|
2020-08-03 13:27:42 -04:00
|
|
|
id: sipProxyEdit
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredHeight: fieldLayoutHeight
|
|
|
|
Layout.preferredWidth: createAccountButton.width
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
selectByMouse: true
|
2020-09-11 17:30:46 -04:00
|
|
|
placeholderText: JamiStrings.proxy
|
2020-09-03 09:58:01 -04:00
|
|
|
font.pointSize: 9
|
2020-08-03 13:27:42 -04:00
|
|
|
font.kerning: true
|
|
|
|
}
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
MaterialLineEdit {
|
2020-08-03 13:27:42 -04:00
|
|
|
id: sipUsernameEdit
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredHeight: fieldLayoutHeight
|
|
|
|
Layout.preferredWidth: createAccountButton.width
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
selectByMouse: true
|
2020-09-11 17:30:46 -04:00
|
|
|
placeholderText: JamiStrings.username
|
2020-09-03 09:58:01 -04:00
|
|
|
font.pointSize: 9
|
2020-08-03 13:27:42 -04:00
|
|
|
font.kerning: true
|
|
|
|
}
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
MaterialLineEdit {
|
2020-08-03 13:27:42 -04:00
|
|
|
id: sipPasswordEdit
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredHeight: fieldLayoutHeight
|
|
|
|
Layout.preferredWidth: createAccountButton.width
|
2020-08-03 13:27:42 -04:00
|
|
|
|
|
|
|
selectByMouse: true
|
|
|
|
echoMode: TextInput.Password
|
2020-09-11 17:30:46 -04:00
|
|
|
placeholderText: JamiStrings.password
|
2020-09-03 09:58:01 -04:00
|
|
|
font.pointSize: 9
|
2020-08-03 13:27:42 -04:00
|
|
|
font.kerning: true
|
|
|
|
}
|
2020-08-04 20:54:02 -04:00
|
|
|
|
|
|
|
MaterialButton {
|
|
|
|
id: createAccountButton
|
2020-09-03 09:58:01 -04:00
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredWidth: preferredWidth
|
|
|
|
Layout.preferredHeight: preferredHeight
|
|
|
|
|
2020-09-11 17:30:46 -04:00
|
|
|
text: JamiStrings.createSIPAccount
|
2020-08-04 20:54:02 -04:00
|
|
|
color: JamiTheme.wizardBlueButtons
|
2020-08-25 21:12:14 -04:00
|
|
|
hoveredColor: JamiTheme.buttonTintedBlueHovered
|
|
|
|
pressedColor: JamiTheme.buttonTintedBluePressed
|
2020-08-04 20:54:02 -04:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
createAccount()
|
|
|
|
}
|
|
|
|
}
|
2020-09-04 14:57:36 -04:00
|
|
|
}
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-04 14:57:36 -04:00
|
|
|
HoverableButton {
|
|
|
|
id: backButton
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-04 14:57:36 -04:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.margins: 20
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-04 14:57:36 -04:00
|
|
|
width: 35
|
|
|
|
height: 35
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-04 14:57:36 -04:00
|
|
|
radius: 30
|
|
|
|
|
|
|
|
backgroundColor: root.color
|
|
|
|
onExitColor: root.color
|
|
|
|
|
|
|
|
source: "qrc:/images/icons/ic_arrow_back_24px.svg"
|
2020-09-11 17:30:46 -04:00
|
|
|
toolTipText: JamiStrings.backToWelcome
|
2020-09-04 14:57:36 -04:00
|
|
|
|
|
|
|
onClicked: leavePage()
|
2020-08-03 13:27:42 -04:00
|
|
|
}
|
|
|
|
}
|