Changeset 19718


Ignore:
Timestamp:
2009-06-02T12:01:25+12:00 (15 years ago)
Author:
oranfry
Message:

applied changes relating to incremental building to the other two modes (only expert mode got the changes originally)

File:
1 edited

Legend:

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

    r19404 r19718  
    764764     */
    765765    public void actionPerformed(ActionEvent event) {
    766         Collection collection = Gatherer.c_man.getCollection();
    767         String collection_name = collection.getName();
    768 
    769         //set a static variable marking whether this is a "Complete" or "Minimal" build
    770         CollectionDesignManager.setCompleteBuild( full_build_radio_button.isSelected() );
    771 
    772         //prepareForBuild();
    773         if(!collection.getMetadataChanged() && !collection.getFilesChanged()) {
    774             //Only design options have changes, and we want to be smart in the way we handle them.
    775             int rebuildTypeRequired = CollectionDesignManager.getRebuildTypeRequired();
    776             if (rebuildTypeRequired == CollectionDesignManager.BUILDCOL) {
    777             // Just run the buildcol command.
    778             DebugStream.println("Just want to run buildcol.pl");
    779             prepareForBuild();
    780             Gatherer.c_man.buildCollection();
    781             }
    782             else if (rebuildTypeRequired == CollectionDesignManager.ALL) {
    783             // Do both import and buildcol
    784             DebugStream.println("Want to do a complete build");
     766        Collection collection = Gatherer.c_man.getCollection();
     767        String collection_name = collection.getName();
     768
     769        //set a static variable marking whether this is a "Complete" or "Minimal" build
     770        CollectionDesignManager.setCompleteBuild( full_build_radio_button.isSelected() );
     771
     772        //do the import and build, skipping import if possible
     773        if( !CollectionDesignManager.isCompleteBuild() &&
     774            !collection.getMetadataChanged() && !collection.getFilesChanged() && Gatherer.c_man.imported() &&
     775            CollectionDesignManager.getRebuildTypeRequired() <= CollectionDesignManager.BUILDCOL
     776            ) {
     777                // Just do build (no import)
     778                DebugStream.println("Just want to run buildcol.pl");
     779                prepareForBuild();
     780                Gatherer.c_man.buildCollection();
     781        }
     782        else {
    785783            prepareForBuild();
    786784            Gatherer.c_man.importCollection(); //This starts the building process.
    787             }
    788             else {
    789             //Nothing at all needs doing.
    790             //This is bad HCI. Maybe should disable the build button in this situation?
    791             JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CreatePane.Minimal_Build_Not_Required"));
    792             }
    793         }
    794         else {
    795             //Do a complete build.
    796             prepareForBuild();
    797             Gatherer.c_man.importCollection(); //This starts the building process.
    798785        }
    799786       
    800         //Re-setting the rebuildTypeRequired is handled by CollectionManager.processComplete(GShellEvent)
     787        //Re-setting the rebuildTypeRequired is handled by CollectionManager.processComplete(GShellEvent)
    801788    }
    802789
Note: See TracChangeset for help on using the changeset viewer.