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

Fix delete gpg key

This commit is contained in:
2025-01-20 11:23:40 +01:00
parent c0757da47b
commit 0eb8920856
13 changed files with 74 additions and 56 deletions

View File

@ -9,7 +9,7 @@ import QtQuick 2.4
Page {
id: infoKeysPage
property string currentKey
property QtObject currentKey
Component.onCompleted: {
Pass.onGetAllGPGKeysSucceed.connect(function(keys_info) {
@ -18,6 +18,12 @@ Page {
Pass.getAllGPGKeysFailed.connect(function(message) {
PopupUtils.open(infoKeysPageGetAllError);
});
Pass.deleteGPGKeySucceed.connect(function(keys_info) {
PopupUtils.open(infoKeysPageDeleteSuccess);
});
Pass.deleteGPGKeyFailed.connect(function(message) {
PopupUtils.open(infoKeysPageDeleteError);
});
Pass.getAllGPGKeys();
}
@ -108,7 +114,7 @@ Page {
text: i18n.tr("Delete this key")
color: theme.palette.normal.negative
onClicked: {
infoKeysPage.currentKey = model.modelData.uid;
infoKeysPage.currentKey = model.modelData;
PopupUtils.open(infoKeysPageDeleteValidation, infoKeysPage);
}
}
@ -127,15 +133,11 @@ Page {
id: infoKeysPageDeleteValidation
SimpleValidationDialog {
text: i18n.tr("You're are about to delete<br>%1<br>Continue ?").arg(infoKeysPage.currentKey)
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: {
var status = Pass.deleteGPGKey(infoKeysPage.currentKey);
if (status)
PopupUtils.open(infoKeysPageDeleteSuccess);
else
PopupUtils.open(infoKeysPageDeleteError);
}
}

View File

@ -1,7 +1,7 @@
import QtQuick 2.4
import Git 1.0
import Lomiri.Components 1.3
import Pass 1.0
import QtQuick 2.4
Column {
width: parent.width

View File

@ -1,7 +1,7 @@
import QtQuick 2.4
import Git 1.0
import Lomiri.Components 1.3
import Pass 1.0
import QtQuick 2.4
Column {
anchors.top: parent.fill

View File

@ -1,31 +1,38 @@
import QtQuick 2.4
import Git 1.0
import Lomiri.Components 1.3
import Lomiri.Components.Pickers 1.3
import QtQuick 2.4
OptionSelector {
OptionSelector {
id: combo
width : parent.width
width: parent.width
model: ["HTTP", "HTTP AUTH"]
onDelegateClicked: function(i) {
if(i===0) {
timer.setTimeout(function(){importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttp.qml") }, 500);
} else if (i===1) {
timer.setTimeout( function(){importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttpAuth.qml") }, 500);
}
if (i === 0)
timer.setTimeout(function() {
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttp.qml");
}, 500);
else if (i === 1)
timer.setTimeout(function() {
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttpAuth.qml");
}, 500);
}
Timer {
id: timer
function setTimeout(cb, delayTime) {
timer.interval = delayTime;
timer.repeat = false;
timer.triggered.connect(cb);
timer.triggered.connect(function release () {
timer.triggered.connect(function release() {
timer.triggered.disconnect(cb); // This is important
timer.triggered.disconnect(release); // This is important as well
});
timer.start();
}
}
}

View File

@ -18,7 +18,7 @@ Page {
PopupUtils.open(dialogGitCloneError);
});
PopupUtils.open(importGitCloneValidation, importGitClonePage);
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttp.qml")
importGitCloneForm.source = Qt.resolvedUrl("GitCloneHttp.qml");
}
Column {
@ -44,6 +44,7 @@ Page {
width: parent.width
}
}
Component {