mirror of
https://github.com/QRouland/UTPass.git
synced 2025-07-09 05:12:29 +00:00
Improve Lib Pass Error Messages
This commit is contained in:
@ -17,7 +17,8 @@ Page {
|
||||
|
||||
property string headerTitle : i18n.tr("Import succeeded !")
|
||||
property string dialogErrorTxt : i18n.tr("Import failed !")
|
||||
property string dialogSuccessTxt : i18n.tr("File Import")
|
||||
property string dialogErrorDescriptionTxt : null
|
||||
property string dialogSuccessTxt : i18n.tr("File Imported")
|
||||
|
||||
ContentPeerPicker {
|
||||
id: contentPicker
|
||||
@ -46,6 +47,7 @@ Page {
|
||||
|
||||
ErrorDialog {
|
||||
textError: importKeyFilePage.dialogErrorTxt
|
||||
textErrorDescription: importKeyFilePage.dialogErrorDescriptionTxt
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ import "../../components"
|
||||
import Pass 1.0
|
||||
|
||||
ImportFile {
|
||||
|
||||
id: importKeyFilePage
|
||||
|
||||
headerTitle: i18n.tr("GPG Key Import")
|
||||
@ -23,9 +22,21 @@ ImportFile {
|
||||
importKeyFilePage.activeTransfer = null;
|
||||
PopupUtils.open(importKeyFilePage.dialogImportKeyPageSucess);
|
||||
});
|
||||
Pass.importGPGKeyFailed.connect(function(message) {
|
||||
Pass.importGPGKeyFailed.connect(function(err, message) {
|
||||
Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url);
|
||||
importKeyFilePage.activeTransfer = null;
|
||||
switch (code) {
|
||||
case 1: // UnexceptedError -> use the default (not translate) rnp error
|
||||
__text_error_description = message;
|
||||
break;
|
||||
case 2: // BadFormat
|
||||
__text_error_description = i18n.tr("The file is not in a valid key format");
|
||||
break;
|
||||
default:
|
||||
console.warn("Unhandled error code");
|
||||
__text_error_description = message;
|
||||
break;
|
||||
}
|
||||
PopupUtils.open(importKeyFilePage.dialogImportKeyPageError);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user