1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-01-26 00:26:40 +00:00
UTPass/qml/pages/PasswordList.qml

78 lines
1.9 KiB
QML
Raw Normal View History

2025-01-10 15:28:42 +01:00
import "../components"
import Lomiri.Components 1.3
2019-09-20 21:29:39 +02:00
import Pass 1.0
2025-01-10 15:28:42 +01:00
import Qt.labs.folderlistmodel 2.1
import QtQuick 2.4
2019-09-20 21:29:39 +02:00
import "headers"
Page {
id: passwordListPage
property string passwordStorePath
anchors.fill: parent
2025-01-10 15:28:42 +01:00
Component.onCompleted: {
passwordStorePath = "file:" + Pass.password_store;
2019-09-20 21:29:39 +02:00
}
Rectangle {
anchors.top: passwordListHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
visible: folderModel.count == 0
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
Text {
text: i18n.tr("No password found<br>You can import a password store by cloning or importing a zip in the settings")
2019-09-20 21:29:39 +02:00
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter
}
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
}
ListView {
anchors.top: passwordListHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
spacing: 1
model: FolderListModel {
id: folderModel
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
nameFilters: ["*.gpg"]
rootFolder: passwordStorePath
folder: passwordStorePath
showDirs: true
}
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
delegate: FileDir {
id: fileDelegate
}
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
}
2025-01-10 15:28:42 +01:00
header: MainHeader {
id: passwordListHeader
leadingActionBar.height: units.gu(4)
leadingActionBar.actions: [
Action {
id: backAction
iconName: "back"
text: i18n.tr("Back")
visible: false
onTriggered: {
folderModel.folder = folderModel.parentFolder;
if (folderModel.rootFolder === folderModel.folder)
backAction.visible = false;
}
}
]
2019-09-20 21:29:39 +02:00
}
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
}