1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-06-29 08:42:29 +00:00

Initial Commit : 0.0.1

This commit is contained in:
2019-09-20 21:29:39 +02:00
commit 2a8c72f8d0
65 changed files with 3486 additions and 0 deletions

50
qml/Main.qml Normal file
View File

@ -0,0 +1,50 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import Pass 1.0
import "dialogs"
MainView {
id: root
objectName: "mainView"
applicationName: "utpass.qrouland"
automaticOrientation: false
width: units.gu(48)
height: units.gu(80)
signal responsePassphraseDialog(bool canceled, string passphrase)
function initPass(rootView) {
Pass.init(rootView)
}
function callPassphraseDialog(useridHint, description, previousWasBad) {
//TODO use parameters to impove passphrase dialog
var passphraseDialog = PopupUtils.open(
Qt.resolvedUrl("dialogs/PassphraseDialog.qml"))
passphraseDialog.activateFocus()
var validated = function (passphrase) {
responsePassphraseDialog(false, passphrase)
}
var canceled = function () {
responsePassphraseDialog(true, "")
}
passphraseDialog.validated.connect(validated)
passphraseDialog.canceled.connect(canceled)
}
PageStack {
id: pageStack
anchors.fill: parent
Component.onCompleted: {
pageStack.push(Qt.resolvedUrl("pages/PasswordList.qml"))
}
}
}

View File

@ -0,0 +1,64 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import "../styles"
Item {
id: copyText
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 {
anchors.fill: parent
Text {
text: copyText.text
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.verticalCenter: parent.verticalCenter
}
Icon {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: units.gu(2)
height: units.gu(4)
name: "edit-copy"
color: UbuntuColors.orange
}
MouseArea {
anchors.fill: parent
onPressed: {
parent.color = UbuntuColors.warmGrey
}
onClicked: {
var mimeData = Clipboard.newData()
mimeData.text = copyText.text
Clipboard.push(mimeData)
}
onReleased: {
parent.color = theme.palette.normal.background
}
}
CustomBorder {
id: cb
commonBorder: copyText.commonBorder
lBorderwidth: copyText.lBorderwidth
rBorderwidth: copyText.rBorderwidth
tBorderwidth: copyText.tBorderwidth
bBorderwidth: copyText.bBorderwidth
borderColor: copyText.borderColor
}
}
}

View File

@ -0,0 +1,59 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import "../styles"
Item {
id: externalLink
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 {
anchors.fill: parent
Text {
text: externalLink.text
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.verticalCenter: parent.verticalCenter
}
Icon {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: units.gu(2)
width: units.gu(4)
height: units.gu(4)
name: "go-next"
color: UbuntuColors.orange
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.openUrlExternally(externalLink.url)
}
}
CustomBorder {
id: cb
commonBorder: externalLink.commonBorder
lBorderwidth: externalLink.lBorderwidth
rBorderwidth: externalLink.rBorderwidth
tBorderwidth: externalLink.tBorderwidth
bBorderwidth: externalLink.bBorderwidth
borderColor: externalLink.borderColor
}
}
}

View File

@ -0,0 +1,78 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import Pass 1.0
import "../styles"
import "../dialogs"
Component {
Rectangle {
id: fileDir
property string activePasswordName
anchors.right: parent.right
anchors.left: parent.left
height: units.gu(5)
Text {
text: fileBaseName
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.verticalCenter: parent.verticalCenter
}
Icon {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: units.gu(2)
height: units.gu(4)
name: fileIsDir ? "go-next" : "lock"
color: UbuntuColors.orange
}
MouseArea {
anchors.fill: parent
onClicked: {
if (fileIsDir) {
folderModel.folder = folderModel.folder + "/" + fileName
backAction.visible = true
} else {
fileDir.activePasswordName = fileBaseName
Pass.onDecrypted.connect(function (text) {
pageStack.push(Qt.resolvedUrl("../pages/Password.qml"),
{
"plainText": text,
"title": fileDir.activePasswordName
})
})
Pass.onDecryptFailed.connect(function () {
PopupUtils.open(passwordPageDecryptError)
})
Pass.decrypt(folderModel.folder + "/" + fileName)
}
}
}
CustomBorder {
commonBorder: false
lBorderwidth: 0
rBorderwidth: 0
tBorderwidth: 0
bBorderwidth: 1
borderColor: UbuntuColors.warmGrey
}
Component {
id: passwordPageDecryptError
ErrorDialog {
textError: i18n.tr("Decryption failed !")
onDialogClosed: {
pageStack.pop()
}
}
}
}
}

