UTPassMirror/qml/Main.qml

79 lines
2.2 KiB
QML
Raw Normal View History

2019-03-13 18:38:12 +00:00
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Qt.labs.folderlistmodel 2.1
import Ubuntu.Components 1.3
import Pass 1.0
import "components" as MyComponents
MainView {
id: root
objectName: "mainView"
applicationName: "utpass.qrouland"
automaticOrientation: true
width: units.gu(45)
height: units.gu(75)
Page {
id: page
anchors.fill: parent
header: PageHeader {
id: header
width: parent.width
height: units.gu(6)
title: i18n.tr("UTPass")
flickable: navigation
leadingActionBar.height: units.gu(4)
leadingActionBar.actions: [
Action {
id: backAction
iconName: "back"
text: "Back"
visible:false
onTriggered: {
folderModel.folder = folderModel.parentFolder;
if(folderModel.rootFolder === folderModel.folder) {
backAction.visible = false;
}
}
}
]
}
Flickable {
id: navigation
anchors.fill: parent
2019-03-13 20:32:10 +00:00
Rectangle {
width: page.width
visible: folderModel.count == 0
height: units.gu(5)
Text {
text: "No password found in current folder"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
2019-03-13 18:38:12 +00:00
ListView {
id : listViewDirs
anchors.fill: parent
spacing: 1
model: FolderListModel {
id: folderModel
nameFilters: ["*.gpg"]
2019-03-13 20:32:10 +00:00
rootFolder: "file:password-store"
folder: "file:password-store"
2019-03-13 18:38:12 +00:00
}
delegate: MyComponents.ViewFileDir {
id: fileDelegate
}
}
}
}
//Component.onCompleted: Pass.speak()
}