From dabab68b0b282254d68e69da82a472b6a998b3fe Mon Sep 17 00:00:00 2001 From: irengrig Date: Sat, 19 Dec 2009 20:16:20 +0300 Subject: [PATCH] CVS: path to private key to be displayed in password dialog (since there can be entries for the same root but with different credentials) for IDEA-26870 (CVS access with private key always asks for key password) --- .../com/intellij/cvsSupport2/CvsBundle.properties | 1 + .../connections/ssh/SshConnectionUtil.java | 1 + .../connections/ssh/ui/SshPasswordDialog.form | 31 +++++++++++----------- .../connections/ssh/ui/SshPasswordDialog.java | 7 +++++ 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/CvsBundle.properties b/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/CvsBundle.properties index e050891863..affc7b593f 100644 --- a/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/CvsBundle.properties +++ b/plugins/cvs/cvs-core/src/com/intellij/cvsSupport2/CvsBundle.properties @@ -440,6 +440,7 @@ import.wizard.include.to.import.action.name=Include to Import message.choose.stored.file.version.title=Choose stored version error.message.wrong.remote.repository=wrong remote repository: {0} propmt.text.enter.private.key.password.for=Enter private key password for {0} +prompt.path.to.private.key=Private key path: ''{0}'' close.tab.action.name=Close cvs.unknown.revision.presentation= browse.changes.user.field.label=&User diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/SshConnectionUtil.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/SshConnectionUtil.java index 15e978fa70..fe705a0eb8 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/SshConnectionUtil.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/SshConnectionUtil.java @@ -43,6 +43,7 @@ public class SshConnectionUtil { if (password == null) { SshPasswordDialog sshPasswordDialog = new SshPasswordDialog(CvsBundle.message("propmt.text.enter.private.key.password.for", cvsRoot)); + sshPasswordDialog.setAdditionalText(CvsBundle.message("prompt.path.to.private.key", settings.PATH_TO_PPK)); sshPasswordDialog.show(); if (!sshPasswordDialog.isOK()) return false; password = sshPasswordDialog.getPassword(); diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.form b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.form index 1021c30c78..6ede8d5f71 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.form +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.form @@ -1,39 +1,34 @@
- + - - - + - - + - + - - + - - + @@ -41,8 +36,7 @@ - - + @@ -50,13 +44,20 @@ - - + + + + + + + + + diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.java index 9a494903af..7241f42016 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/connections/ssh/ui/SshPasswordDialog.java @@ -16,6 +16,7 @@ package com.intellij.cvsSupport2.connections.ssh.ui; import com.intellij.openapi.ui.DialogWrapper; +import com.intellij.util.ui.UIUtil; import javax.swing.*; @@ -28,6 +29,7 @@ public class SshPasswordDialog extends DialogWrapper{ private JCheckBox myStoreCheckbox; private JPanel myPanel; private JLabel myLabel; + private JLabel myAdditionalLbl; public SshPasswordDialog(String propmtText) { @@ -35,6 +37,7 @@ public class SshPasswordDialog extends DialogWrapper{ myLabel.setText(propmtText); setTitle(com.intellij.CvsBundle.message("dialog.title.ssh.password")); init(); + myAdditionalLbl.setForeground(UIUtil.getInactiveTextColor()); } protected JComponent createCenterPanel() { @@ -52,4 +55,8 @@ public class SshPasswordDialog extends DialogWrapper{ public JComponent getPreferredFocusedComponent() { return myPasswordField; } + + public void setAdditionalText(final String text) { + myAdditionalLbl.setText(text); + } } -- 2.11.4.GIT