mirror of
https://github.com/QRouland/UTPass.git
synced 2026-01-10 19:36:57 +00:00
Foramtting
This commit is contained in:
@@ -9,34 +9,35 @@ import Lomiri.Components.Popups 1.3
|
||||
import Pass 1.0
|
||||
import QtQuick 2.4
|
||||
import Utils 1.0
|
||||
Page {
|
||||
id: importGitClonePage
|
||||
|
||||
property int __gitModeHTTP : 0
|
||||
property int __gitModeHTTP_AUTH : 1
|
||||
Page {
|
||||
// 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
|
||||
id: importGitClonePage
|
||||
|
||||
property int __gitModeHTTP: 0
|
||||
property int __gitModeHTTP_AUTH: 1
|
||||
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
|
||||
property string __err_message: null
|
||||
|
||||
function __loadForm() {
|
||||
// case __gitModeSSH_KEY:
|
||||
// importGitCloneForm.source = Qt.resolvedUrl("../../components/GitCloneSshKey.qml");
|
||||
// break;
|
||||
|
||||
switch (combo.selectedIndex) {
|
||||
case __gitModeHTTP:
|
||||
importGitCloneForm.source = Qt.resolvedUrl("../../components/GitCloneHttp.qml");
|
||||
break;
|
||||
case __gitModeHTTP_AUTH:
|
||||
importGitCloneForm.source = Qt.resolvedUrl("../../components/GitCloneHttpAuth.qml");
|
||||
break;
|
||||
// case __gitModeSSH_KEY:
|
||||
// importGitCloneForm.source = Qt.resolvedUrl("../../components/GitCloneSshKey.qml");
|
||||
// break;
|
||||
case __gitModeHTTP:
|
||||
importGitCloneForm.source = Qt.resolvedUrl("../../components/GitCloneHttp.qml");
|
||||
break;
|
||||
case __gitModeHTTP_AUTH:
|
||||
importGitCloneForm.source = Qt.resolvedUrl("../../components/GitCloneHttpAuth.qml");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +45,8 @@ Page {
|
||||
Git.cloneSucceed.connect(function() {
|
||||
GitSettings.type = combo.selectedIndex;
|
||||
GitSettings.repoUrl = importGitClonePage.__repoUrl;
|
||||
if(GitSettings.type != __gitModeSSH_KEY) { // ensure there no ssh key is kept if swicthing to another git mode
|
||||
if (GitSettings.type != __gitModeSSH_KEY) {
|
||||
// ensure there no ssh key is kept if swicthing to another git mode
|
||||
Utils.rmFile(Git.privKey);
|
||||
Utils.rmFile(Git.pubKey);
|
||||
}
|
||||
@@ -52,24 +54,24 @@ Page {
|
||||
});
|
||||
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;
|
||||
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);
|
||||
});
|
||||
@@ -103,7 +105,7 @@ Page {
|
||||
id: combo
|
||||
|
||||
width: parent.width
|
||||
model: ["HTTP", "HTTP AUTH" ] //, "SSH KEY"]
|
||||
model: ["HTTP", "HTTP AUTH"] //, "SSH KEY"]
|
||||
onDelegateClicked: function(i) {
|
||||
timer.setTimeout(function() {
|
||||
__loadForm();
|
||||
@@ -133,28 +135,28 @@ Page {
|
||||
|
||||
width: parent.width
|
||||
onLoaded: {
|
||||
// case __gitModeSSH_KEY:
|
||||
// importGitCloneForm.item.importSshPrivKeyButton.clicked.connect(function() {
|
||||
// pageStack.push(Qt.resolvedUrl("ImportSSHkey.qml"), {
|
||||
// "isPrivateKey": true
|
||||
// });
|
||||
// });
|
||||
// importGitCloneForm.item.importSshPubKeyButton.clicked.connect(function() {
|
||||
// pageStack.push(Qt.resolvedUrl("ImportSSHkey.qml"), {
|
||||
// "isPrivateKey": false
|
||||
// });
|
||||
// });
|
||||
// break;
|
||||
|
||||
importGitCloneForm.item.repoUrlChanged.connect(function(url) {
|
||||
importGitClonePage.__repoUrl = url;
|
||||
});
|
||||
importGitCloneForm.item.setRepoUrl(importGitClonePage.__repoUrl);
|
||||
|
||||
switch (combo.selectedIndex) {
|
||||
case __gitModeHTTP:
|
||||
break;
|
||||
case __gitModeHTTP_AUTH:
|
||||
break;
|
||||
// case __gitModeSSH_KEY:
|
||||
// importGitCloneForm.item.importSshPrivKeyButton.clicked.connect(function() {
|
||||
// pageStack.push(Qt.resolvedUrl("ImportSSHkey.qml"), {
|
||||
// "isPrivateKey": true
|
||||
// });
|
||||
// });
|
||||
// importGitCloneForm.item.importSshPubKeyButton.clicked.connect(function() {
|
||||
// pageStack.push(Qt.resolvedUrl("ImportSSHkey.qml"), {
|
||||
// "isPrivateKey": false
|
||||
// });
|
||||
// });
|
||||
// break;
|
||||
case __gitModeHTTP:
|
||||
break;
|
||||
case __gitModeHTTP_AUTH:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user