View File

@ -0,0 +1,62 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import "../styles"
Item {
id: pageStackLink
property string page
property var params: {
}
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 {
anchors.fill: parent
Text {
text: pageStackLink.text
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.verticalCenter: parent.verticalCenter
}
Icon {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: units.gu(2)
width: units.gu(4)
height: units.gu(4)
name: "go-next"
color: UbuntuColors.orange
}
MouseArea {
anchors.fill: parent
onClicked: {
pageStack.push(page, params)
}
}
CustomBorder {
id: cb
commonBorder: pageStackLink.commonBorder
lBorderwidth: pageStackLink.lBorderwidth
rBorderwidth: pageStackLink.rBorderwidth
tBorderwidth: pageStackLink.tBorderwidth
bBorderwidth: pageStackLink.bBorderwidth
borderColor: pageStackLink.borderColor
}
}
}

View File

@ -0,0 +1,52 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
Dialog {
id: doubleValidationDialog
property int nb_validation: 0
property string text1
property string text2
signal doubleValidated
signal canceled
Text {
visible: nb_validation == 0
horizontalAlignment: Text.AlignHCenter
text: text1
}
Text {
visible: nb_validation == 1
horizontalAlignment: Text.AlignHCenter
text: text2
}
Button {
text: i18n.tr("Ok")
color: UbuntuColors.green
onClicked: {
if (nb_validation == 1) {
nb_validation = 0
doubleValidated()
PopupUtils.close(doubleValidationDialog)
} else {
nb_validation += 1
}
}
}
Button {
id: cancelButton
text: i18n.tr("Cancel")
color: UbuntuColors.red
onClicked: {
nb_validation = 0
canceled()
PopupUtils.close(doubleValidationDialog)
}
}
}

View File

@ -0,0 +1,22 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
Dialog {
id: dialogSuccess
property string textError
signal dialogClosed
title: i18n.tr("Error !")
text: textError
Button {
text: i18n.tr("OK")
color: UbuntuColors.red
onClicked: function () {
dialogClosed()
PopupUtils.close(dialogSuccess)
}
}
}

View File

@ -0,0 +1,50 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
Dialog {
id: passphraseProvider
title: i18n.tr("Authentication required")
text: i18n.tr("Enter passphrase:")
signal validated(string passphrase)
signal canceled
function activateFocus() {
passphraseField.forceActiveFocus()
}
TextField {
id: passphraseField
placeholderText: i18n.tr("passphrase")
echoMode: TextInput.Password
onAccepted: okButton.clicked(text)
}
Button {
id: okButton
text: i18n.tr("Ok")
color: UbuntuColors.green
onClicked: {
validated(passphraseField.text)
passphraseField.text = ""
PopupUtils.close(passphraseProvider)
}
}
Button {
id: cancelButton
text: i18n.tr("Cancel")
color: UbuntuColors.red
onClicked: {
canceled()
PopupUtils.close(passphraseProvider)
}
}
}

View File

@ -0,0 +1,37 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
Dialog {
id: doubleValidationDialog
property string text
signal validated
signal canceled
Text {
horizontalAlignment: Text.AlignHCenter
text: doubleValidationDialog.text
}
Button {
text: i18n.tr("Ok")
color: UbuntuColors.green
onClicked: {
validated()
PopupUtils.close(doubleValidationDialog)
}
}
Button {
id: cancelButton
text: i18n.tr("Cancel")
color: UbuntuColors.red
onClicked: {
canceled()
PopupUtils.close(doubleValidationDialog)
}
}
}

View File

@ -0,0 +1,22 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
Dialog {
id: dialogSuccess
property string textSuccess
signal dialogClosed
title: i18n.tr("Success !")
text: textSuccess
Button {
text: i18n.tr("OK")
color: UbuntuColors.green
onClicked: function () {
dialogClosed()
PopupUtils.close(dialogSuccess)
}
}
}

116
qml/pages/Info.qml Normal file
View File

