diff --git a/plugins/Git/error.h b/plugins/Git/error.h index 86fdbfa..0727fd0 100644 --- a/plugins/Git/error.h +++ b/plugins/Git/error.h @@ -22,7 +22,8 @@ enum class GitCloneErrorCode { * @param error A pointer to the git_error structure * @return Corresponding GitCloneErrorCode integer value */ -inline GitCloneErrorCode gitErrorToGitCloneErrorCode(const git_error* error) { +inline GitCloneErrorCode gitErrorToGitCloneErrorCode(const git_error* error) +{ if (error == nullptr) { return GitCloneErrorCode::Successful; ///< Default error if null } diff --git a/plugins/Git/git.cpp b/plugins/Git/git.cpp index 86dcc2d..08e2590 100644 --- a/plugins/Git/git.cpp +++ b/plugins/Git/git.cpp @@ -15,7 +15,7 @@ extern "C" { Git::Git(): m_sem(std::unique_ptr(new QSemaphore(1))), m_ssh_homedir (QStandardPaths::writableLocation( - QStandardPaths::AppDataLocation).append("/.ssh")) + QStandardPaths::AppDataLocation).append("/.ssh")) { qDebug() << "[Git] SSH Home is " << m_ssh_homedir.absolutePath(); QDir m_ssh_homedir(this->m_ssh_homedir); @@ -83,7 +83,8 @@ void Git::cloneResult(const int err_code, const QString message) this->m_sem->release(); } -bool Git::importSshKey(QUrl source_path, bool is_private){ +bool Git::importSshKey(QUrl source_path, bool is_private) +{ auto destination_path = is_private ? this->privKeyPath() : this->pubKeyPath(); QFile source_file(source_path.toLocalFile()); diff --git a/plugins/Git/jobs/clonejob.cpp b/plugins/Git/jobs/clonejob.cpp index e2f4d74..7de292c 100644 --- a/plugins/Git/jobs/clonejob.cpp +++ b/plugins/Git/jobs/clonejob.cpp @@ -62,14 +62,16 @@ bool CloneJob::moveToDestination(QDir tmp_dir, const QString& path) qDebug() << "[CloneJob] Moving cloned content to destination dir"; if (!QDir().rename(tmp_dir.absolutePath(), destination_dir.absolutePath())) { - qWarning() << "[CloneJob] Failed to move directory from" << tmp_dir.absolutePath() << "to" << destination_dir.absolutePath(); + qWarning() << "[CloneJob] Failed to move directory from" << tmp_dir.absolutePath() << "to" << + destination_dir.absolutePath(); return false; } return true; } -const QPair CloneJob::clone(QString url, QString path, cred_type cred, git_cred_acquire_cb cb) +const QPair CloneJob::clone(QString url, QString path, cred_type cred, + git_cred_acquire_cb cb) { git_repository *repo = nullptr; // Use nullptr for type safety git_clone_options opts = GIT_CLONE_OPTIONS_INIT; @@ -82,11 +84,11 @@ const QPair CloneJob::clone(QString url, QString pat // Map the application specific cb errors if any if (ret == GIT_EUSER) { - if(payload.err == ErrorCodeCB::NoUsername) + if (payload.err == ErrorCodeCB::NoUsername) return {GitCloneErrorCode::NoUsername, "no username provided in URL"}; - if(payload.err == ErrorCodeCB::InvalidCreds) + if (payload.err == ErrorCodeCB::InvalidCreds) return {GitCloneErrorCode::AuthentificationError, "authentification error"}; - if(payload.err == ErrorCodeCB::UrlTypeDoNotMatchCreds) + if (payload.err == ErrorCodeCB::UrlTypeDoNotMatchCreds) return {GitCloneErrorCode::UrlTypeDoNotMatchCreds, "invalid creds types for provided url"}; return {GitCloneErrorCode::UnexpectedError, "unexcepted error occured"}; } diff --git a/plugins/Git/jobs/clonejob.h b/plugins/Git/jobs/clonejob.h index 406cf29..f9d5eee 100644 --- a/plugins/Git/jobs/clonejob.h +++ b/plugins/Git/jobs/clonejob.h @@ -27,12 +27,12 @@ class CloneJob : public GitJob signals: /** - * @brief Signal emitted when the cloning operation is complete. - * - * This signal is emitted once the cloning operation finishes. - * - * @param err A Git error. - */ + * @brief Signal emitted when the cloning operation is complete. + * + * This signal is emitted once the cloning operation finishes. + * + * @param err A Git error. + */ void resultReady(const int err_code, const QString message); private: diff --git a/plugins/Git/jobs/gitjob.cpp b/plugins/Git/jobs/gitjob.cpp index 86e596c..320ee92 100644 --- a/plugins/Git/jobs/gitjob.cpp +++ b/plugins/Git/jobs/gitjob.cpp @@ -57,7 +57,7 @@ int GitJob::credentialsCB(git_cred **out, const char *url, const char *username_ } return git_cred_userpass_plaintext_new(out, username_from_url, x.pass.toLocal8Bit().constData()); }, - [allowed_types, &out, &username_from_url , &p](const SSHKey & x) + [allowed_types, &out, &username_from_url, &p](const SSHKey & x) { qDebug() << "[GitJob] credentialsCB : SSHKey "; if (!(allowed_types & GIT_CREDTYPE_SSH_KEY)) { diff --git a/plugins/Git/jobs/gitjob.h b/plugins/Git/jobs/gitjob.h index 2404d57..80791dc 100644 --- a/plugins/Git/jobs/gitjob.h +++ b/plugins/Git/jobs/gitjob.h @@ -39,8 +39,7 @@ enum class ErrorCodeCB { }; -struct PayloadCB -{ +struct PayloadCB { bool called; cred_type creds; ErrorCodeCB err; diff --git a/plugins/Pass/error.h b/plugins/Pass/error.h index 1e0faf6..84f9469 100644 --- a/plugins/Pass/error.h +++ b/plugins/Pass/error.h @@ -24,7 +24,8 @@ enum class ErrorCodeShow { * @param rnpErrorCode The RNP error code * @return Corresponding ErrorCodeShow integer value */ -inline ErrorCodeShow rnpErrorToErrorCodeShow(int rnpErrorCode) { +inline ErrorCodeShow rnpErrorToErrorCodeShow(int rnpErrorCode) +{ switch (rnpErrorCode) { case RNP_ERROR_BAD_PASSWORD: return ErrorCodeShow::BadPassphrase; ///< Bad passphrase error @@ -49,7 +50,8 @@ enum class ErrorCodeImportKeyFile { * @param rnpErrorCode The RNP error code * @return Corresponding ErrorCodeImportKeyFile integer value */ -inline ErrorCodeImportKeyFile rnpErrorToErrorCodeImportKeyFile(int rnpErrorCode) { +inline ErrorCodeImportKeyFile rnpErrorToErrorCodeImportKeyFile(int rnpErrorCode) +{ switch (rnpErrorCode) { case RNP_ERROR_BAD_FORMAT: return ErrorCodeImportKeyFile::BadFormat; ///< Bad format error diff --git a/plugins/Pass/pass.cpp b/plugins/Pass/pass.cpp index cffe856..fb01af3 100644 --- a/plugins/Pass/pass.cpp +++ b/plugins/Pass/pass.cpp @@ -137,7 +137,7 @@ bool Pass::deletePasswordStore() } void Pass::slotDeletePasswordStoreResult(bool err) -{ +{ if (err) { qInfo() << "[Pass] Delete Password Store Failed"; emit deletePasswordStoreFailed(static_cast(ErrorCode::Error), "Failed to delete password store"); diff --git a/qml/components/GitCloneSshKey.qml b/qml/components/GitCloneSshKey.qml index cec84f7..8651b5d 100644 --- a/qml/components/GitCloneSshKey.qml +++ b/qml/components/GitCloneSshKey.qml @@ -1,18 +1,16 @@ import Git 1.0 import Lomiri.Components 1.3 import Pass 1.0 -import Utils 1.0 import QtQuick 2.4 +import Utils 1.0 Column { - - - property alias importSshPrivKeyButton : repoImportPrivKeyButton - property alias importSshPubKeyButton : repoImportPubKeyButton - property alias deleteSshPrivKeyButton : repoDeletePrivKeyButton - property alias deleteSshPubKeyButton : repoDeletePubKeyButton - property bool __sshPrivKeyAvailable : false - property bool __sshPubKeyAvailable : false + property alias importSshPrivKeyButton: repoImportPrivKeyButton + property alias importSshPubKeyButton: repoImportPubKeyButton + property alias deleteSshPrivKeyButton: repoDeletePrivKeyButton + property alias deleteSshPubKeyButton: repoDeletePubKeyButton + property bool __sshPrivKeyAvailable: false + property bool __sshPubKeyAvailable: false signal repoUrlChanged(string url) @@ -28,7 +26,6 @@ Column { Component.onCompleted: { update(); } - anchors.top: parent.fill spacing: units.gu(1) @@ -108,7 +105,6 @@ Column { visible: !__sshPrivKeyAvailable } - Text { id: repoPassphraseLabel diff --git a/qml/components/ImportFile.qml b/qml/components/ImportFile.qml index 54a3d97..0bae719 100644 --- a/qml/components/ImportFile.qml +++ b/qml/components/ImportFile.qml @@ -10,15 +10,15 @@ Page { id: importKeyFilePage property var activeTransfer - property alias contentPicker : contentPicker - - property string headerTitle : i18n.tr("Import succeeded !") - property string dialogErrorTxt : i18n.tr("Import failed !") - property string dialogErrorDescriptionTxt : null - property string dialogSuccessTxt : i18n.tr("File Imported") + property alias contentPicker: contentPicker + property string headerTitle: i18n.tr("Import succeeded !") + property string dialogErrorTxt: i18n.tr("Import failed !") + property string dialogErrorDescriptionTxt: null + property string dialogSuccessTxt: i18n.tr("File Imported") ContentPeerPicker { id: contentPicker + anchors.top: importKeyHeader.bottom anchors.bottom: parent.bottom anchors.topMargin: importKeyFilePage.header.height @@ -39,7 +39,6 @@ Page { activeTransfer: importKeyFilePage.activeTransfer } - header: StackHeader { id: importKeyHeader diff --git a/qml/dialogs/ErrorDialog.qml b/qml/dialogs/ErrorDialog.qml index 665bfe4..a213b0a 100644 --- a/qml/dialogs/ErrorDialog.qml +++ b/qml/dialogs/ErrorDialog.qml @@ -6,12 +6,12 @@ Dialog { id: dialog property string textError - property string textErrorDescription : null + property string textErrorDescription: null signal dialogClosed() title: i18n.tr("Error !") - text: textErrorDescription ? (textError + "
" + textErrorDescription) : textError + text: textErrorDescription ? (textError + "
" + textErrorDescription) : textError Button { text: i18n.tr("Close") diff --git a/qml/pages/PasswordList.qml b/qml/pages/PasswordList.qml index f008bf5..7624056 100644 --- a/qml/pages/PasswordList.qml +++ b/qml/pages/PasswordList.qml @@ -51,22 +51,26 @@ Page { }); Pass.onShowFailed.connect(function(code, message) { switch (code) { - case 1: // UnexceptedError -> use the default (not translate) rnp error - __text_error_description = message; - break; - case 2: // BadPassphrase - __text_error_description = i18n.tr("Bad passphrase"); - break; - case 3: // NoKeyFound - __text_error_description = i18n.tr("No valid key found"); - break; - case 3: // DecryptFailed - __text_error_description = i18n.tr("Decryption failed"); - break; - default: - console.warn("Unhandled error code"); - __text_error_description = message; - break; + case 1: + // UnexceptedError -> use the default (not translate) rnp error + __text_error_description = message; + break; + case 2: + // BadPassphrase + __text_error_description = i18n.tr("Bad passphrase"); + break; + case 3: + // NoKeyFound + __text_error_description = i18n.tr("No valid key found"); + break; + case 3: + // DecryptFailed + __text_error_description = i18n.tr("Decryption failed"); + break; + default: + console.warn("Unhandled error code"); + __text_error_description = message; + break; } PopupUtils.open(passwordPageDecryptError); }); @@ -195,10 +199,9 @@ Page { textError: i18n.tr("Decryption failed !") textErrorDescription: __text_error_description } + } - - Timer { id: searchTimer diff --git a/qml/pages/settings/ImportGitClone.qml b/qml/pages/settings/ImportGitClone.qml index 3c3ddd3..0566c8c 100644 --- a/qml/pages/settings/ImportGitClone.qml +++ b/qml/pages/settings/ImportGitClone.qml @@ -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; } } } diff --git a/qml/pages/settings/ImportKeyFile.qml b/qml/pages/settings/ImportKeyFile.qml index d2c9dce..2bb944d 100644 --- a/qml/pages/settings/ImportKeyFile.qml +++ b/qml/pages/settings/ImportKeyFile.qml @@ -7,19 +7,16 @@ import Pass 1.0 import QtQuick 2.4 import Utils 1.0 - - Page { id: importKeyFilePage property var activeTransfer - property alias contentPicker : contentPicker - - property string __text_error_description : null - + property alias contentPicker: contentPicker + property string __text_error_description: null ContentPeerPicker { id: contentPicker + anchors.top: importKeyHeader.bottom anchors.bottom: parent.bottom anchors.topMargin: importKeyFilePage.header.height @@ -28,43 +25,43 @@ Page { showTitle: false contentType: ContentType.Text handler: ContentHandler.Source - onPeerSelected: { - { - 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"); - console.log(importKeyFilePage.activeTransfer.items[0].url); - Pass.importGPGKey(importKeyFilePage.activeTransfer.items[0].url); - Pass.importGPGKeySucceed.connect(function() { - Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url); - importKeyFilePage.activeTransfer = null; - PopupUtils.open(dialogImportKeyPageSucess); - }); - 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(dialogImportKeyPageError); - }); - } - }); - } + { + 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"); + console.log(importKeyFilePage.activeTransfer.items[0].url); + Pass.importGPGKey(importKeyFilePage.activeTransfer.items[0].url); + Pass.importGPGKeySucceed.connect(function() { + Utils.rmFile(importKeyFilePage.activeTransfer.items[0].url); + importKeyFilePage.activeTransfer = null; + PopupUtils.open(dialogImportKeyPageSucess); + }); + 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(dialogImportKeyPageError); + }); + } + }); + }; } - onCancelPressed: { pageStack.pop(); } @@ -77,13 +74,6 @@ Page { activeTransfer: importKeyFilePage.activeTransfer } - - header: StackHeader { - id: importKeyHeader - - title: i18n.tr("GPG Key Import") - } - Component { id: dialogImportKeyPageError @@ -105,4 +95,11 @@ Page { } } + + header: StackHeader { + id: importKeyHeader + + title: i18n.tr("GPG Key Import") + } + } diff --git a/qml/pages/settings/ImportSSHkey.qml b/qml/pages/settings/ImportSSHkey.qml index 8e42741..d1bdc22 100644 --- a/qml/pages/settings/ImportSSHkey.qml +++ b/qml/pages/settings/ImportSSHkey.qml @@ -1,10 +1,9 @@ import "../../components" -import Utils 1.0 import Git 1.0 - import Lomiri.Components 1.3 import Lomiri.Components.Popups 1.3 import Lomiri.Content 1.3 +import Utils 1.0 ImportFile { id: importSSHKeyPage @@ -12,27 +11,25 @@ ImportFile { property bool isPrivateKey headerTitle: i18n.tr("SSH Key Import") - dialogSuccessTxt : i18n.tr("SSH Key successfully imported !") - dialogErrorTxt : i18n.tr("SSH Key import failed !") - + dialogSuccessTxt: i18n.tr("SSH Key successfully imported !") + dialogErrorTxt: i18n.tr("SSH Key import failed !") contentPicker.onPeerSelected: { - { - 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"); - console.log(importSSHKeyPage.activeTransfer.items[0].url); - var ret = Git.importSshKey(importSSHKeyPage.activeTransfer.items[0].url, isPrivateKey); - Utils.rmFile(importSSHKeyPage.activeTransfer.items[0].url); - importSSHKeyPage.activeTransfer = null; - if(ret) { - PopupUtils.open(importSSHKeyPage.dialogImportKeyPageSucess); - } else { - PopupUtils.open(importSSHKeyPage.dialogImportKeyPageError); - } - } - }); - } + { + 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"); + console.log(importSSHKeyPage.activeTransfer.items[0].url); + var ret = Git.importSshKey(importSSHKeyPage.activeTransfer.items[0].url, isPrivateKey); + Utils.rmFile(importSSHKeyPage.activeTransfer.items[0].url); + importSSHKeyPage.activeTransfer = null; + if (ret) + PopupUtils.open(importSSHKeyPage.dialogImportKeyPageSucess); + else + PopupUtils.open(importSSHKeyPage.dialogImportKeyPageError); + } + }); + }; } }