This repository has been archived on 2021-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
ui/qml/panes/ProfileManagerPane.qml

152 lines
3.6 KiB
QML

import QtQuick 2.0
import QtGraphicalEffects 1.0
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.11
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import "../widgets"
import "../opaque" as Opaque
import "../opaque/controls"
import "../opaque/styles"
import "../opaque/theme"
import "../opaque/fonts"
import "../utils.js" as Utils
ColumnLayout {
id: thecol
anchors.fill: parent
spacing: Theme.paddingSmall
Opaque.Label {
horizontalAlignment: Text.AlignHCenter
width: parent.width
Layout.fillWidth: true
bold: true
//: Enter a password to view your profiles
text: qsTr("enter-profile-password")
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
Opaque.UnderlineTextField {
id: txtPassword
Layout.rightMargin: 40
Layout.leftMargin: 40
placeholderText: qsTr("password")
echoMode: TextInput.Password
onAccepted: button.clicked()
}
Opaque.Button {
id: "button"
//: Unlock
text: qsTr("unlock")
onClicked: {
gcd.unlockProfiles(txtPassword.text)
txtPassword.text = ""
error.visible = false
}
}
}
Opaque.Label {
id: error
Layout.alignment: Qt.AlignHCenter
color: Theme.textfieldErrorColor
//: 0 profiles loaded with that password
text: qsTr("error-0-profiles-loaded-for-password")
visible: false
}
Connections { // ADD/REMOVE CONTACT ENTRIES
target: gcd
onErrorLoaded0: function() {
error.visible = true
}
}
// space
Rectangle {
width: 1
height: 20 * gcd.themeScale
color: Theme.backgroundMainColor
}
Opaque.ResponsiveContainer {
Layout.fillHeight: true
Layout.fillWidth: true
Rectangle {
color: Theme.backgroundMainColor
Layout.fillHeight: true
Layout.fillWidth: true
Opaque.Label {
id: profileLabel
size: Theme.textSubHeaderPt
bold: true
anchors.left: parent.left
anchors.leftMargin: 25 * gcd.themeScale
bottomPadding: 10 * gcd.themeScale
//: Your Profiles
text: qsTr("your-profiles")
}
ProfileList {
anchors.top: profileLabel.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}
Rectangle {
// TODO Remove Experiment Check once Feature is Stable
visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-servers-experiment")
color: Theme.backgroundMainColor
Layout.fillHeight: true
Layout.fillWidth: true
Opaque.Label {
id: serverLabel
size: Theme.textSubHeaderPt
bold: true
anchors.left: parent.left
anchors.leftMargin: Theme.paddingStandard
bottomPadding: Theme.paddingSmall
//: Your Profiles
text: qsTr("your-servers")
}
ServerList {
anchors.top: serverLabel.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}
}
}