Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lb2PK-0004mM-6b for pgsql-odbc@arkaria.postgresql.org; Mon, 26 Apr 2021 14:40:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lb2PI-0006DF-UI for pgsql-odbc@arkaria.postgresql.org; Mon, 26 Apr 2021 14:40:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lb2PI-0006D8-Jn for pgsql-odbc@lists.postgresql.org; Mon, 26 Apr 2021 14:40:16 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lb2PG-0006mA-2I for pgsql-odbc@postgresql.org; Mon, 26 Apr 2021 14:40:16 +0000 Received: by mail-il1-x133.google.com with SMTP id j12so1923909ils.4 for ; Mon, 26 Apr 2021 07:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mlc-wels.edu; s=google; h=mime-version:from:date:message-id:subject:to; bh=OFwuLfh7QfclGO9ef1BxdS/fyGewzQTSLiKZO55q1ZA=; b=GqhPOmXYDq4TqC7KMzsK5e/r+7j0PmUlGGVc8imhMMRRaZ4SU1gNNO/CFA5KCoyUD+ 4/I/s5fGngkMcrXHqxIG0niTNg+lsFkNYdSpBBXDrsw2ZTAsaESWC7wJ6vgESQo3g2wB I1Tc+JtxWG18QjcKL960TwaNbJ5OVkTYSuSXRciLctXS+hUlrK5je4fkiRhjeYNx4mCs f0JeFO13uCsPGQxjp26ZH9/Vw/kNbTSiu1eK7fcfO+Ts1xUlg0rYNemGmcljNekL2kZM pt5qlb+ppq9RRXC+kZp/XvoX0uhW4pRizhNFC0RLiRRMY8RVms18L/PHuCjK8BBDyT8E H5cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OFwuLfh7QfclGO9ef1BxdS/fyGewzQTSLiKZO55q1ZA=; b=IOskyLiSEQojWQ3PzuJs0+CfJbIStNFyCdLcqBHi2oKMrxcxFKH6Vly0jA6q1jH4DF sIkbAP8tayIjqIqjXqWckhKR3P/4MZsfMz5JcWsSTqkprNuyUk4JteBp45txIn5XIS9P gafK+jzNJKfQx23OztSsyRnHRgMzVEezNtL/e4EDzlF/wlLmRF7NubrT4kCdhYBY5XJL TQh3Lfa7iU4C7W4Q8ITNQJpbdRCVKAZyYAJf3gKxQAbDoKFqraXvtHmPXiddBaBCvhkO mIFBLF+lMD4CvyJhFvuzjb+8ZGArsJJb/EXFB7E+bThGkHwoz5OriUO6eaqqBrCLbcnW XByg== X-Gm-Message-State: AOAM532GEivyKq1OFbOPYuVp7j36P0+M0PM8GFmQEADHKA7Wl1TPuZYB oplUv/YMumZ1LuaQCPFzDUWV/WgDAH92jYcCpLRHcaHYcWi8TXB3IqqtLNte/9Wv7gpHihfZY4D kOQkEGAwMvkxlaMmPnM7Eam6hjOUDCRaLQfqz X-Google-Smtp-Source: ABdhPJypuTfLXphAOAo1FbiFPIQkAk1LoPrFSZrBc0sN/o9bn/nHe+VttOMzW7b9s8ObJ1N+DUoh+jjbTnTz7npxzKo= X-Received: by 2002:a92:d308:: with SMTP id x8mr14011312ila.301.1619448011429; Mon, 26 Apr 2021 07:40:11 -0700 (PDT) MIME-Version: 1.0 From: Aaron Spike Date: Mon, 26 Apr 2021 09:40:00 -0500 Message-ID: Subject: Rationale for password field focus To: pgsql-odbc@postgresql.org Content-Type: multipart/alternative; boundary="00000000000074369005c0e11f7c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000074369005c0e11f7c Content-Type: text/plain; charset="UTF-8" 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. --00000000000074369005c0e11f7c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
We've noticed that the password field on the Post= greSQL Connection dialog is always focused when empty, even when other fiel= ds 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 t= he expectation of most users. The related commit messages don't provide= much information about why this was done. Can anyone share the rationale f= or the current behavior?

For the purpose of discu= ssion, I would propose separating the conditional to inform the user that t= he 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 7= 224c17..76586b8 100644
--- a/drvconn.c
+++ b/drvconn.c
@@ -390,12 = +390,11 @@ dconn_FDriverConnectProc(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 HWND notu =3D GetDlgItem(hdlg, IDC_NOTICE_USER);
=C2= =A0
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetFocus(GetDlgItem(hdlg, IDC_PASSWO= RD));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowText(notu, " = =C2=A0Supply password =C2=A0 =C2=A0 =C2=A0 ");
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ShowWindow(notu, SW_SHOW);
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 SendMessage(notu, WM_CTLCOLOR, 0, 0);
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
- =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 e= lse if (ci->database[0] =3D=3D '\0')
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ci->database= [0] =3D=3D '\0')
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ; =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* d= efault focus */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 else if (ci->server[0] =3D=3D '\0')<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetFocus(GetDlgItem(hdlg, IDC_SER= VER));
@@ -403,6 +402,8 @@ dconn_FDriverConnectProc(
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 SetFocus(GetDlgItem(hdlg, IDC_PORT));
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 else if (ci->username[0] =3D=3D '\0')
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 SetFocus(GetDlgItem(hdlg, IDC_USER));
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else if = (ci->password[0] =3D=3D '\0' && ci->password_required= )
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetFocus(GetDlgItem(hdlg, IDC_PASSWO= RD));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 break;
=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 case WM_COMMAND:



This electronic communication, inc= luding any attached documents, may contain confidential and/or legally priv= ileged 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=20 Luther College.

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