2022-10-11 12:15:33 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
2023-01-23 17:07:56 +00:00
|
|
|
import QtQml.Models 2.14
|
2022-08-16 09:19:15 +00:00
|
|
|
|
2023-01-23 17:07:56 +00:00
|
|
|
import StatusQ.Core 0.1
|
2022-08-16 09:19:15 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2023-01-23 17:07:56 +00:00
|
|
|
import StatusQ.Popups.Dialog 0.1
|
2023-01-26 11:52:01 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-08-16 09:19:15 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2022-08-31 17:09:07 +00:00
|
|
|
import shared.popups.keycard 1.0
|
2022-08-16 09:19:15 +00:00
|
|
|
|
|
|
|
import "../stores"
|
2022-10-11 12:15:33 +00:00
|
|
|
import "./keycard"
|
2022-08-16 09:19:15 +00:00
|
|
|
|
|
|
|
SettingsContentBase {
|
|
|
|
id: root
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
property ProfileSectionStore profileSectionStore
|
2022-08-16 09:19:15 +00:00
|
|
|
property KeycardStore keycardStore
|
2022-12-16 09:37:08 +00:00
|
|
|
property var emojiPopup
|
2022-10-11 12:15:33 +00:00
|
|
|
property string mainSectionTitle: ""
|
2022-08-16 09:19:15 +00:00
|
|
|
|
|
|
|
titleRowComponentLoader.sourceComponent: StatusButton {
|
|
|
|
text: qsTr("Get Keycard")
|
|
|
|
onClicked: {
|
2022-10-14 09:13:27 +00:00
|
|
|
Global.openLink(Constants.keycard.general.purchasePage)
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
function handleBackAction() {
|
|
|
|
if (stackLayout.currentIndex === d.detailsViewIndex) {
|
|
|
|
root.profileSectionStore.backButtonName = ""
|
|
|
|
root.sectionTitle = root.mainSectionTitle
|
|
|
|
stackLayout.currentIndex = d.mainViewIndex
|
2022-08-31 17:09:07 +00:00
|
|
|
}
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
2022-08-31 17:09:07 +00:00
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
StackLayout {
|
|
|
|
id: stackLayout
|
2022-08-16 09:19:15 +00:00
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
currentIndex: d.mainViewIndex
|
2022-08-16 09:19:15 +00:00
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
readonly property int mainViewIndex: 0
|
|
|
|
readonly property int detailsViewIndex: 1
|
2022-08-16 09:19:15 +00:00
|
|
|
|
2022-12-09 19:43:36 +00:00
|
|
|
property string observedKeyUid: ""
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
|
|
|
|
2023-01-23 17:07:56 +00:00
|
|
|
Component {
|
|
|
|
id: sharedModuleBusyPopupComponent
|
|
|
|
StatusDialog {
|
|
|
|
id: titleContentDialog
|
|
|
|
title: qsTr("Status Keycard")
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
anchors.fill: parent
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
text: qsTr("The Keycard module is still busy, please try again")
|
|
|
|
}
|
|
|
|
|
|
|
|
standardButtons: Dialog.Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
MainView {
|
2022-08-16 09:19:15 +00:00
|
|
|
Layout.preferredWidth: root.contentWidth
|
2022-10-11 12:15:33 +00:00
|
|
|
keycardStore: root.keycardStore
|
|
|
|
|
2022-12-09 19:43:36 +00:00
|
|
|
onDisplayKeycardsForKeypair: {
|
|
|
|
root.keycardStore.keycardModule.prepareKeycardDetailsModel(keyUid)
|
|
|
|
d.observedKeyUid = keyUid
|
2022-10-11 12:15:33 +00:00
|
|
|
root.profileSectionStore.backButtonName = root.mainSectionTitle
|
2022-12-09 19:43:36 +00:00
|
|
|
root.sectionTitle = keypairName
|
2022-10-11 12:15:33 +00:00
|
|
|
stackLayout.currentIndex = d.detailsViewIndex
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
DetailsView {
|
2022-08-16 09:19:15 +00:00
|
|
|
Layout.preferredWidth: root.contentWidth
|
2022-10-11 12:15:33 +00:00
|
|
|
keycardStore: root.keycardStore
|
2022-12-09 19:43:36 +00:00
|
|
|
keyUid: d.observedKeyUid
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
Connections {
|
|
|
|
target: root.keycardStore.keycardModule
|
2022-08-16 09:19:15 +00:00
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
function onDisplayKeycardSharedModuleFlow() {
|
2022-10-11 12:15:33 +00:00
|
|
|
keycardPopup.active = true
|
|
|
|
}
|
2023-01-18 09:25:36 +00:00
|
|
|
function onDestroyKeycardSharedModuleFlow() {
|
2022-10-11 12:15:33 +00:00
|
|
|
keycardPopup.active = false
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
2023-01-23 17:07:56 +00:00
|
|
|
onSharedModuleBusy: {
|
|
|
|
Global.openPopup(sharedModuleBusyPopupComponent)
|
|
|
|
}
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
Loader {
|
|
|
|
id: keycardPopup
|
|
|
|
active: false
|
|
|
|
sourceComponent: KeycardPopup {
|
2022-12-16 09:37:08 +00:00
|
|
|
anchors.centerIn: parent
|
2022-10-11 12:15:33 +00:00
|
|
|
sharedKeycardModule: root.keycardStore.keycardModule.keycardSharedModule
|
2022-12-16 09:37:08 +00:00
|
|
|
emojiPopup: root.emojiPopup
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
onLoaded: {
|
|
|
|
keycardPopup.item.open()
|
2022-08-16 09:19:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|