- Timestamp:
- 2017-06-02T17:14:00+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java
r31692 r31720 75 75 76 76 private final String download_url; 77 77 private boolean wasClosed = false; 78 78 79 // private String current_url; 79 80 // private String destination; … … 212 213 if (getState() == RUNNING) { 213 214 //setState(STOPPED); 214 stopDownload(); // cancels any running SafeProcess 215 stopDownload(); // cancels any running SafeProcess 215 216 } else { 216 217 //previous_state = getState(); … … 220 221 } 221 222 else if (event.getSource() == progress.close_button) { 223 setClosed(); 222 224 SafeProcess.log("@@@ Progress bar close button pressed"); 223 225 if(getState() == RUNNING) { 224 226 previous_state = getState(); 225 227 //setState(STOPPED); // do we need to do anything else to stop this? YES, we do: 226 stopDownload(); // cancels any running SafeProcess 227 } 228 stopDownload(); // cancels any running SafeProcess 229 } 228 230 mummy.deleteDownloadJob(this); 229 231 } … … 798 800 // if the cancel button was clicked when it had already naturally terminated 799 801 802 // If the user had pressed the Close button to terminate the running job, then 800 803 // we're now ready to remove the display of the until now running job 801 804 // from the download progress bar interface 802 mummy.deleteCurrentDownloadJob(this); 805 // But don't bother removing the progress bar if the user had only pressed the Stop button 806 if(wasClosed()) { 807 mummy.deleteCurrentDownloadJob(this); 808 } 803 809 } /*else { 804 810 // If we've got to here and the state isn't STOPPED then the … … 962 968 return state; 963 969 } 970 971 /** @return true if the close button of the DownloadProgressBar was pressed, 972 * false otherwise such as if the Stop button had been pressed. 973 */ 974 private synchronized boolean wasClosed() { 975 return this.wasClosed; 976 } 964 977 965 978 /** Returns the current state of the stop flag for this job. … … 978 991 previous_state = this.state; 979 992 this.state = state; 993 } 994 995 private synchronized void setClosed() { 996 this.wasClosed = true; 980 997 } 981 998
Note:
See TracChangeset
for help on using the changeset viewer.