Changeset 22103

Show
Ignore:
Timestamp:
18.05.2010 20:03:54 (9 years ago)
Author:
ak19
Message:

The Download Progress Pane used to say Download Complete almost immediately upon starting a download and while this was still in progress. This was a problem found with OAI download, but is now also fixed with the Web download mode. Tested with both.

Location:
main/trunk/gli/src/org/greenstone/gatherer/download
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java

    r20924 r22103  
    387387                // Add download 
    388388                String new_url = line.substring(line.indexOf("`") + 1, line.lastIndexOf("'")); 
    389                 //addDownload("http:/" + new_url); 
     389                progress.addDownload("file"); //addDownload("http:/" + new_url.substring(cachedir_prefix_length()-1));               
    390390            } 
    391391            } 
     
    415415            String new_url =  
    416416                line.substring(line.indexOf("`") + 1, line.lastIndexOf("'")); 
    417             //addDownload("http:/" + new_url); 
     417            progress.addDownload("file"); //addDownload("http:/" + new_url.substring(cachedir_prefix_length()-1)); 
    418418            downloadWarning(); 
    419419            } 
     
    435435            String total_ID = line.substring(line.indexOf(":") + 1, line.indexOf(">")); 
    436436            progress.setTotalDownload((Integer.valueOf(total_ID)).intValue()); 
    437             progress.resetFileCount(); 
     437            progress.resetFileCount();   
     438            progress.addDownload("files"); // for display: "Downloading files" 
    438439            } 
    439440            else if (line.lastIndexOf("<<Done>>") != -1) { 
     
    456457        if(state == STOPPED) { 
    457458        boolean terminatePerlScript = true; 
    458          
     459             
    459460        // When GLI is working with wget-based download modes other than OAI (MediaWiki and Web  
    460461        // download) and the STOP button has been pressed, wget needs to be prematurely terminated. 
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadProgressBar.java

    r13032 r22103  
    296296    }    
    297297 
    298     /** Once a mirroring task is complete, is the DownloadJob returns from the 
     298    /** Once a mirroring task is complete, if the DownloadJob returns from the 
    299299     * native call but the status is still running, then this method 
    300      * is called to once again tinker with the pritty visual  
     300     * is called to once again tinker with the pretty visual  
    301301     * components. 
    302302     */ 
     
    309309    progress.setValue(progress.getMaximum()); 
    310310    progress.setString(Dictionary.get("Mirroring.DownloadJob.Download_Complete")); 
     311    current_status.setText(Dictionary.get("Mirroring.DownloadJob.Download_Complete"));  
     312        // will display "Download Complete" once an OAI download session has finished running 
    311313 
    312314    stop_start_button.setEnabled(false); 
     
    315317 
    316318    /** When called this method updates the DownloadProgressBar to reflect 
    317      * the ammount of the current file downloaded. 
     319     * the amount of the current file downloaded. 
    318320     */ 
    319321    public void updateProgress(long current, long expected) { 
     
    378380    } 
    379381    else { 
    380         current_status.setText(Dictionary.get("Mirroring.DownloadJob.Download_Complete")); 
     382        current_status.setText(Dictionary.get("Mirroring.DownloadJob.Download_Complete")); 
    381383    } 
    382384