mirror of
https://github.com/QRouland/UTPass.git
synced 2026-01-08 10:46:58 +00:00
Some GIT clone improvements (error messgages ...)
This commit is contained in:
@@ -16,8 +16,15 @@ Page {
|
||||
property int __gitModeHTTP_AUTH : 1
|
||||
property int __gitModeSSH_KEY : 2
|
||||
|
||||
property int __gitCloneErrorCodeSuccessful : 0
|
||||
property int __gitCloneErrorCodeUnexpectedError : 1
|
||||
property int __gitCloneErrorCodeInvalidUrl : 2
|
||||
property int __gitCloneErrorCodeNoUsername : 3
|
||||
property int __gitCloneErrorCodeAuthentificationError : 4
|
||||
property int __gitCloneErrorCodeUrlTypeDoNotMatchCreds : 5
|
||||
|
||||
property string __repoUrl
|
||||
property string __err_message : null
|
||||
|
||||
function __loadForm() {
|
||||
switch (combo.selectedIndex) {
|
||||
@@ -41,10 +48,30 @@ Page {
|
||||
Utils.rmFile(Git.privKey);
|
||||
Utils.rmFile(Git.pubKey);
|
||||
}
|
||||
PopupUtils.open(dialogGitCloneSuccess);
|
||||
PopupUtils.open(dialogGitCloneSuccess, importGitClonePage);
|
||||
});
|
||||
Git.cloneFailed.connect(function() {
|
||||
PopupUtils.open(dialogGitCloneError);
|
||||
Git.cloneFailed.connect(function(err_code, msg) {
|
||||
switch (err_code) {
|
||||
case __gitCloneErrorCodeUnexpectedError:
|
||||
__err_message = i18n.tr("An error occurred during the clone operation.");
|
||||
break;
|
||||
case __gitCloneErrorCodeInvalidUrl:
|
||||
__err_message = i18n.tr("Invalid URL for the current clone operation.");
|
||||
break;
|
||||
case __gitCloneErrorCodeNoUsername:
|
||||
__err_message = i18n.tr("Username is missing in the URL.");
|
||||
break;
|
||||
case __gitCloneErrorCodeAuthentificationError:
|
||||
__err_message = i18n.tr("Authentication error, credentials may be invalid.");
|
||||
break;
|
||||
case __gitCloneErrorCodeUrlTypeDoNotMatchCreds:
|
||||
__err_message = i18n.tr("Credentials type does not match the URL for the current clone operation.");
|
||||
break;
|
||||
default:
|
||||
__err_message = msg;
|
||||
break;
|
||||
}
|
||||
PopupUtils.open(dialogGitCloneError, importGitClonePage);
|
||||
});
|
||||
if (GitSettings.repoUrl)
|
||||
__repoUrl = GitSettings.repoUrl;
|
||||
@@ -128,7 +155,7 @@ Page {
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +180,7 @@ Page {
|
||||
|
||||
ErrorDialog {
|
||||
textError: i18n.tr("An error occured during git clone !")
|
||||
textErrorDescription: __err_message
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import "../../components"
|
||||
import Pass 1.0
|
||||
|
||||
import Lomiri.Content 1.3
|
||||
|
||||
ImportFile {
|
||||
id: importKeyFilePage
|
||||
|
||||
@@ -10,8 +12,8 @@ ImportFile {
|
||||
|
||||
contentPicker.onPeerSelected: {
|
||||
{
|
||||
peer.selectionType = ContentTransfer.Single;
|
||||
importKeyFilePage.activeTransfer = peer.request();
|
||||
importKeyFilePage.contentPicker.peer.selectionType = ContentTransfer.Single;
|
||||
importKeyFilePage.activeTransfer = importKeyFilePage.contentPicker.peer.request();
|
||||
importKeyFilePage.activeTransfer.stateChanged.connect(function() {
|
||||
if (importKeyFilePage.activeTransfer.state === ContentTransfer.Charged) {
|
||||
console.log("Charged");
|
||||
|
||||
@@ -2,6 +2,8 @@ import "../../components"
|
||||
import Utils 1.0
|
||||
import Git 1.0
|
||||
|
||||
import Lomiri.Content 1.3
|
||||
|
||||
ImportFile {
|
||||
id: importSSHKeyPage
|
||||
|
||||
@@ -13,8 +15,8 @@ ImportFile {
|
||||
|
||||
contentPicker.onPeerSelected: {
|
||||
{
|
||||
peer.selectionType = ContentTransfer.Single;
|
||||
importSSHKeyPage.activeTransfer = peer.request();
|
||||
importSSHKeyPage.contentPicker.peer.selectionType = ContentTransfer.Single;
|
||||
importSSHKeyPage.activeTransfer = importSSHKeyPage.contentPicker.peer.request();
|
||||
importSSHKeyPage.activeTransfer.stateChanged.connect(function() {
|
||||
if (importSSHKeyPage.activeTransfer.state === ContentTransfer.Charged) {
|
||||
console.log("Charged");
|
||||
|
||||
Reference in New Issue
Block a user