mirror of
https://github.com/QRouland/UTPass.git
synced 2026-01-09 19:16:57 +00:00
Fix an UI GPG key import popup not showing up
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import "../dialogs"
|
|
||||||
import "../pages/headers"
|
import "../pages/headers"
|
||||||
import Lomiri.Components 1.3
|
import Lomiri.Components 1.3
|
||||||
import Lomiri.Components.Popups 1.3
|
import Lomiri.Components.Popups 1.3
|
||||||
@@ -12,8 +11,6 @@ Page {
|
|||||||
|
|
||||||
property var activeTransfer
|
property var activeTransfer
|
||||||
property alias contentPicker : contentPicker
|
property alias contentPicker : contentPicker
|
||||||
property alias dialogImportKeyPageError : dialogImportKeyPageError
|
|
||||||
property alias dialogImportKeyPageSucess : dialogImportKeyPageSucess
|
|
||||||
|
|
||||||
property string headerTitle : i18n.tr("Import succeeded !")
|
property string headerTitle : i18n.tr("Import succeeded !")
|
||||||
property string dialogErrorTxt : i18n.tr("Import failed !")
|
property string dialogErrorTxt : i18n.tr("Import failed !")
|
||||||
@@ -42,27 +39,6 @@ Page {
|
|||||||
activeTransfer: importKeyFilePage.activeTransfer
|
activeTransfer: importKeyFilePage.activeTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
|
||||||
id: dialogImportKeyPageError
|
|
||||||
|
|
||||||
ErrorDialog {
|
|
||||||
textError: importKeyFilePage.dialogErrorTxt
|
|
||||||
textErrorDescription: importKeyFilePage.dialogErrorDescriptionTxt
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: dialogImportKeyPageSucess
|
|
||||||
|
|
||||||
SuccessDialog {
|
|
||||||
textSuccess: importKeyFilePage.dialogSuccessTxt
|
|
||||||
onDialogClosed: {
|
|
||||||
pageStack.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
header: StackHeader {
|
header: StackHeader {
|
||||||
id: importKeyHeader
|
id: importKeyHeader
|
||||||
|
|||||||
@@ -1,16 +1,35 @@
|
|||||||
import "../../components"
|
import "../../dialogs"
|
||||||
import Pass 1.0
|
import "../headers"
|
||||||
|
import Lomiri.Components 1.3
|
||||||
|
import Lomiri.Components.Popups 1.3
|
||||||
import Lomiri.Content 1.3
|
import Lomiri.Content 1.3
|
||||||
|
import Pass 1.0
|
||||||
|
import QtQuick 2.4
|
||||||
|
import Utils 1.0
|
||||||
|
|
||||||
ImportFile {
|
|
||||||
|
|
||||||
|
Page {
|
||||||
id: importKeyFilePage
|
id: importKeyFilePage
|
||||||
|
|
||||||
headerTitle: i18n.tr("GPG Key Import")
|
property var activeTransfer
|
||||||
dialogSuccessTxt : i18n.tr("Key successfully imported !")
|
property alias contentPicker : contentPicker
|
||||||
dialogErrorTxt : i18n.tr("Key import failed !")
|
|
||||||
|
|
||||||
contentPicker.onPeerSelected: {
|
property string __text_error_description : null
|
||||||
|
|
||||||
|
|
||||||
|
ContentPeerPicker {
|
||||||
|
id: contentPicker
|
||||||
|
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: {
|
||||||
{
|
{
|
||||||
importKeyFilePage.contentPicker.peer.selectionType = ContentTransfer.Single;
|
importKeyFilePage.contentPicker.peer.selectionType = ContentTransfer.Single;
|
||||||
importKeyFilePage.activeTransfer = importKeyFilePage.contentPicker.peer.request();
|
importKeyFilePage.activeTransfer = importKeyFilePage.contentPicker.peer.request();
|
||||||
@@ -22,7 +41,7 @@ ImportFile {
|
|||||||
Pass.importGPGKeySucceed.connect(function() {
|
Pass.importGPGKeySucceed.connect(function() {
|
||||||
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url);
|
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url);
|
||||||
importKeyFilePage.activeTransfer = null;
|
importKeyFilePage.activeTransfer = null;
|
||||||
PopupUtils.open(importKeyFilePage.dialogImportKeyPageSucess);
|
PopupUtils.open(dialogImportKeyPageSucess);
|
||||||
});
|
});
|
||||||
Pass.importGPGKeyFailed.connect(function(err, message) {
|
Pass.importGPGKeyFailed.connect(function(err, message) {
|
||||||
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url);
|
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url);
|
||||||
@@ -39,10 +58,51 @@ ImportFile {
|
|||||||
__text_error_description = message;
|
__text_error_description = message;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PopupUtils.open(importKeyFilePage.dialogImportKeyPageError);
|
PopupUtils.open(dialogImportKeyPageError);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onCancelPressed: {
|
||||||
|
pageStack.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentTransferHint {
|
||||||
|
id: transferHint
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
activeTransfer: importKeyFilePage.activeTransfer
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
header: StackHeader {
|
||||||
|
id: importKeyHeader
|
||||||
|
|
||||||
|
title: i18n.tr("GPG Key Import")
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: dialogImportKeyPageError
|
||||||
|
|
||||||
|
ErrorDialog {
|
||||||
|
textError: i18n.tr("Key import failed !")
|
||||||
|
textErrorDescription: __text_error_description
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: dialogImportKeyPageSucess
|
||||||
|
|
||||||
|
SuccessDialog {
|
||||||
|
textSuccess: i18n.tr("Key successfully imported !")
|
||||||
|
onDialogClosed: {
|
||||||
|
pageStack.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import "../../components"
|
|||||||
import Utils 1.0
|
import Utils 1.0
|
||||||
import Git 1.0
|
import Git 1.0
|
||||||
|
|
||||||
|
import Lomiri.Components 1.3
|
||||||
|
import Lomiri.Components.Popups 1.3
|
||||||
import Lomiri.Content 1.3
|
import Lomiri.Content 1.3
|
||||||
|
|
||||||
ImportFile {
|
ImportFile {
|
||||||
|
|||||||
Reference in New Issue
Block a user