Changeset 11049 for trunk/gli


Ignore:
Timestamp:
2006-01-17T11:03:16+13:00 (18 years ago)
Author:
mdewsnip
Message:

A few minor tidy-ups of dead code.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
3 edited

Legend:

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

    r10643 r11049  
    212212    }
    213213
    214     //if(gsdlsite_cfg_file.getURL() != null) {
    215     //JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("Server.QuitManual"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    216     //}
    217 
    218214    // Restore the gsdlsite_cfg.
    219215    gsdlsite_cfg_file.restore();
     
    221217    // If the local server is still running then our changed values will get overwritten.
    222218    if (gsdlsite_cfg_file.getURL() != null) {
    223         JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("Server.QuitFailed"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
     219        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("Server.QuitManual"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    224220    }
    225221
  • trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r11048 r11049  
    469469            // If the file isn't in the images folder, then ask the user if they want to copy it there
    470470            File file = file_chooser.getSelectedFile();
    471             if(!file.getParentFile().equals(images_folder)) {
    472             if(true) { //JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("CDM.General.Copy_Image"), Dictionary.get("General.Warning"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
    473                 // Copy the file
    474                 try {
    475                 File collection_image_file = new File(images_folder, file.getName());
    476                 Gatherer.f_man.getQueue().copyFile(file, collection_image_file, null);
    477 
    478                 // If we're using a remote Greenstone server, upload the image
    479                 if (Gatherer.isGsdlRemote) {
    480                     RemoteGreenstoneServer.uploadCollectionFile(Gatherer.c_man.getCollection().getName(), collection_image_file);
    481                 }
    482                 }
    483                 catch(Exception exception) {
    484                 DebugStream.printStackTrace(exception);
    485                 // Show warning
    486                 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.General.Image_Copy_Failed"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
    487                 // Nothing else we can do.
    488                 return;
     471            if (!file.getParentFile().equals(images_folder)) {
     472            // Copy the file
     473            try {
     474                File collection_image_file = new File(images_folder, file.getName());
     475                Gatherer.f_man.getQueue().copyFile(file, collection_image_file, null);
     476
     477                // If we're using a remote Greenstone server, upload the image
     478                if (Gatherer.isGsdlRemote) {
     479                RemoteGreenstoneServer.uploadCollectionFile(Gatherer.c_man.getCollection().getName(), collection_image_file);
    489480                }
    490481            }
    491             else {
    492                 // Nothing we can safely do
     482            catch(Exception exception) {
     483                DebugStream.printStackTrace(exception);
     484                // Show warning
     485                JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.General.Image_Copy_Failed"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
     486                // Nothing else we can do.
    493487                return;
    494488            }
    495489            }
     490
    496491            // Create the path starting _httpcollection_/images/<filename>
    497492            String path = prefix + file.getName();
  • trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java

    r10689 r11049  
    409409                    new_node = directory_record;
    410410                    }
    411                     // Else inform the users that a directory already exists and files will be copied into it
    412                     //else {
    413                     //    JOptionPane.showMessageDialog(null, Dictionary.get("FileActions.Directory_Exists", target_file.toString()), Dictionary.get("General.Warning"), JOptionPane.WARNING_MESSAGE);
    414                     //}
     411
    415412                    // Queue non-filtered child files for copying. If this directory already existed, the child records will have to generate the undo jobs, as we don't want to entirely delete this directory if it already existed.
    416413                    FileNode child_record = null;
Note: See TracChangeset for help on using the changeset viewer.