Changeset 13600


Ignore:
Timestamp:
2007-01-12T17:20:20+13:00 (15 years ago)
Author:
mdewsnip
Message:

Now always downloads the collection configurations when the GLI is starting up, as nothing much works without them. This simplifies the code and means that the openCollectionFromLastTime() function works.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
3 edited

Legend:

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

    r13599 r13600  
    462462    }
    463463
     464    // If using a remote Greenstone we need to download the collection configurations now
     465    if (Gatherer.isGsdlRemote) {
     466        if (RemoteGreenstoneServer.downloadCollectionConfigurations().equals("")) {
     467        // !! Something went wrong downloading the collection configurations
     468        System.err.println("Error: Could not download collection configurations.");
     469        System.exit(0);
     470        }
     471    }
     472
    464473    // If there was a collection left open last time, reopen it
    465474    c_man.openCollectionFromLastTime();
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r13596 r13600  
    102102    static private GShellProgressMonitor import_monitor = null;
    103103
    104     /** Whether we have downloaded the collection configurations in this session, when using a remote Greenstone. */
    105     static public boolean downloaded_collection_configurations = false;
    106 
    107104    /** The name of the standard lock file. */
    108105    static final public String LOCK_FILE = "gli.lck";
     
    10671064    {
    10681065    // If there was an open collection last session, reopen it
    1069     if (Gatherer.open_collection_file_path != null && !Gatherer.isGsdlRemote) {
    1070         // If we're using a remote Greenstone server we must download the collection configurations first
    1071         // if (Gatherer.isGsdlRemote && !CollectionManager.downloaded_collection_configurations) {
    1072         // if (RemoteGreenstoneServer.downloadCollectionConfigurations().equals("")) {
    1073             // Something went wrong downloading the collection configurations
    1074             // return;
    1075         // }
    1076 
    1077         // CollectionManager.downloaded_collection_configurations = true;
    1078         // }
    1079 
     1066    if (Gatherer.open_collection_file_path != null) {
    10801067        // Load the collection now
    10811068        loadCollection(Gatherer.open_collection_file_path);
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r13591 r13600  
    673673    public void run()
    674674    {
    675         // If using a remote Greenstone check if the collection configurations have been downloaded; do so if not
    676         if (Gatherer.isGsdlRemote && !CollectionManager.downloaded_collection_configurations) {
    677         if (RemoteGreenstoneServer.downloadCollectionConfigurations().equals("")) {
    678             // Something went wrong downloading the collection configurations
    679             return;
    680         }
    681 
    682         CollectionManager.downloaded_collection_configurations = true;
    683         }
    684 
    685675        String collection_file_path = showOpenCollectionDialog();
    686676
     
    727717    public void run()
    728718    {
    729         // If using a remote Greenstone check if the collection configurations have been downloaded; do so if not
    730         if (Gatherer.isGsdlRemote && !CollectionManager.downloaded_collection_configurations) {
    731         if (RemoteGreenstoneServer.downloadCollectionConfigurations().equals("")) {
    732             // Something went wrong downloading the collection configurations
    733             return;
    734         }
    735 
    736         CollectionManager.downloaded_collection_configurations = true;
    737         }
    738 
    739719        // Create the collection details prompt from new collection prompt
    740720        NewCollectionDetailsPrompt ncd_prompt = new NewCollectionDetailsPrompt();
     
    763743    public void run()
    764744    {
    765         // If using a remote Greenstone check if the collection configurations have been downloaded; do so if not
    766         if (Gatherer.isGsdlRemote && !CollectionManager.downloaded_collection_configurations) {
    767         if (RemoteGreenstoneServer.downloadCollectionConfigurations().equals("")) {
    768             // Something went wrong downloading the collection configurations
    769             return;
    770         }
    771 
    772         CollectionManager.downloaded_collection_configurations = true;
    773         }
    774 
    775745        // The rest is handled by the DeleteCollectionPrompt
    776746        DeleteCollectionPrompt dc_prompt = new DeleteCollectionPrompt();
Note: See TracChangeset for help on using the changeset viewer.