Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH Authentication ダイアログでフォーカスがなくならないよう修正 #198 #203

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/en/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ <h3 id="teraterm_5.3">YYYY.MM.DD (Ver 5.3 not released yet)</h3>
</li>
<li>Default port settings is moved to <a href="../menu/setup-additional.html#Port">General tab</a> of Additional settings dialog.</li>
<li>Display lng file information when <a href="../menu/setup-general.html#UILanguageFile">LanguageUI</a> is selected. Remove language setting.</li>
<li>Fixed focus disappears in <a href="../menu/setup-sshauth.html">SSH Authentication</a> dialog and TAB cannot be used.</li>
</ul>
</li>

Expand Down
1 change: 1 addition & 0 deletions doc/ja/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ <h3 id="teraterm_5.3">YYYY.MM.DD (Ver 5.3 not released yet)</h3>
<li>���������̕\��������邱�Ƃ��������̂ŏC�������B</li>
<li>Window setup �_�C�A���O�� No Frame �������ύX���ꂽ�ꍇ���ύX��K�p����悤�ɂ����B</li>
<li>MACRO: <a href="../macro/command/send.html">send</a> �}�N���R�}���h�� $00 �𑗐M�ł��Ȃ����̂ŏC�������B</li>
<li><a href="../menu/setup-sshauth.html">SSH Authentication �_�C�A���O</a>�Ńt�H�[�J�X��������TAB�����g���Ȃ��Ȃ�����C������</li>
</ul>
</li>

Expand Down
17 changes: 13 additions & 4 deletions ttssh2/ttxssh/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,13 @@ static void init_auth_dlg(PTInstVar pvar, HWND dlg, BOOL *UseControlChar)
{ IDCANCEL, "BTN_DISCONNECT" },
};
int default_method = pvar->session_settings.DefaultAuthMethod;
int focus_id;

SetI18nDlgStrsW(dlg, "TTSSH", text_info, _countof(text_info), pvar->ts->UILanguageFileW);

init_auth_machine_banner(pvar, dlg);
init_password_control(pvar, dlg, IDC_SSHPASSWORD, UseControlChar);
focus_id = IDC_SSHPASSWORD;

// �F�؎��s��̓��x������������
if (pvar->auth_state.failed_method != SSH_AUTH_NONE) {
Expand Down Expand Up @@ -392,6 +394,7 @@ static void init_auth_dlg(PTInstVar pvar, HWND dlg, BOOL *UseControlChar)
EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD), FALSE);
EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORDCAPTION), FALSE);
EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD_OPTION), FALSE);
focus_id = IDCANCEL;
}
}

Expand Down Expand Up @@ -420,13 +423,15 @@ static void init_auth_dlg(PTInstVar pvar, HWND dlg, BOOL *UseControlChar)
EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD), FALSE);
EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD_OPTION), FALSE);
SetDlgItemText(dlg, IDC_SSHPASSWORD, "");
focus_id = IDCANCEL;

// /auth=pageant ��lj�
} else if (pvar->ssh2_authmethod == SSH_AUTH_PAGEANT) {
CheckRadioButton(dlg, IDC_SSHUSEPASSWORD, MAX_AUTH_CONTROL, IDC_SSHUSEPAGEANT);
EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD), FALSE);
EnableWindow(GetDlgItem(dlg, IDC_SSHPASSWORD_OPTION), FALSE);
SetDlgItemText(dlg, IDC_SSHPASSWORD, "");
focus_id = IDCANCEL;

} else {
// �f�t�H���g�̔F�؃��\�b�h���_�C�A���O�ɔ��f
Expand All @@ -439,19 +444,19 @@ static void init_auth_dlg(PTInstVar pvar, HWND dlg, BOOL *UseControlChar)
// ���܂��̂ŁA�������O�C���L������ SetFocus ���Ȃ� (2009.1.31 maya)
if (default_method == SSH_AUTH_TIS) {
/* we disabled the password control, so fix the focus */
SetFocus(GetDlgItem(dlg, IDC_SSHUSETIS));
focus_id = IDC_SSHUSETIS;
}
else if (default_method == SSH_AUTH_PAGEANT) {
SetFocus(GetDlgItem(dlg, IDC_SSHUSEPAGEANT));
focus_id = IDC_SSHUSEPAGEANT;
}

}

if (GetWindowTextLength(GetDlgItem(dlg, IDC_SSHUSERNAME)) == 0) {
SetFocus(GetDlgItem(dlg, IDC_SSHUSERNAME));
focus_id = IDC_SSHUSERNAME;
}
else if (pvar->ask4passwd == 1) {
SetFocus(GetDlgItem(dlg, IDC_SSHPASSWORD));
focus_id = IDC_SSHPASSWORD;
}

// '/I' �w�肪����Ƃ��̂ݍŏ������� (2005.9.5 yutaka)
Expand All @@ -460,6 +465,10 @@ static void init_auth_dlg(PTInstVar pvar, HWND dlg, BOOL *UseControlChar)
ShowWindow(dlg,SW_MINIMIZE);
//20050822�lj� end T.Takahashi
}

// �t�H�[�J�X���Z�b�g����
//SetFocus(GetDlgItem(dlg, focus_id));
PostMessage(dlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(dlg, focus_id), TRUE);
}

static char *alloc_control_text(HWND ctl)
Expand Down