@ -0,0 +1,116 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import "headers"
import "../components"
Page {
id: infoPage
header: StackHeader {
id: infoHeader
title: i18n.tr('Info')
}
Flow {
anchors.top: infoHeader.bottom
anchors.right: parent.right
anchors.left: parent.left
spacing: units.gu(3)
Rectangle {
width: parent.width
height: units.gu(1)
}
Text {
id: manifestTitle
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
height: units.gu(8)
fontSizeMode: Text.Fit
font.pixelSize: 144
}
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
}
}
Text {
horizontalAlignment: Text.AlignHCenter
width: parent.width
height: units.gu(3)
text: i18n.tr("<b>Version</b>")
fontSizeMode: Text.Fit
font.pixelSize: 72
}
Text {
id: manifestVersion
horizontalAlignment: Text.AlignHCenter
width: parent.width
height: units.gu(4)
fontSizeMode: Text.Fit
font.pixelSize: 72
}
Text {
horizontalAlignment: Text.AlignHCenter
width: parent.width
height: units.gu(3)
text: i18n.tr("<b>Maintainer</>")
fontSizeMode: Text.Fit
font.pixelSize: 72
}
Text {
id: manifestMaintener
horizontalAlignment: Text.AlignHCenter
width: parent.width
height: units.gu(2)
fontSizeMode: Text.Fit
font.pixelSize: 72
}
}
Flow {
spacing: 2
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
ExternalLink {
url: "https://taiga.rdrive.ovh/project/utpass/issues"
text: i18n.tr("Suggest improvement(s) or report a bug(s)")
}
ExternalLink {
url: "https://git.rdrive.ovh/QRouland/UTPass"
text: i18n.tr("Access to the source code")
}
Text {
width: parent.width
height: units.gu(2)
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: i18n.tr("Released under the terms of the GNU GPL v3")
}
}
Component.onCompleted: {
var xhr = new XMLHttpRequest()
xhr.open("GET", "../../manifest_.json", false)
xhr.send()
var mJson = JSON.parse(xhr.responseText)
manifestTitle.text = "<b>" + mJson.title + "</b>"
manifestVersion.text = mJson.version + "<br>" + mJson.framework + "@" + mJson.architecture
manifestMaintener.text = mJson.maintainer
}
}

69
qml/pages/Password.qml Normal file
View File

@ -0,0 +1,69 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import "headers"
Page {
id: passwordPage
property string title
property string plainText
property var objects
header: PageHeader {
id: passwordPageHeader
width: parent.width
height: units.gu(6)
title: passwordPage.title
contents: Item {
height: parent.height
width: parent.width
Label {
id: labelTitle
text: passwordPage.title
anchors.verticalCenter: parent.verticalCenter
}
}
leadingActionBar.height: units.gu(4)
leadingActionBar.actions: [
Action {
id: backAction
iconName: "back"
text: "Back"
onTriggered: {
passwordPage.plainText = ""
for (var object in objects) {
object.text = ""
object.destroy()
}
pageStack.pop()
}
}
]
}
Rectangle {
anchors.top: passwordPageHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
Flow {
id: container
anchors.fill: parent
}
}
Component.onCompleted: {
var text_split = passwordPage.plainText.split('\n')
var component = Qt.createComponent("../components/CopyText.qml")
for (var i = 0; i < text_split.length; i++) {
if (text_split[i]) {
var object = component.createObject(container)
object.text = text_split[i]
}
}
}
}

View File

@ -0,0 +1,72 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Qt.labs.folderlistmodel 2.1
import Pass 1.0
import "../components"
import "headers"
Page {
id: passwordListPage
property string passwordStorePath
anchors.fill: parent
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
}
}
}
]
}
Rectangle {
anchors.top: passwordListHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
visible: folderModel.count == 0
Text {
text: i18n.tr(
"No password found<br>You can import a password store zip in the settings")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
horizontalAlignment: Text.AlignHCenter
}
}
ListView {
anchors.top: passwordListHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
spacing: 1
model: FolderListModel {
id: folderModel
nameFilters: ["*.gpg"]
rootFolder: passwordStorePath
folder: passwordStorePath
showDirs: true
}
delegate: FileDir {
id: fileDelegate
}
}
Component.onCompleted: {
passwordStorePath = "file:" + Pass.getPasswordStore()
}
}

View File

@ -0,0 +1,64 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
PageHeader {
id: mainHeader
width: parent.width
height: units.gu(6)
title: i18n.tr("UTPass")
contents: Item {
height: parent.height
width: parent.width
Label {
id: labelTitle
text: mainHeader.title
anchors.verticalCenter: parent.verticalCenter
visible: true
}
TextField {
id: searchBar
anchors.right: parent.right
anchors.left: parent.left
placeholderText: i18n.tr("Search")
height: units.gu(4)
visible: false
anchors.verticalCenter: parent.verticalCenter
onFocusChanged: {
}
}
}
trailingActionBar.height: units.gu(4)
trailingActionBar.numberOfSlots: 2
trailingActionBar.actions: [
/*Action { TODO
iconName: "search"
text: i18n.tr("Search")
onTriggered: {
searchBar.visible = !searchBar.visible
labelTitle.visible = !searchBar.visible
if (searchBar.visible === true) {
searchBar.focus = true
}
}
},*/
Action {
iconName: "settings"
text: i18n.tr("Settings")
onTriggered: {
pageStack.push(Qt.resolvedUrl("../settings/Settings.qml"))
}
},
Action {
iconName: "info"
text: i18n.tr("Info")
onTriggered: {
pageStack.push(Qt.resolvedUrl("../Info.qml"))
}
}
]
}

