mirror of
https://github.com/QRouland/UTPass.git
synced 2025-06-29 16:52:29 +00:00
Various improvement :)
This commit is contained in:
66
qml/Main.qml
66
qml/Main.qml
@ -1,78 +1,22 @@
|
||||
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
|
||||
import "components"
|
||||
|
||||
MainView {
|
||||
id: root
|
||||
objectName: "mainView"
|
||||
applicationName: "utpass.qrouland"
|
||||
|
||||
automaticOrientation: true
|
||||
|
||||
width: units.gu(45)
|
||||
height: units.gu(75)
|
||||
|
||||
Page {
|
||||
id: page
|
||||
PageStack {
|
||||
id: pageStack
|
||||
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
|
||||
|
||||
Rectangle {
|
||||
width: page.width
|
||||
visible: folderModel.count == 0
|
||||
height: units.gu(5)
|
||||
Text {
|
||||
text: "No password found in the current folder"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id : listViewDirs
|
||||
anchors.fill: parent
|
||||
spacing: 1
|
||||
model: FolderListModel {
|
||||
id: folderModel
|
||||
nameFilters: ["*.gpg"]
|
||||
rootFolder: "file:password-store"
|
||||
folder: "file:password-store"
|
||||
}
|
||||
delegate: MyComponents.ViewFileDir {
|
||||
id: fileDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: push(pageStack.push(Qt.resolvedUrl("pages/PasswordList.qml")))
|
||||
}
|
||||
//Component.onCompleted: Pass.speak()
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import "../styles"
|
||||
|
||||
Component {
|
||||
Rectangle {
|
||||
width: page.width
|
||||
width: parent.width
|
||||
height: units.gu(5)
|
||||
|
||||
Text {
|
||||
@ -19,7 +20,7 @@ Component {
|
||||
width: units.gu(4)
|
||||
height: units.gu(4)
|
||||
name: fileIsDir ? "go-next" : "lock"
|
||||
color: UbuntuColors.orange
|
||||
color: Theme.raisin_black
|
||||
}
|
||||
|
||||
MouseArea {
|
55
qml/components/Link.qml
Normal file
55
qml/components/Link.qml
Normal file
@ -0,0 +1,55 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import "../styles"
|
||||
|
||||
Item {
|
||||
property string url
|
||||
property string text
|
||||
|
||||
property bool commonBorder : true
|
||||
property int lBorderwidth : 0
|
||||
property int rBorderwidth : 0
|
||||
property int tBorderwidth : 0
|
||||
property int bBorderwidth : 0
|
||||
property int commonBorderWidth : 0
|
||||
property string borderColor : UbuntuColors.warmGrey
|
||||
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
Text {
|
||||
text: parent.parent.text
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: units.gu(1)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Icon {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: units.gu(4)
|
||||
height: units.gu(4)
|
||||
name: "go-next"
|
||||
color: Theme.raisin_black
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: { Qt.openUrlExternally(parent.parent.url); }
|
||||
}
|
||||
|
||||
CustomBorder {
|
||||
id : cb
|
||||
commonBorder: parent.parent.commonBorder
|
||||
lBorderwidth: parent.parent.lBorderwidth
|
||||
rBorderwidth: parent.parent.rBorderwidth
|
||||
tBorderwidth: parent.parent.tBorderwidth
|
||||
bBorderwidth: parent.parent.bBorderwidth
|
||||
borderColor: parent.parent.borderColor
|
||||
}
|
||||
}
|
||||
}
|
2
qml/components/qmldir
Normal file
2
qml/components/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
FileDir 1.0 FileDir.qml
|
||||
Link 1.0 Link.qml
|
6
qml/models/Manifest.qml
Normal file
6
qml/models/Manifest.qml
Normal file
@ -0,0 +1,6 @@
|
||||
pragma Singleton
|
||||
import QtQuick 2.4
|
||||
|
||||
Item {
|
||||
|
||||
}
|
0
qml/models/Passstore.qml
Normal file
0
qml/models/Passstore.qml
Normal file
2
qml/models/qmldir
Normal file
2
qml/models/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
singleton Passtore 1.0 Passtore.qml
|
||||
singleton Manifest 1.0 Manifest.qml
|
59
qml/pages/Info.qml
Normal file
59
qml/pages/Info.qml
Normal file
@ -0,0 +1,59 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import "headers"
|
||||
import "../components"
|
||||
|
||||
Page {
|
||||
header: StackHeader {
|
||||
id : infoHeader
|
||||
title: i18n.tr('Info')
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.top: infoHeader.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
color: "#FFF"
|
||||
|
||||
Flow {
|
||||
spacing: 2
|
||||
anchors.fill: parent
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: units.gu(4)
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: units.gu(12)
|
||||
Image {
|
||||
source: "../../assets/logo.svg"
|
||||
width: units.gu(12)
|
||||
height: units.gu(12)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: units.gu(4)
|
||||
}
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
text: i18n.tr('UTPass')
|
||||
}
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
text: "Version" //i18n.tr("Version %1").arg(Manifest.get("version"))
|
||||
}
|
||||
Link {
|
||||
url: "https://github.com/QRouland/UTPass/issues"
|
||||
text: i18n.tr('Suggest improvements or report a bug')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
59
qml/pages/PasswordList.qml
Normal file
59
qml/pages/PasswordList.qml
Normal file
@ -0,0 +1,59 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import Qt.labs.folderlistmodel 2.1
|
||||
import "../components"
|
||||
import "headers"
|
||||
|
||||
|
||||
Page {
|
||||
header : MainHeader {
|
||||
flickable : nav
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Flickable {
|
||||
id: nav
|
||||
height: parent.height
|
||||
width: parent.width
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
visible: folderModel.count == 0
|
||||
height: units.gu(5)
|
||||
Text {
|
||||
text: i18n.tr("No password found in the current folder")
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
spacing: 1
|
||||
model: FolderListModel {
|
||||
id: folderModel
|
||||
nameFilters: ["*.gpg"]
|
||||
rootFolder: "file:password-store"
|
||||
folder: "file:password-store"
|
||||
}
|
||||
delegate: FileDir {
|
||||
id: fileDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
30
qml/pages/Settings.qml
Normal file
30
qml/pages/Settings.qml
Normal file
@ -0,0 +1,30 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
import "headers"
|
||||
|
||||
Page {
|
||||
header: StackHeader {
|
||||
id:settingsHeader
|
||||
title: i18n.tr('Settings')
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.top: settingsHeader.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
color: "#FFF"
|
||||
|
||||
Flow {
|
||||
spacing: 1
|
||||
anchors.fill: parent
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
text: "Settings"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
32
qml/pages/headers/MainHeader.qml
Normal file
32
qml/pages/headers/MainHeader.qml
Normal file
@ -0,0 +1,32 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
|
||||
PageHeader {
|
||||
id: mainHeader
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
title: i18n.tr("UTPass")
|
||||
|
||||
trailingActionBar.height: units.gu(4)
|
||||
trailingActionBar.numberOfSlots: 2
|
||||
trailingActionBar.actions: [
|
||||
Action {
|
||||
iconName: "search"
|
||||
text: i18n.tr("Search")
|
||||
},
|
||||
Action {
|
||||
iconName: "settings"
|
||||
text: i18n.tr("Settings")
|
||||
onTriggered: {
|
||||
pageStack.push(Qt.resolvedUrl("../Settings.qml"))
|
||||
}
|
||||
},
|
||||
Action {
|
||||
iconName: "info"
|
||||
text: i18n.tr("Info")
|
||||
onTriggered: {
|
||||
pageStack.push(Qt.resolvedUrl("../Info.qml"))
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
20
qml/pages/headers/StackHeader.qml
Normal file
20
qml/pages/headers/StackHeader.qml
Normal file
@ -0,0 +1,20 @@
|
||||
import QtQuick 2.4
|
||||
import Ubuntu.Components 1.3
|
||||
|
||||
PageHeader {
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
title: i18n.tr("UTPass")
|
||||
|
||||
leadingActionBar.height: units.gu(4)
|
||||
leadingActionBar.actions: [
|
||||
Action {
|
||||
id: backAction
|
||||
iconName: "back"
|
||||
text: "Back"
|
||||
onTriggered: {
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
2
qml/pages/headers/qmldir
Normal file
2
qml/pages/headers/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
MainHeader 1.0 MainHeader.qml
|
||||
StackHeader 1.0 StackHeader.qml
|
4
qml/pages/qmldir
Normal file
4
qml/pages/qmldir
Normal file
@ -0,0 +1,4 @@
|
||||
Info 1.0 Info.qml
|
||||
PassordList 1.0 Password.qml
|
||||
Settings 1.0 Settings.qml
|
||||
UTPassPage 1.0 UTPassPage.qml
|
10
qml/styles/Theme.qml
Normal file
10
qml/styles/Theme.qml
Normal file
@ -0,0 +1,10 @@
|
||||
pragma Singleton
|
||||
import QtQuick 2.4
|
||||
|
||||
Item {
|
||||
readonly property color claret : "#77172A"
|
||||
readonly property color raisin_black : "#AE2B25"
|
||||
readonly property color steel_blue : "#462C98"
|
||||
readonly property color twilight_lavender : "#754888"
|
||||
readonly property color eerie_black : "#191716"
|
||||
}
|
2
qml/styles/qmldir
Normal file
2
qml/styles/qmldir
Normal file
@ -0,0 +1,2 @@
|
||||
CustomBorder 1.0 CustomBorder.qml
|
||||
singleton Theme 1.0 Theme.qml
|
Reference in New Issue
Block a user