Rationale for password field focus - Mailing list pgsql-odbc

From Aaron Spike
Subject Rationale for password field focus
Date
Msg-id CABcA21QKRkouq26603_S+1BwODkSoECsb3N9oRw1Zx6C1Q0gFQ@mail.gmail.com
Whole thread Raw
List pgsql-odbc
We've noticed that the password field on the PostgreSQL Connection dialog is always focused when empty, even when other fields that appear earlier on the dialog (and in the tab order) are empty. This is only a minor annoyance, but it does seem like it would be contrary to the expectation of most users. The related commit messages don't provide much information about why this was done. Can anyone share the rationale for the current behavior?

For the purpose of discussion, I would propose separating the conditional to inform the user that the password is required, but still focus the first empty field. (Please see the diff below.)

Aaron Spike

diff --git a/drvconn.c b/drvconn.c
index 7224c17..76586b8 100644
--- a/drvconn.c
+++ b/drvconn.c
@@ -390,12 +390,11 @@ dconn_FDriverConnectProc(
                        {
                                HWND notu = GetDlgItem(hdlg, IDC_NOTICE_USER);
 
-                               SetFocus(GetDlgItem(hdlg, IDC_PASSWORD));
                                SetWindowText(notu, "  Supply password       ");
                                ShowWindow(notu, SW_SHOW);
                                SendMessage(notu, WM_CTLCOLOR, 0, 0);
                        }
-                       else if (ci->database[0] == '\0')
+                       if (ci->database[0] == '\0')
                                ;                       /* default focus */
                        else if (ci->server[0] == '\0')
                                SetFocus(GetDlgItem(hdlg, IDC_SERVER));
@@ -403,6 +402,8 @@ dconn_FDriverConnectProc(
                                SetFocus(GetDlgItem(hdlg, IDC_PORT));
                        else if (ci->username[0] == '\0')
                                SetFocus(GetDlgItem(hdlg, IDC_USER));
+                       else if (ci->password[0] == '\0' && ci->password_required)
+                               SetFocus(GetDlgItem(hdlg, IDC_PASSWORD));
                        break;
 
                case WM_COMMAND:



This electronic communication, including any attached documents, may contain confidential and/or legally privileged information that is intended only for use by the recipient(s) named above. If you have received this communication in error, please notify the sender immediately and delete the communication and any attachments. Views expressed by the author do not necessarily represent those of Martin Luther College.

This electronic communication, including any attached documents, may contain confidential and/or legally privileged information that is intended only for use by the recipient(s) named above. If you have received this communication in error, please notify the sender immediately and delete the communication and any attachments. Views expressed by the author do not necessarily represent those of Martin Luther College.

pgsql-odbc by date:

Previous
From: Christophe Pettus
Date:
Subject: C99 required?
Next
From: Andrey Lukyanov
Date:
Subject: MSI Digital Signature