[Openstreetmap] [PATCH] Prompt for login instead of reporting the need to log in

Petter Reinholdtsen pere at hungry.com
Sun May 22 17:58:44 BST 2005


When trying to use the Java applet to draw streets, the connection
tend to time out way too often.  And when this happen, a dialog box
pops up, informing me about the need to log in.  But this seem rather
stupid to me, as it would be a lot more efficient if it just popped up
the login dialog box directly, instead of requiring me to select
"Server->Login" in the GUI to actually do the login.

I suspect this patch might solve the issue, by making sure to ask for
a email address/password every time a login is needed.

It is untested, as I do not have a working java development
environment available.

Index: src/org/openstreetmap/applet/osmDisplay.java
===================================================================
--- src/org/openstreetmap/applet/osmDisplay.java        (revision 409)
+++ src/org/openstreetmap/applet/osmDisplay.java        (working copy)
@@ -242,12 +242,15 @@

     }

+    osmAppletLoginWindow loginWindow =
+       new osmAppletLoginWindow((JFrame)null,true,this);
+    /*
     JOptionPane.showMessageDialog((JFrame)null,
         "Not logged in, or login timeout",
         "Login",
         JOptionPane.WARNING_MESSAGE);
-
-    return false;
+    */
+    return osc.loggedIn();

   } // checkLogin


Another annoying thing is the "Login succeeded" dialog box popping up.
It would be better if the login status was visible in the GUI
somewhere.  Only failed logins need to be reported, and such failed
login would be better to report in the login dialog box itself, as the
user will need to try again to do the login, or press 'cancel' to give
up logging in.

Steve, what do you think about such change?

(And why is the applet timing out so often?  Is the timeout refreshed
every time I use the connection?  Based on the behavior, I do not
think so.)





More information about the talk mailing list