View File

@ -0,0 +1,31 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
PageHeader {
id: stackHeader
width: parent.width
height: units.gu(6)
title: i18n.tr("UTPass")
contents: Item {
height: parent.height
width: parent.width
Label {
id: labelTitle
text: stackHeader.title
anchors.verticalCenter: parent.verticalCenter
}
}
leadingActionBar.height: units.gu(4)
leadingActionBar.actions: [
Action {
id: backAction
iconName: "back"
text: "Back"
onTriggered: {
pageStack.pop()
}
}
]
}

View File

@ -0,0 +1,82 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Content 1.3
import Ubuntu.Components.Popups 1.3
import Pass 1.0
import Utils 1.0
import "../headers"
import "../../dialogs"
Page {
id: importKeyFilePage
property var activeTransfer
header: StackHeader {
id: importKeyHeader
title: i18n.tr("GPG Key Import")
}
ContentPeerPicker {
anchors.top: importKeyHeader.bottom
anchors.bottom: parent.bottom
anchors.topMargin: importKeyFilePage.header.height
width: parent.width
visible: parent.visible
showTitle: false
contentType: ContentType.Text
handler: ContentHandler.Source
onPeerSelected: {
peer.selectionType = ContentTransfer.Single
importKeyFilePage.activeTransfer = peer.request()
importKeyFilePage.activeTransfer.stateChanged.connect(function () {
if (importKeyFilePage.activeTransfer.state === ContentTransfer.Charged) {
console.log("Charged")
console.log(importKeyFilePage.activeTransfer.items[0].url)
var status = Pass.gpgImportKeyFromFile(
importKeyFilePage.activeTransfer.items[0].url)
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url)
if (status) {
PopupUtils.open(dialogImportKeyPageSucess)
} else {
PopupUtils.open(dialogImportKeyPageError)
}
importKeyFilePage.activeTransfer = null
}
})
}
onCancelPressed: {
pageStack.pop()
}
}
ContentTransferHint {
id: transferHint
anchors.fill: parent
activeTransfer: importKeyFilePage.activeTransfer
}
Component {
id: dialogImportKeyPageError
ErrorDialog {
textError: i18n.tr("Key import failed !")
}
}
Component {
id: dialogImportKeyPageSucess
SuccessDialog {
textSuccess: i18n.tr("Key successfully imported !")
onDialogClosed: {
pageStack.pop()
}
}
}
}

View File

@ -0,0 +1,99 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Content 1.3
import Ubuntu.Components.Popups 1.3
import Pass 1.0
import Utils 1.0
import "../headers"
import "../../dialogs"
Page {
id: importZipPage
property var activeTransfer
header: StackHeader {
id: importZipHeader
title: i18n.tr("Zip Password Store Import")
}
ContentPeerPicker {
anchors.top: importZipHeader.bottom
anchors.bottom: parent.bottom
anchors.topMargin: importZipPage.header.height
width: parent.width
visible: parent.visible
showTitle: false
contentType: ContentType.Text
handler: ContentHandler.Source
onPeerSelected: {
peer.selectionType = ContentTransfer.Single
importZipPage.activeTransfer = peer.request()
importZipPage.activeTransfer.stateChanged.connect(function () {
if (importZipPage.activeTransfer.state === ContentTransfer.Charged) {
console.log("Charged")
console.log(importZipPage.activeTransfer.items[0].url)
var status = Utils.unzip(
importZipPage.activeTransfer.items[0].url,
Pass.getPasswordStore())
Utils.rmFile(importZipPage.activeTransfer.items[0].url)
if (status) {
PopupUtils.open(dialogImportZipPageSuccess)
} else {
PopupUtils.open(dialogImportZipPageError)
}
importZipPage.activeTransfer = null
}
})
}
onCancelPressed: {
pageStack.pop()
}
}
ContentTransferHint {
id: transferHint
anchors.fill: parent
activeTransfer: importZipPage.activeTransfer
}
Component {
id: importZipPageImportValidation
SimpleValidationDialog {
text: i18n.tr(
"Importing a new zip will delete<br>any existing password store!<br>Continue ?")
onCanceled: {
pageStack.pop()
}
}
}
Component {
id: dialogImportZipPageError
ErrorDialog {
textError: i18n.tr("Password store import failed !")
}
}
Component {
id: dialogImportZipPageSuccess
SuccessDialog {
textSuccess: i18n.tr("Password store sucessfully imported !")
onDialogClosed: {
pageStack.pop()
}
}
}
Component.onCompleted: {
PopupUtils.open(importZipPageImportValidation, importZipPage)
}
}

