Changeset 18221

Show
Ignore:
Timestamp:
16.12.2008 18:12:21 (10 years ago)
Author:
ak19
Message:

Fixed a bug I had introduced which closed the download panel even when the download terminated naturally. A download's display panel is only removed when its prematurely terminated, not when it ends naturally (at which point the user can manually close this).

Files:
1 modified

Legend:

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

    r17838 r18221  
    9393        }        
    9494    } 
    95     // Get rid of this download's dedicated pane 
    96     finishedDownloadJob(delete_me); 
     95    // Close button pressed, get rid of this download's dedicated pane 
     96    finishedDownloadJob(delete_me, true); 
    9797    } 
    9898 
    9999    /** To be called when a download job has terminated naturally or was prematurely stopped 
    100      *  via the close button. Gets rid of this download's pane with buttons and progress bar. */ 
    101     protected void finishedDownloadJob(DownloadJob delete_me) { 
     100     *  via the close button.  
     101     *  Gets rid of this download's pane with buttons and progress bar if prematurely stopped. */ 
     102    protected void finishedDownloadJob(DownloadJob delete_me, boolean removeDisplay) { 
    102103    if (delete_me.hasSignalledStop()) { 
    103         list_pane.remove(delete_me.getProgressBar()); 
     104        if(removeDisplay) { 
     105        list_pane.remove(delete_me.getProgressBar()); 
     106        list_pane.remove(filler_pane); 
     107        } 
    104108        job_queue.remove(delete_me); 
    105         list_pane.remove(filler_pane); 
    106109        if(job_queue.size() > 0) { 
    107110        Dimension progress_bar_size = delete_me.getProgressBar().getPreferredSize(); 
     
    211214            System.err.println("DownloadJob " + job.port + " " + job.toString() + " Begun."); 
    212215            job.callDownload(); 
    213             finishedDownloadJob(delete_me); // Job is done, get rid of the separate display panel for this download 
     216            // Job is done. Ended naturally, don't get rid of this download's separate display panel 
     217            finishedDownloadJob(delete_me, false);  
    214218            System.err.println("DownloadJob " + jobDisplayString + " complete."); 
    215219            DebugStream.println("DownloadJob " + jobDisplayString + " complete."); // by this point job is null!