Changeset 11700


Ignore:
Timestamp:
2006-04-26T13:12:27+12:00 (18 years ago)
Author:
kjdon
Message:

Michael's changes regarding deleting files form downloaded files, added to the branch

Location:
branches/gsdl-2_70-distribution-branch/gli/src/org/greenstone/gatherer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/gsdl-2_70-distribution-branch/gli/src/org/greenstone/gatherer/file/FileManager.java

    r11440 r11700  
    111111        // Is this the "Downloaded Files" folder?
    112112        if (source_nodes[i].getFile().getAbsolutePath().startsWith(downloaded_files_folder_path)) {
    113             // Can only delete from the "Downloaded Files" folder if a collection is open
    114             if (Gatherer.c_man.ready() == false) {
    115             return;
    116             }
    117113            read_only_source = false;
    118114        }
  • branches/gsdl-2_70-distribution-branch/gli/src/org/greenstone/gatherer/file/FileQueue.java

    r11388 r11700  
    372372    File source_file = source_node.getFile();
    373373
    374     // If we're deleting a metadata.xml file we must unload it
    375     boolean metadata_xml_file = source_file.getName().equals(StaticStrings.METADATA_XML);
    376     if (metadata_xml_file) {
    377         MetadataXMLFileManager.unloadMetadataXMLFile(source_file);
    378     }
    379     // Otherwise remove any metadata assigned directly to the file
    380     else {
    381         ArrayList assigned_metadata = MetadataXMLFileManager.getMetadataAssignedDirectlyToFile(source_file);
    382         MetadataXMLFileManager.removeMetadata((CollectionTreeNode) source_node, assigned_metadata);
     374    // Almost all files will be deleted from the collection tree (exception: files in "Downloaded Files")
     375    if (source_node instanceof CollectionTreeNode) {
     376        // If we're deleting a metadata.xml file we must unload it
     377        boolean metadata_xml_file = source_file.getName().equals(StaticStrings.METADATA_XML);
     378        if (metadata_xml_file) {
     379        MetadataXMLFileManager.unloadMetadataXMLFile(source_file);
     380        }
     381        // Otherwise remove any metadata assigned directly to the file
     382        else {
     383        ArrayList assigned_metadata = MetadataXMLFileManager.getMetadataAssignedDirectlyToFile(source_file);
     384        MetadataXMLFileManager.removeMetadata((CollectionTreeNode) source_node, assigned_metadata);
     385        }
    383386    }
    384387
     
    698701        synchronized(this) {
    699702            // Force both workspace and collection trees to refresh
    700             if (Gatherer.g_man != null) {
     703            if (Gatherer.g_man != null && Gatherer.c_man.ready()) {
    701704            Gatherer.g_man.refreshWorkspaceTree(DragTree.COLLECTION_CONTENTS_CHANGED);
    702705            // Gatherer.g_man.refreshCollectionTree(DragTree.COLLECTION_CONTENTS_CHANGED);
  • branches/gsdl-2_70-distribution-branch/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r11446 r11700  
    299299    bin_button = new RecycleBin();
    300300    bin_button.addActionListener(this);
    301     bin_button.setEnabled(false);
    302301    bin_button.setMinimumSize(MIN_SIZE);
    303302    bin_button.setPreferredSize(MIN_SIZE);
     
    443442    collection_tree.setEnabled(collection_loaded);
    444443    collection_filter.setEnabled(collection_loaded);
    445     bin_button.setEnabled(collection_loaded);
    446444    new_folder.setEnabled(collection_loaded);
    447445
Note: See TracChangeset for help on using the changeset viewer.