View File

@ -0,0 +1,100 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import Pass 1.0
import "../headers"
import "../../components"
import "../../dialogs"
Page {
id: infoKeysPage
property string currentKey
header: StackHeader {
id: infoKeysHeader
title: i18n.tr('Info Keys')
}
ListView {
id: infoKeysListView
anchors.top: infoKeysHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
model: Pass.gpgGetAllKeysModel()
delegate: Grid {
columns: 1
width: parent.width
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
Rectangle {
width: parent.width
height: units.gu(1)
}
Text {
id: uidKey
width: parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: i18n.tr('Key id : %1').arg(model.modelData.uid)
}
Button {
id: buttonDeleteKey
text: i18n.tr("Delete this key")
color: UbuntuColors.red
onClicked: {
infoKeysPage.currentKey = model.modelData.uid
PopupUtils.open(infoKeysPageDeleteValidation, infoKeysPage)
}
}
Rectangle {
width: parent.width
height: units.gu(1)
}
}
}
Component {
id: infoKeysPageDeleteValidation
DoubleValidationDialog {
text1: i18n.tr(
"You're are about to delete<br>%1<br>Continue ?").arg(
infoKeysPage.currentKey)
text2: i18n.tr(
"%1<br>will be definitively removed.<br>Continue ?").arg(
infoKeysPage.currentKey)
onDoubleValidated: {
var status = Pass.gpgDeleteKeyId(infoKeysPage.currentKey)
if (status) {
PopupUtils.open(infoKeysPageDeleteSuccess)
} else {
PopupUtils.open(infoKeysPageDeleteError)
}
}
}
}
Component {
id: infoKeysPageDeleteError
ErrorDialog {
textError: i18n.tr("Key removal failed !")
}
}
Component {
id: infoKeysPageDeleteSuccess
SuccessDialog {
textSuccess: i18n.tr("Key successfully deleted !")
onDialogClosed: {
infoKeysListView.model = Pass.gpgGetAllKeysModel()
}
}
}
}

View File

@ -0,0 +1,59 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Pass 1.0
import "../headers"
import "../../components"
Page {
id: settingsPage
property string gpgKeyId: ""
header: StackHeader {
id: settingsHeader
title: i18n.tr('Settings')
}
Flow {
anchors.top: settingsHeader.bottom
anchors.bottom: parent.bottom
width: parent.width
spacing: 1
Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
height: units.gu(4)
text: i18n.tr('GPG')
}
PageStackLink {
page: Qt.resolvedUrl("ImportKeyFile.qml")
text: i18n.tr('Import a GPG key file')
}
PageStackLink {
page: Qt.resolvedUrl("InfoKeys.qml")
text: i18n.tr('Show GPG keys')
}
Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
height: units.gu(4)
text: i18n.tr('Password Store')
}
PageStackLink {
page: Qt.resolvedUrl("ImportZip.qml")
text: i18n.tr('Import a Password Store Zip')
}
Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
width: parent.width
height: units.gu(4)
color: UbuntuColors.red
text: i18n.tr(
'Warning: importing delete any exiting Password Store')
}
}
}

View File

@ -0,0 +1,32 @@
// Author : Amit Tomar
// @ https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element#16562823
import QtQuick 2.4
Rectangle {
property bool commonBorder: true
property int lBorderwidth: 1
property int rBorderwidth: 1
property int tBorderwidth: 1
property int bBorderwidth: 1
property int commonBorderWidth: 1
z: -1
property string borderColor: "white"
color: borderColor
anchors {
left: parent.left
right: parent.right
top: parent.top
bottom: parent.bottom
topMargin: commonBorder ? -commonBorderWidth : -tBorderwidth
bottomMargin: commonBorder ? -commonBorderWidth : -bBorderwidth
leftMargin: commonBorder ? -commonBorderWidth : -lBorderwidth
rightMargin: commonBorder ? -commonBorderWidth : -rBorderwidth
}
}