Changeset 11086


Ignore:
Timestamp:
2006-01-23T16:19:48+13:00 (18 years ago)
Author:
mdewsnip
Message:

Added cyclic loop checking and made the Stop button work.

File:
1 edited

Legend:

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

    r11085 r11086  
    159159    public void cancelAction() {
    160160    cancel_action = true;
     161    clearJobs();
    161162    }
    162163
     
    267268    File target_directory = new File(target_node.getFile(), source_directory.getName());
    268269
     270    // Check that the source directory doesn't contain the target directory (will create a cyclic loop)
     271    if (target_directory.getAbsolutePath().startsWith(source_directory.getAbsolutePath())) {
     272        if (showErrorDialog(Dictionary.get("FileActions.Cyclic_Path", source_directory.getName())) == JOptionPane.CANCEL_OPTION) {
     273        clearJobs();  // Aborting action
     274        }
     275        return;
     276    }
     277
    269278    // The target directory shouldn't already exist
    270279    if (target_directory.exists()) {
     
    650659            progress.setString(Dictionary.get("FileActions.No_Activity"));
    651660
    652             // Reset "yes to all"
     661            // Reset "yes to all" and "cancel" flags
    653662            yes_to_all = false;
     663            cancel_action = false;
    654664
    655665            // Wait for a new file job
Note: See TracChangeset for help on using the changeset viewer.