Changeset 4571


Ignore:
Timestamp:
2003-06-11T15:21:31+12:00 (21 years ago)
Author:
mdewsnip
Message:

Removed ProgressMonitor, which for some reason was locking up when saving collections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/SaveCollectionTask.java

    r4366 r4571  
    110110    Gatherer.g_man.wait(true);
    111111    // Create progress monitor box. It will display itself as necessary.
    112     ProgressMonitor spd = new ProgressMonitor(Gatherer.g_man, Gatherer.dictionary.get("SaveProgressDialog.Title", collection.getName()), null, 0, 100);
    113     spd.setMillisToDecideToPopup(100);
    114     spd.setMillisToPopup(100);
     112    // WARNING: ProgressMonitors seem to be extremely dodgy, and are not recommended!
     113    // ProgressMonitor spd = new ProgressMonitor(Gatherer.g_man, Gatherer.dictionary.get("SaveProgressDialog.Title", collection.getName()), null, 0, 100);
     114    // spd.setMillisToDecideToPopup(100);
     115    // spd.setMillisToPopup(100);
    115116    // 0. Force all remaining metadata.xml files to load.
    116117    // 1. Perform a regular collection save on what we will later refer to as the origin collection.
     
    120121    args[0] = collection.getName() + ".col";
    121122    try {
    122                 // Block until all of the metadata files have been read in.
     123        // Block until all of the metadata files have been read in.
    123124        collection.gdm.waitUntilComplete();
    124                 // Write out the metadata xml files. The destroy below is meant to do this, but never does.
     125        // Write out the metadata xml files. The destroy below is meant to do this, but never does.
    125126        collection.gdm.save();
    126                
    127         spd.setProgress(getValue(METADATA_XML_SAVED));
     127        // spd.setProgress(getValue(METADATA_XML_SAVED));
     128
    128129        File file = new File(tmp_loc);
    129                 // Create backup
     130        // Create backup
    130131        if(file.exists()) {
    131132        File backup = new File(tmp_loc + "~");
     
    135136        }
    136137        }
    137                 // Carry on.
     138
     139        // Carry on.
    138140        collection.save();
    139         spd.setProgress(getValue(COLLECTION_SAVED));
    140                 // Write out the collection configuration file.
     141        // spd.setProgress(getValue(COLLECTION_SAVED));
     142
     143        // Write out the collection configuration file.
    141144        Gatherer.g_man.config_pane.saveConfiguration();
    142         spd.setProgress(getValue(COLLECTION_CFG_SAVED));
    143                 // Write out the metadata files.
     145        // spd.setProgress(getValue(COLLECTION_CFG_SAVED));
     146
     147        // Write out the metadata files.
    144148        Gatherer.c_man.msm.save();
    145         spd.setProgress(getValue(METADATA_SAVED));
    146                 // Clean-up
    147         spd.setProgress(100);
    148                 ///atherer.g_man.collectionChanged(Gatherer.c_man.ready());
     149        // spd.setProgress(getValue(METADATA_SAVED));
     150
    149151        collection.setSaved(true);
    150152    }
     
    157159                ///ystem.err.println("2. Make copy.");
    158160        Gatherer.c_man.createCollection(null, null, name, null, null, null);
    159         spd.setProgress(getValue(MAKE_COLLECTION));
     161        // spd.setProgress(getValue(MAKE_COLLECTION));
    160162                // 3. Copy files from the origin to the copied collections (except special collection files ending with ~).
    161163                // As part of this we must rename origin.col to copy.col
     
    202204        file = null;
    203205        }
    204         spd.setProgress(getValue(COPY_COLLECTION));
     206        // spd.setProgress(getValue(COPY_COLLECTION));
    205207                // 4. Restore origin collection by undoing file copy actions and removing the ~ from the end of collection files.
    206208                ///ystem.err.println("4. Restore origin.");
     
    230232        }
    231233                ///ystem.err.println(" - Restore *~ complete.");
    232         spd.setProgress(getValue(RESTORE_COLLECTION));
     234        // spd.setProgress(getValue(RESTORE_COLLECTION));
    233235                // 5. Close the origin collection.
    234236                ///ystem.err.println("5. Close origin.");
    235237        collection.setSaved(true);
    236238        Gatherer.c_man.closeCollection();
    237         spd.setProgress(getValue(CLOSE_COLLECTION));
     239        // spd.setProgress(getValue(CLOSE_COLLECTION));
    238240                // 6. Open the copied collection.   
    239241                ///ystem.err.println("6. Open copy.");
    240242        Gatherer.c_man.loadCollection(copied_dir.getAbsolutePath() + File.separator + name + ".col");
    241         spd.setProgress(getValue(OPEN_COLLECTION));
     243        // spd.setProgress(getValue(OPEN_COLLECTION));
    242244        copied_dir = null;
    243245    }
    244     spd.close();
    245     spd = null;
     246    // spd.close();
     247    // spd = null;
    246248    tmp_loc = null;
    247249    args = null;
Note: See TracChangeset for help on using the changeset viewer.