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

Add delete password store feature

This commit is contained in:
2025-01-20 14:46:47 +01:00
parent 0eb8920856
commit ebfc6f500d
15 changed files with 329 additions and 65 deletions

View File

@ -26,17 +26,39 @@ Page {
});
}
Rectangle {
Column {
anchors.top: passwordListHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
visible: folderModel.count == 0
anchors.leftMargin: units.gu(2)
anchors.rightMargin: units.gu(2)
Rectangle {
width: parent.width
height: units.gu(1)
}
Text {
text: i18n.tr("No password found<br>You can import a password store by cloning or importing a zip in the settings")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
text: i18n.tr("No password found")
width: parent.width
horizontalAlignment: Text.AlignHCenter
}
Rectangle {
width: parent.width
height: units.gu(1)
}
Text {
text: i18n.tr("You can import a password store by cloning or")
width: parent.width
horizontalAlignment: Text.AlignHCenter
}
Text {
text: i18n.tr("importing a password store zip in the settings")
width: parent.width
horizontalAlignment: Text.AlignHCenter
}

View File

@ -0,0 +1,92 @@
import "../../components"
import "../../dialogs"
import "../headers"
import Lomiri.Components 1.3
import Lomiri.Components.Popups 1.3
import Pass 1.0
import QtQuick 2.4
Page {
id: deleteRepoPage
Component.onCompleted: {
Pass.deletePasswordStoreSucceed.connect(function(keys_info) {
PopupUtils.open(deleteRepoPagePageDeleteSuccess);
});
Pass.deletePasswordStoreFailed.connect(function(message) {
PopupUtils.open(deleteRepoPagePageDeleteError);
});
}
Column {
id: deleteRepoPageListView
anchors.top: deleteRepoPageHeader.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.rightMargin: units.gu(2)
spacing: units.gu(1)
Rectangle {
width: parent.width
height: units.gu(1)
}
Button {
id: buttonDeleteKey
width: parent.width
text: i18n.tr("Delete Password Store")
color: theme.palette.normal.negative
onClicked: {
PopupUtils.open(deleteRepoPagePageDeleteValidation, deleteRepoPage);
}
}
}
Component {
id: deleteRepoPagePageDeleteValidation
SimpleValidationDialog {
text: i18n.tr("You're are about to delete<br>the current Password Store.<br>Continue ?")
continueText: i18n.tr("Yes")
continueColor: theme.palette.normal.negative
onValidated: {
var status = Pass.deletePasswordStore();
}
}
}
Component {
id: deleteRepoPagePageDeleteError
ErrorDialog {
textError: i18n.tr("Password Store removal failed !")
}
}
Component {
id: deleteRepoPagePageDeleteSuccess
SuccessDialog {
textSuccess: i18n.tr("Password Store deleted !")
onDialogClosed: {
pageStack.pop();
pageStack.pop();
}
}
}
header: StackHeader {
id: deleteRepoPageHeader
title: i18n.tr('Info Keys')
}
}

View File

@ -12,7 +12,7 @@ Page {
property QtObject currentKey
Component.onCompleted: {
Pass.onGetAllGPGKeysSucceed.connect(function(keys_info) {
Pass.getAllGPGKeysSucceed.connect(function(keys_info) {
infoKeysListView.model = keys_info;
});
Pass.getAllGPGKeysFailed.connect(function(message) {
@ -34,6 +34,8 @@ Page {
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.rightMargin: units.gu(2)
delegate: Grid {
columns: 1
@ -111,6 +113,7 @@ Page {
Button {
id: buttonDeleteKey
width: parent.width
text: i18n.tr("Delete this key")
color: theme.palette.normal.negative
onClicked: {
@ -133,7 +136,7 @@ Page {
id: infoKeysPageDeleteValidation
SimpleValidationDialog {
text: i18n.tr("You're are about to delete<br>%1<br>Continue ?").arg(infoKeysPage.currentKey.uid)
text: i18n.tr("You're are about to delete<br>%1<br>.Continue ?").arg(infoKeysPage.currentKey.uid)
continueText: i18n.tr("Yes")
continueColor: theme.palette.normal.negative
onValidated: {
@ -168,7 +171,7 @@ Page {
id: infoKeysPageGetAllError
ErrorDialog {
textError: i18n.tr("Decryption failed !")
textError: i18n.tr("An Error occured getting GPG keys !")
}
}

View File

@ -53,6 +53,11 @@ Page {
text: i18n.tr('Import a Password Store Zip')
}
PageStackLink {
page: Qt.resolvedUrl("DeleteRepo.qml")
text: i18n.tr('Delete Password Store')
}
Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter

View File

@ -11,12 +11,12 @@ OptionSelector {
onDelegateClicked: function(i) {
if (i === 0)
timer.setTimeout(function() {
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttp.qml");
}, 500);
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttp.qml");
}, 500);
else if (i === 1)
timer.setTimeout(function() {
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttpAuth.qml");
}, 500);
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttpAuth.qml");
}, 500);
}
Timer {

View File

@ -11,10 +11,10 @@ Page {
id: importGitClonePage
Component.onCompleted: {
Git.onCloneSucceed.connect(function() {
Git.cloneSucceed.connect(function() {
PopupUtils.open(dialogGitCloneSuccess);
});
Git.onCloneFailed.connect(function() {
Git.cloneFailed.connect(function() {
PopupUtils.open(dialogGitCloneError);
});
PopupUtils.open(importGitCloneValidation, importGitClonePage);