Changeset 6885 in josm for trunk/src/org


Ignore:
Timestamp:
2014-02-26T23:16:08+01:00 (10 years ago)
Author:
Don-vip
Message:

hide unencrypted password warning with https hosts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java

    r6340 r6885  
    248248            return cbSaveCredentials.isSelected();
    249249        }
     250
     251        protected final void updateWarningLabel(String url) {
     252            boolean https = url != null && url.startsWith("https");
     253            if (https) {
     254                lblWarning.setText(null);
     255            } else {
     256                lblWarning.setText(tr("Warning: The password is transferred unencrypted."));
     257            }
     258            lblWarning.setVisible(!https);
     259        }
    250260    }
    251261
     
    257267            tfUserName.setToolTipText(tr("Please enter the user name of your OSM account"));
    258268            tfPassword.setToolTipText(tr("Please enter the password of your OSM account"));
     269            String apiUrl = OsmApi.getOsmApi().getBaseUrl();
    259270            lblHeading.setText(
    260271                    "<html>" + tr("Authenticating at the OSM API ''{0}'' failed. Please enter a valid username and a valid password.",
    261                             OsmApi.getOsmApi().getBaseUrl()) + "</html>");
    262             lblWarning.setText(tr("Warning: The password is transferred unencrypted."));
     272                            apiUrl) + "</html>");
     273            updateWarningLabel(apiUrl);
    263274        }
    264275
     
    281292                    "<html>" + tr("Authenticating at the host ''{0}'' failed. Please enter a valid username and a valid password.",
    282293                            host) + "</html>");
    283             lblWarning.setText(tr("Warning: The password is transferred unencrypted."));
     294            updateWarningLabel(host);
    284295        }
    285296
Note: See TracChangeset for help on using the changeset viewer.