2020-08-25 16:05:56 +02:00
/* === This file is part of Calamares - <https:/ / calamares . io > ===
2020-08-11 13:46:05 +02:00
*
* SPDX - FileCopyrightText: 2020 Anke Boersma < demm @ kaosx . us >
* SPDX - License - Identifier: GPL - 3.0 - or - later
*
2020-08-25 16:05:56 +02:00
* Calamares is Free Software: see the License - Identifier above .
2020-08-11 13:46:05 +02:00
*
* /
import io . calamares . core 1.0
import io . calamares . ui 1.0
import QtQuick 2.10
import QtQuick . Controls 2.10
import QtQuick . Layouts 1.3
import org . kde . kirigami 2.7 as Kirigami
import QtGraphicalEffects 1.0
import QtQuick . Window 2.3
Kirigami . ScrollablePage {
width: parent . width
height: parent . height
2020-08-25 16:05:56 +02:00
2020-08-11 13:46:05 +02:00
Kirigami.Theme.backgroundColor: "#EFF0F1"
Kirigami.Theme.textColor: "#1F1F1F"
header: Kirigami . Heading {
Layout.fillWidth: true
height: 50
horizontalAlignment: Qt . AlignHCenter
color: Kirigami . Theme . textColor
font.weight: Font . Medium
font.pointSize: 12
text: qsTr ( "Pick your user name and credentials to login and perform admin tasks" )
}
ColumnLayout {
id: _formLayout
spacing: Kirigami . Units . smallSpacing
Column {
Layout.fillWidth: true
spacing: Kirigami . Units . smallSpacing
Label {
width: parent . width
text: qsTr ( "What is your name?" )
}
TextField {
id: _userNameField
width: parent . width
2021-03-15 12:51:42 +01:00
enabled: config . isEditable ( "fullName" )
2020-08-11 13:46:05 +02:00
placeholderText: qsTr ( "Your Full Name" )
2021-03-15 11:45:57 +01:00
text: config . fullName
onTextChanged: config . setFullName ( text ) ;
2020-08-11 13:46:05 +02:00
background: Rectangle {
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
radius: 2
opacity: 0.9
//border.color: _userNameField.text === "" ? Kirigami.Theme.backgroundColor : ( config.fullNameReady ? Kirigami.Theme.backgroundColor : Kirigami.Theme.negativeTextColor)
2020-08-18 20:06:30 +02:00
border.color: _userNameField . text === "" ? "#FBFBFB" : ( config . fullNameChanged ? "#FBFBFB" : Kirigami . Theme . negativeTextColor )
2020-08-11 13:46:05 +02:00
}
}
}
Column {
Layout.fillWidth: true
spacing: Kirigami . Units . smallSpacing
Label {
width: parent . width
text: qsTr ( "What name do you want to use to log in?" )
}
TextField {
id: _userLoginField
width: parent . width
2021-03-15 12:51:42 +01:00
enabled: config . isEditable ( "loginName" )
2020-08-11 13:46:05 +02:00
placeholderText: qsTr ( "Login Name" )
2021-03-15 00:04:39 +01:00
text: config . loginName
2021-03-15 11:45:57 +01:00
onTextChanged: config . setLoginName ( text )
2020-08-11 13:46:05 +02:00
background: Rectangle {
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
opacity: 0.9
//border.color: _userLoginField.text === "" ? Kirigami.Theme.backgroundColor : ( config.userNameReady ? Kirigami.Theme.backgroundColor : Kirigami.Theme.negativeTextColor)
2020-08-18 20:06:30 +02:00
border.color: _userLoginField . text === "" ? "#FBFBFB" : ( config . loginNameStatusChanged ? "#FBFBFB" : Kirigami . Theme . negativeTextColor )
2020-08-11 13:46:05 +02:00
}
}
Label {
width: parent . width
text: qsTr ( "If more than one person will use this computer, you can create multiple accounts after installation." )
font.weight: Font . Thin
font.pointSize: 8
color: "#6D6D6D"
}
}
Column {
Layout.fillWidth: true
spacing: Kirigami . Units . smallSpacing
Label {
width: parent . width
text: qsTr ( "What is the name of this computer?" )
}
TextField {
id: _hostName
width: parent . width
placeholderText: qsTr ( "Computer Name" )
text: config . hostName
2021-03-15 12:36:54 +01:00
onTextChanged: config . setHostName ( text )
2021-03-15 11:45:57 +01:00
2020-08-11 13:46:05 +02:00
background: Rectangle {
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
opacity: 0.9
2020-08-18 20:06:30 +02:00
//border.color: _hostName.text === "" ? Kirigami.Theme.backgroundColor : ( config.hostNameStatusChanged ? Kirigami.Theme.backgroundColor : Kirigami.Theme.negativeTextColor)
border.color: _hostName . text === "" ? "#FBFBFB" : ( config . hostNameStatusChanged ? "#FBFBFB" : Kirigami . Theme . negativeTextColor )
2020-08-11 13:46:05 +02:00
}
}
Label {
width: parent . width
text: qsTr ( "This name will be used if you make the computer visible to others on a network." )
font.weight: Font . Thin
font.pointSize: 8
color: "#6D6D6D"
}
}
Column {
Layout.fillWidth: true
spacing: Kirigami . Units . smallSpacing
Label {
width: parent . width
text: qsTr ( "Choose a password to keep your account safe." )
}
Row {
width: parent . width
spacing: 20
TextField {
id: _passwordField
width: parent . width / 2 - 10
placeholderText: qsTr ( "Password" )
2021-03-15 11:45:57 +01:00
text: config . userPassword
onTextChanged: config . setUserPassword ( text )
2020-08-11 13:46:05 +02:00
echoMode: TextInput . Password
passwordMaskDelay: 300
inputMethodHints: Qt . ImhNoAutoUppercase
background: Rectangle {
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
opacity: 0.9
//border.color: _passwordField.text === "" ? Kirigami.Theme.backgroundColor : ( config.passwordReady ? Kirigami.Theme.backgroundColor : Kirigami.Theme.negativeTextColor)
2020-08-18 20:06:30 +02:00
border.color: _passwordField . text === "" ? "#FBFBFB" : ( config . userPasswordStatusChanged ? "#FBFBFB" : Kirigami . Theme . negativeTextColor )
2020-08-11 13:46:05 +02:00
}
}
TextField {
id: _verificationPasswordField
width: parent . width / 2 - 10
placeholderText: qsTr ( "Repeat Password" )
2021-03-15 11:45:57 +01:00
text: config . userPasswordSecondary
onTextChanged: config . setUserPasswordSecondary ( text )
2020-08-11 13:46:05 +02:00
echoMode: TextInput . Password
passwordMaskDelay: 300
inputMethodHints: Qt . ImhNoAutoUppercase
background: Rectangle {
color: "#FBFBFB" //Kirigami.Theme.backgroundColor
opacity: 0.9
//border.color: _verificationpasswordField.text === "" ? Kirigami.Theme.backgroundColor : ( config.passwordReady ? Kirigami.Theme.backgroundColor : Kirigami.Theme.negativeTextColor)
2020-08-18 20:06:30 +02:00
border.color: _verificationPasswordField . text === "" ? "#FBFBFB" : ( config . userPasswordSecondaryChanged ? "#FBFBFB" : Kirigami . Theme . negativeTextColor )
2020-08-11 13:46:05 +02:00
}
}
}
Label {
width: parent . width
text: qsTr ( "Enter the same password twice, so that it can be checked for typing errors. A good password will contain a mixture of letters, numbers and punctuation, should be at least eight characters long, and should be changed at regular intervals." )
font.weight: Font . Thin
font.pointSize: 8
wrapMode: Text . WordWrap
color: "#6D6D6D"
}
}
2020-08-25 16:05:56 +02:00
2020-08-11 13:46:05 +02:00
CheckBox {
2021-03-15 00:04:39 +01:00
visible: config . permitWeakPasswords
2020-08-11 13:46:05 +02:00
text: qsTr ( "Validate passwords quality" )
2021-03-15 00:04:39 +01:00
checked: config . requireStrongPasswords
2021-03-15 12:36:54 +01:00
onCheckedChanged: config . setRequireStrongPasswords ( checked )
2020-08-11 13:46:05 +02:00
}
Label {
2021-03-15 00:04:39 +01:00
visible: config . permitWeakPasswords
2020-08-11 13:46:05 +02:00
width: parent . width
2020-09-21 17:01:50 +02:00
text: qsTr ( "When this box is checked, password-strength checking is done and you will not be able to use a weak password." )
2020-08-11 13:46:05 +02:00
font.weight: Font . Thin
font.pointSize: 8
color: "#6D6D6D"
}
CheckBox {
text: qsTr ( "Log in automatically without asking for the password" )
2021-03-15 00:04:39 +01:00
checked: config . doAutoLogin
2021-03-15 12:36:54 +01:00
onCheckedChanged: config . setAutoLogin ( checked )
2020-08-11 13:46:05 +02:00
}
CheckBox {
id: root
2021-03-15 00:04:39 +01:00
visible: config . writeRootPassword
2020-08-11 13:46:05 +02:00
text: qsTr ( "Reuse user password as root password" )
checked: config . reuseUserPasswordForRoot
2021-03-15 12:36:54 +01:00
onCheckedChanged: config . setReuseUserPasswordForRoot ( checked )
2020-08-11 13:46:05 +02:00
}
2020-08-25 16:05:56 +02:00
2020-08-11 13:46:05 +02:00
Label {
visible: root . checked
width: parent . width
text: qsTr ( "Use the same password for the administrator account." )
font.weight: Font . Thin
font.pointSize: 8
color: "#6D6D6D"
}
Column {
visible: ! root . checked
Layout.fillWidth: true
spacing: Kirigami . Units . smallSpacing
Label {
width: parent . width
text: qsTr ( "Choose a root password to keep your account safe." )
}
Row {
width: parent . width
spacing: 20
TextField {
id: _rootPasswordField
width: parent . width / 2 - 10
placeholderText: qsTr ( "Root Password" )
2021-03-15 12:36:54 +01:00
text: config . rootPassword
onTextChanged: config . setRootPassword ( text )
2020-08-11 13:46:05 +02:00
echoMode: TextInput . Password
passwordMaskDelay: 300
inputMethodHints: Qt . ImhNoAutoUppercase
background: Rectangle {
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
opacity: 0.9
//border.color: _rootPasswordField.text === "" ? Kirigami.Theme.backgroundColor : ( config.rootPasswordReady ? Kirigami.Theme.backgroundColor : Kirigami.Theme.negativeTextColor)
border.color: _rootPasswordField . text === "" ? "#FBFBFB" : ( config . rootPasswordReady ? "#FBFBFB" : Kirigami . Theme . negativeTextColor )
}
}
TextField {
id: _verificationRootPasswordField
width: parent . width / 2 - 10
placeholderText: qsTr ( "Repeat Root Password" )
2021-03-15 12:36:54 +01:00
text: config . rootPasswordSecondary
onTextChanged: config . setRootPasswordSecondary ( text )
2020-08-11 13:46:05 +02:00
echoMode: TextInput . Password
passwordMaskDelay: 300
inputMethodHints: Qt . ImhNoAutoUppercase
background: Rectangle {
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
opacity: 0.9
//border.color: _verificationRootPasswordField.text === "" ? Kirigami.Theme.backgroundColor : ( config.rootPasswordReady ? Kirigami.Theme.backgroundColor : Kirigami.Theme.negativeTextColor)
border.color: _verificationRootPasswordField . text === "" ? "#FBFBFB" : ( config . rootPasswordReady ? "#FBFBFB" : Kirigami . Theme . negativeTextColor )
}
}
}
Label {
visible: ! root . checked
width: parent . width
text: qsTr ( "Enter the same password twice, so that it can be checked for typing errors." )
font.weight: Font . Thin
font.pointSize: 8
color: "#6D6D6D"
}
}
}
}