mirror of
https://github.com/QRouland/UTPass.git
synced 2025-07-25 16:46:00 +00:00
Fix style command
This commit is contained in:
.astylercclickable.yaml
plugins
qml
Main.qml
components
dialogs
DoubleValidationDialog.qmlErrorDialog.qmlPassphraseDialog.qmlSimpleValidationDialog.qmlSuccessDialog.qml
pages
styles
@ -1,14 +1,19 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import "headers"
|
||||
import "../components"
|
||||
import Lomiri.Components 1.3
|
||||
import QtQuick 2.4
|
||||
import "headers"
|
||||
|
||||
Page {
|
||||
id: infoPage
|
||||
|
||||
header: StackHeader {
|
||||
id: infoHeader
|
||||
title: i18n.tr('Info')
|
||||
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;
|
||||
}
|
||||
|
||||
Flow {
|
||||
@ -24,6 +29,7 @@ Page {
|
||||
|
||||
Text {
|
||||
id: manifestTitle
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
width: parent.width
|
||||
@ -35,12 +41,14 @@ Page {
|
||||
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 {
|
||||
@ -54,6 +62,7 @@ Page {
|
||||
|
||||
Text {
|
||||
id: manifestVersion
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
width: parent.width
|
||||
height: units.gu(4)
|
||||
@ -72,12 +81,14 @@ Page {
|
||||
|
||||
Text {
|
||||
id: manifestMaintener
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
width: parent.width
|
||||
height: units.gu(2)
|
||||
fontSizeMode: Text.Fit
|
||||
font.pixelSize: 72
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Flow {
|
||||
@ -85,14 +96,17 @@ Page {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
|
||||
ExternalLink {
|
||||
url: "https://github.com/QRouland/UTPass/issues"
|
||||
text: i18n.tr("Suggest improvement(s) or report a bug(s)")
|
||||
}
|
||||
|
||||
ExternalLink {
|
||||
url: "https://github.com/QRouland/UTPass"
|
||||
text: i18n.tr("Access to the source code")
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
height: units.gu(2)
|
||||
@ -100,17 +114,13 @@ Page {
|
||||
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()
|
||||
header: StackHeader {
|
||||
id: infoHeader
|
||||
|
||||
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
|
||||
title: i18n.tr('Info')
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import QtQuick 2.4
|
||||
import "headers"
|
||||
|
||||
Page {
|
||||
@ -10,38 +10,15 @@ Page {
|
||||
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
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
@ -52,18 +29,49 @@ Page {
|
||||
|
||||
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]
|
||||
header: PageHeader {
|
||||
id: passwordPageHeader
|
||||
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
title: passwordPage.title
|
||||
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();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
contents: Item {
|
||||
height: parent.height
|
||||
width: parent.width
|
||||
|
||||
Label {
|
||||
id: labelTitle
|
||||
|
||||
text: passwordPage.title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import Qt.labs.folderlistmodel 2.1
|
||||
import Pass 1.0
|
||||
import "../components"
|
||||
import Lomiri.Components 1.3
|
||||
import Pass 1.0
|
||||
import Qt.labs.folderlistmodel 2.1
|
||||
import QtQuick 2.4
|
||||
import "headers"
|
||||
|
||||
Page {
|
||||
@ -11,25 +11,8 @@ Page {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
Component.onCompleted: {
|
||||
passwordStorePath = "file:" + Pass.password_store;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@ -38,13 +21,14 @@ Page {
|
||||
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")
|
||||
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 {
|
||||
@ -56,17 +40,38 @@ Page {
|
||||
|
||||
model: FolderListModel {
|
||||
id: folderModel
|
||||
|
||||
nameFilters: ["*.gpg"]
|
||||
rootFolder: passwordStorePath
|
||||
folder: passwordStorePath
|
||||
showDirs: true
|
||||
}
|
||||
|
||||
delegate: FileDir {
|
||||
id: fileDelegate
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
passwordStorePath = "file:" + Pass.password_store
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,40 +1,15 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import QtQuick 2.4
|
||||
|
||||
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")
|
||||
@ -50,15 +25,43 @@ PageHeader {
|
||||
iconName: "settings"
|
||||
text: i18n.tr("Settings")
|
||||
onTriggered: {
|
||||
pageStack.push(Qt.resolvedUrl("../settings/Settings.qml"))
|
||||
pageStack.push(Qt.resolvedUrl("../settings/Settings.qml"));
|
||||
}
|
||||
},
|
||||
Action {
|
||||
iconName: "info"
|
||||
text: i18n.tr("Info")
|
||||
onTriggered: {
|
||||
pageStack.push(Qt.resolvedUrl("../Info.qml"))
|
||||
pageStack.push(Qt.resolvedUrl("../Info.qml"));
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
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: {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,31 +1,36 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import QtQuick 2.4
|
||||
|
||||
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()
|
||||
pageStack.pop();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
contents: Item {
|
||||
height: parent.height
|
||||
width: parent.width
|
||||
|
||||
Label {
|
||||
id: labelTitle
|
||||
|
||||
text: stackHeader.title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,18 +1,17 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import Git 1.0
|
||||
import Pass 1.0
|
||||
import "../headers"
|
||||
import "../../components"
|
||||
import "../../dialogs"
|
||||
import "../headers"
|
||||
import Git 1.0
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import Pass 1.0
|
||||
import QtQuick 2.4
|
||||
|
||||
Page {
|
||||
id: importGitClonePage
|
||||
|
||||
header: StackHeader {
|
||||
id: importGitCloneHeader
|
||||
title: i18n.tr('Git Clone Import')
|
||||
Component.onCompleted: {
|
||||
PopupUtils.open(importGitCloneValidation, importGitClonePage);
|
||||
}
|
||||
|
||||
Flow {
|
||||
@ -30,6 +29,7 @@ Page {
|
||||
|
||||
Text {
|
||||
id: repoUrlLabe
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
width: parent.width
|
||||
@ -38,6 +38,7 @@ Page {
|
||||
|
||||
TextField {
|
||||
id: textFieldInput
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
width: parent.width
|
||||
@ -46,51 +47,58 @@ Page {
|
||||
|
||||
Button {
|
||||
id: buttonAdd
|
||||
|
||||
width: parent.width
|
||||
text: i18n.tr('Clone')
|
||||
onClicked: {
|
||||
var ret = Git.clone(textFieldInput.text, Pass.password_store)
|
||||
if(ret) {
|
||||
PopupUtils.open(dialogImportGitCloneSuccess)
|
||||
} else {
|
||||
PopupUtils.open(importGitCloneError, importGitClonePage)
|
||||
}
|
||||
|
||||
|
||||
var ret = Git.clone(textFieldInput.text, Pass.password_store);
|
||||
if (ret)
|
||||
PopupUtils.open(dialogImportGitCloneSuccess);
|
||||
else
|
||||
PopupUtils.open(importGitCloneError, importGitClonePage);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component {
|
||||
id: importGitCloneValidation
|
||||
SimpleValidationDialog {
|
||||
text: i18n.tr(
|
||||
"Importing a git repo will delete<br>any existing password store!<br>Continue ?")
|
||||
onCanceled: {
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
id: importGitCloneValidation
|
||||
|
||||
SimpleValidationDialog {
|
||||
text: i18n.tr("Importing a git repo will delete<br>any existing password store!<br>Continue ?")
|
||||
onCanceled: {
|
||||
pageStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component {
|
||||
id: importGitCloneError
|
||||
id: importGitCloneError
|
||||
|
||||
ErrorDialog {
|
||||
textError: i18n.tr("An error occured during git clone !")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component {
|
||||
id: dialogImportGitCloneSuccess
|
||||
|
||||
SuccessDialog {
|
||||
textSuccess: i18n.tr("Password store sucessfully imported !")
|
||||
onDialogClosed: {
|
||||
pageStack.pop()
|
||||
pageStack.pop()
|
||||
pageStack.pop();
|
||||
pageStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
PopupUtils.open(importGitCloneValidation, importGitClonePage)
|
||||
header: StackHeader {
|
||||
id: importGitCloneHeader
|
||||
|
||||
title: i18n.tr('Git Clone Import')
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,82 +1,80 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Content 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import Pass 1.0
|
||||
import Utils 1.0
|
||||
import "../headers"
|
||||
import "../../dialogs"
|
||||
import "../headers"
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import Lomiri.Content 1.3
|
||||
import Pass 1.0
|
||||
import QtQuick 2.4
|
||||
import Utils 1.0
|
||||
|
||||
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 () {
|
||||
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
|
||||
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()
|
||||
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()
|
||||
pageStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
header: StackHeader {
|
||||
id: importKeyHeader
|
||||
|
||||
title: i18n.tr("GPG Key Import")
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,100 +1,97 @@
|
||||
import QtQuick 2.4
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Content 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import Pass 1.0
|
||||
import Utils 1.0
|
||||
import "../headers"
|
||||
import "../../dialogs"
|
||||
import "../headers"
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import Lomiri.Content 1.3
|
||||
import Pass 1.0
|
||||
import QtQuick 2.4
|
||||
import Utils 1.0
|
||||
|
||||
Page {
|
||||
id: importZipPage
|
||||
|
||||
property var activeTransfer
|
||||
|
||||
header: StackHeader {
|
||||
id: importZipHeader
|
||||
title: i18n.tr("Zip Password Store Import")
|
||||
Component.onCompleted: {
|
||||
PopupUtils.open(importZipPageImportValidation, importZipPage);
|
||||
}
|
||||
|
||||
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 () {
|
||||
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
|
||||
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()
|
||||
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 ?")
|
||||
text: i18n.tr("Importing a new zip will delete<br>any existing password store!<br>Continue ?")
|
||||
onCanceled: {
|
||||
pageStack.pop()
|
||||
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()
|
||||
pageStack.pop()
|
||||
pageStack.pop();
|
||||
pageStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
PopupUtils.open(importZipPageImportValidation, importZipPage)
|
||||
header: StackHeader {
|
||||
id: importZipHeader
|
||||
|
||||
title: i18n.tr("Zip Password Store Import")
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,28 +1,23 @@
|
||||
import QtQuick 2.4
|
||||
import "../../components"
|
||||
import "../../dialogs"
|
||||
import "../headers"
|
||||
import Lomiri.Components 1.3
|
||||
import Lomiri.Components.Popups 1.3
|
||||
import Pass 1.0
|
||||
import "../headers"
|
||||
import "../../components"
|
||||
import "../../dialogs"
|
||||
import QtQuick 2.4
|
||||
|
||||
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 {
|
||||
@ -38,6 +33,7 @@ Page {
|
||||
|
||||
Text {
|
||||
id: uidKey
|
||||
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
@ -46,11 +42,12 @@ Page {
|
||||
|
||||
Button {
|
||||
id: buttonDeleteKey
|
||||
|
||||
text: i18n.tr("Delete this key")
|
||||
color: LomiriColors.red
|
||||
onClicked: {
|
||||
infoKeysPage.currentKey = model.modelData.uid
|
||||
PopupUtils.open(infoKeysPageDeleteValidation, infoKeysPage)
|
||||
infoKeysPage.currentKey = model.modelData.uid;
|
||||
PopupUtils.open(infoKeysPageDeleteValidation, infoKeysPage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,43 +55,53 @@ Page {
|
||||
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)
|
||||
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)
|
||||
}
|
||||
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()
|
||||
infoKeysListView.model = Pass.gpgGetAllKeysModel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
header: StackHeader {
|
||||
id: infoKeysHeader
|
||||
|
||||
title: i18n.tr('Info Keys')
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,19 +1,14 @@
|
||||
import QtQuick 2.4
|
||||
import "../../components"
|
||||
import "../headers"
|
||||
import Lomiri.Components 1.3
|
||||
import Pass 1.0
|
||||
import "../headers"
|
||||
import "../../components"
|
||||
import QtQuick 2.4
|
||||
|
||||
Page {
|
||||
id: settingsPage
|
||||
|
||||
property string gpgKeyId: ""
|
||||
|
||||
header: StackHeader {
|
||||
id: settingsHeader
|
||||
title: i18n.tr('Settings')
|
||||
}
|
||||
|
||||
Flow {
|
||||
anchors.top: settingsHeader.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
@ -27,14 +22,17 @@ Page {
|
||||
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
|
||||
@ -42,22 +40,32 @@ Page {
|
||||
height: units.gu(4)
|
||||
text: i18n.tr('Password Store')
|
||||
}
|
||||
|
||||
PageStackLink {
|
||||
page: Qt.resolvedUrl("ImportGitClone.qml")
|
||||
text: i18n.tr('Import a Password Store using Git')
|
||||
}
|
||||
|
||||
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: LomiriColors.red
|
||||
text: i18n.tr(
|
||||
'Warning: importing delete any exiting Password Store')
|
||||
text: i18n.tr('Warning: importing delete any exiting Password Store')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
header: StackHeader {
|
||||
id: settingsHeader
|
||||
|
||||
title: i18n.tr('Settings')
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user