2022-10-11 12:15:33 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.status 1.0
|
|
|
|
import shared.popups.keycard.helpers 1.0
|
|
|
|
|
|
|
|
import "../../stores"
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property KeycardStore keycardStore
|
2022-12-09 19:43:36 +00:00
|
|
|
property string keyUid: ""
|
2022-10-11 12:15:33 +00:00
|
|
|
|
2023-02-21 08:25:02 +00:00
|
|
|
signal changeSectionTitle(string title)
|
2023-07-07 08:54:23 +00:00
|
|
|
signal detailsModelIsEmpty()
|
2023-02-21 08:25:02 +00:00
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
spacing: Constants.settingsSection.itemSpacing
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
property bool collapsed: true
|
2023-07-07 08:54:23 +00:00
|
|
|
readonly property int numOfKeycards: root.keycardStore.keycardModule.keycardDetailsModel?
|
|
|
|
root.keycardStore.keycardModule.keycardDetailsModel.count
|
|
|
|
: 0
|
|
|
|
|
|
|
|
onNumOfKeycardsChanged: {
|
|
|
|
if (!!root.keycardStore.keycardModule.keycardDetailsModel && numOfKeycards === 0) {
|
|
|
|
root.detailsModelIsEmpty()
|
|
|
|
}
|
|
|
|
}
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:43:36 +00:00
|
|
|
StatusListView {
|
2022-10-11 12:15:33 +00:00
|
|
|
Layout.fillWidth: true
|
2022-12-09 19:43:36 +00:00
|
|
|
Layout.preferredHeight: 250
|
|
|
|
spacing: Style.current.padding
|
|
|
|
model: root.keycardStore.keycardModule.keycardDetailsModel
|
|
|
|
|
|
|
|
delegate: KeycardItem {
|
|
|
|
width: ListView.view.width
|
|
|
|
displayChevronComponent: false
|
|
|
|
|
2022-12-16 09:37:08 +00:00
|
|
|
keycardName: model.keycard.name
|
|
|
|
keycardUid: model.keycard.keycardUid
|
|
|
|
keycardLocked: model.keycard.locked
|
|
|
|
keyPairType: model.keycard.pairType
|
|
|
|
keyPairIcon: model.keycard.icon
|
|
|
|
keyPairImage: model.keycard.image
|
|
|
|
keyPairAccounts: model.keycard.accounts
|
2022-12-09 19:43:36 +00:00
|
|
|
}
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: Style.current.halfPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
text: qsTr("Configure your Keycard")
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Rename Keycard")
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
2022-12-09 19:43:36 +00:00
|
|
|
root.keycardStore.runRenameKeycardPopup(root.keyUid)
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Change PIN")
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
2022-12-09 19:43:36 +00:00
|
|
|
root.keycardStore.runChangePinPopup(root.keyUid)
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Create a backup copy of this Keycard")
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
2022-12-09 19:43:36 +00:00
|
|
|
root.keycardStore.runCreateBackupCopyOfAKeycardPopup(root.keyUid)
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-29 14:22:41 +00:00
|
|
|
StatusListItem {
|
|
|
|
Layout.fillWidth: true
|
2024-06-07 13:29:09 +00:00
|
|
|
title: qsTr("Stop using Keycard for this key pair")
|
2023-08-29 14:22:41 +00:00
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
|
|
|
root.keycardStore.runStopUsingKeycardPopup(root.keyUid)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-11 12:15:33 +00:00
|
|
|
StatusListItem {
|
2022-12-16 09:37:08 +00:00
|
|
|
visible: root.keycardStore.keycardModule.keycardDetailsModel?
|
|
|
|
root.keycardStore.keycardModule.keycardDetailsModel.lockedItemsCount > 0 : false
|
2022-10-11 12:15:33 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Unlock Keycard")
|
|
|
|
components: [
|
|
|
|
StatusBadge {
|
2022-12-16 09:37:08 +00:00
|
|
|
value: root.keycardStore.keycardModule.keycardDetailsModel?
|
|
|
|
root.keycardStore.keycardModule.keycardDetailsModel.lockedItemsCount : 0
|
2022-10-11 12:15:33 +00:00
|
|
|
border.width: 4
|
|
|
|
border.color: Theme.palette.dangerColor1
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
},
|
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
2022-12-09 19:43:36 +00:00
|
|
|
root.keycardStore.runUnlockKeycardPopupForKeycardWithUid(root.keyUid)
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Advanced")
|
|
|
|
statusListItemTitle.color: Style.current.secondaryText
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: d.collapsed? "tiny/chevron-down" : "tiny/chevron-up"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
|
|
|
d.collapsed = !d.collapsed
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
visible: !d.collapsed
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Create a 12-digit personal unblocking key (PUK)")
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
2022-12-09 19:43:36 +00:00
|
|
|
root.keycardStore.runCreatePukPopup(root.keyUid)
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
visible: !d.collapsed
|
2022-12-16 09:37:08 +00:00
|
|
|
enabled: false // This is post MVP feature, issue #8065
|
2022-10-11 12:15:33 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Create a new pairing code")
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "tiny/chevron-right"
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
2022-12-09 19:43:36 +00:00
|
|
|
root.keycardStore.runCreateNewPairingCodePopup(root.keyUid)
|
2022-10-11 12:15:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|