Changeset 15863 for gli


Ignore:
Timestamp:
2008-06-04T19:37:54+12:00 (13 years ago)
Author:
ak19
Message:

Exit Client GLI (Gatherer.exit()) when user pressed cancel first time in the opening dialog or if the connection was refused, instead of a zillion error dialogs popping up because it tries to (but fails) to do more tasks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/remote/RemoteGreenstoneServer.java

    r15775 r15863  
    253253    public void run()
    254254    {
     255        boolean exit = false;
    255256        while (true) {
    256257        // If there are jobs on the queue, get the next in line and process it
     
    266267            catch (RemoteGreenstoneServerActionCancelledException exception) {
    267268            remote_greenstone_server_action.processed_successfully = false;
     269            exit = true;
     270            }
     271            catch(java.net.ConnectException exception) {
     272            if(exception.getMessage().equals("Connection refused")) {
     273                exit = true;
     274            } else {
     275                DebugStream.printStackTrace(exception);
     276            }
     277            JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("RemoteGreenstoneServer.Error", exception.getMessage()), Dictionary.get("RemoteGreenstoneServer.Error_Title"), JOptionPane.ERROR_MESSAGE);
     278            remote_greenstone_server_action.processed_successfully = false;         
    268279            }
    269280            catch (Exception exception) {
     
    289300            catch (InterruptedException exception) { }
    290301            }
     302        }
     303       
     304        // stop the gazillion annoying error messages when the connection was simply
     305        // refused or when the user pressed Cancel in the opening dialog, by exitting
     306        // cleanly in one go.
     307        if(exit == true) {
     308            Gatherer.exit();
    291309        }
    292310        }
Note: See TracChangeset for help on using the changeset viewer.