Changeset 7647


Ignore:
Timestamp:
2004-06-25T17:26:12+12:00 (20 years ago)
Author:
mdewsnip
Message:

Special case: you can now delete files from the "Downloaded Files" folder.

File:
1 edited

Legend:

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

    r7608 r7647  
    4949import org.greenstone.gatherer.util.DragComponent;
    5050import org.greenstone.gatherer.util.SynchronizedTreeModelTools;
     51import org.greenstone.gatherer.util.Utility;
    5152
    5253/** Manages the moving of files within a separate thread.
     
    8990        if(target instanceof UndoManager) {
    9091        // If the source is the workspace then display an error message. Workspace is read only.
    91         if(source.toString().equals("Workspace")) {
     92
     93        // ...except for files from the "Downloaded Files" folder
     94        boolean from_downloaded_files_folder = false;
     95        if (source_nodes != null) {
     96            for (int i = 0; i < source_nodes.length; i++) {
     97            if (source_nodes[i].getFile() != null) {
     98                if (source_nodes[i].getFile().getAbsolutePath().startsWith(Utility.getCacheDir().getAbsolutePath())) {
     99                from_downloaded_files_folder = true;
     100                }
     101            }
     102            }
     103        }
     104
     105        if (source.toString().equals("Workspace") && !from_downloaded_files_folder) {
    92106            JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("FileActions.Read_Only"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    93107            return;
Note: See TracChangeset for help on using the changeset viewer.