From a0dc04102a18ee744bda9066feafa61b782b1c1b Mon Sep 17 00:00:00 2001 From: Pierre-Luc Paour Date: Sun, 29 Sep 2002 22:09:17 +0000 Subject: [PATCH] Handling login errors (UI was getting out of synch). Popping up error dialog on error. --- com/gallery/GalleryRemote/GalleryComm.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com/gallery/GalleryRemote/GalleryComm.java b/com/gallery/GalleryRemote/GalleryComm.java index fa72616..7484c0b 100644 --- a/com/gallery/GalleryRemote/GalleryComm.java +++ b/com/gallery/GalleryRemote/GalleryComm.java @@ -91,6 +91,7 @@ public void run() { mf.setInProgress(true); if ( ! isLoggedIn ) { if ( !login() ) { + mf.setInProgress(false); return; } @@ -146,7 +147,7 @@ private boolean login() { status("Logged in"); return true; } else { - status("Login Error: " + response); + error("Login Error: " + response); return false; } } @@ -329,7 +330,7 @@ void status(String message) { } void error(String message) { - // TODO: use error dialog + JOptionPane.showMessageDialog(mf, message, "Error", JOptionPane.ERROR_MESSAGE); status(message); }