Changeset 5302


Ignore:
Timestamp:
2003-08-27T15:14:13+12:00 (21 years ago)
Author:
jmt12
Message:

Fixed 203B112 - similar open collection dialog

Location:
trunk/gli/src/org/greenstone/gatherer/gui
Files:
2 edited

Legend:

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

    r5157 r5302  
    6868import org.greenstone.gatherer.gui.Preferences;
    6969import org.greenstone.gatherer.gui.PreviewPane;
     70import org.greenstone.gatherer.gui.SimpleOpenCollectionDialog;
    7071import org.greenstone.gatherer.gui.messages.MessagePane;
    7172import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame;
     
    417418
    418419        if(Gatherer.config.get("workflow.mirror", true)) {
    419         mirror_pane = new MirrorPane(workspace_tree_sync);
    420         mirror_pane.display();
     420        mirror_pane = new MirrorPane();
    421421        tab_pane.addTab(get("Mirroring"), Utility.getImage("mirroring.gif"), mirror_pane);
    422422        tab_pane.setEnabledAt(tab_pane.indexOfComponent(mirror_pane), Gatherer.config.get("workflow.mirror", false));
     
    590590    public boolean showLoadCollectionBox() {
    591591    boolean result = false;
    592     //LoadCollectionBox load_collection_box = new LoadCollectionBox();
    593     File file;
    594     if(Gatherer.config.gsdl_path != null) {
    595         file = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path));
    596     }
    597     else {
    598         file = new File(Utility.BASE_DIR);
    599     }
    600     OpenCollectionDialog chooser = new OpenCollectionDialog(file);
    601     String filename = chooser.getFileName();
     592    // We first try the simple open collection dialog
     593    SimpleOpenCollectionDialog dialog = new SimpleOpenCollectionDialog();
     594    int user_choice = dialog.display();
     595    String filename = null;
     596    // The user may choose to go to the advanced 'browse' dialog
     597    if(user_choice == SimpleOpenCollectionDialog.OK_OPTION) {
     598        filename = dialog.getFileName();
     599    }
     600    else if(user_choice == SimpleOpenCollectionDialog.BROWSE_OPTION) {
     601        File file;
     602        if(Gatherer.config.gsdl_path != null) {
     603        file = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path));
     604        }
     605        else {
     606        file = new File(Utility.BASE_DIR);
     607        }
     608        OpenCollectionDialog chooser = new OpenCollectionDialog(file);
     609        file = null;
     610        filename = chooser.getFileName();
     611        chooser.destroy();
     612        chooser = null;
     613    }
     614    dialog.destroy();
     615    dialog = null;
    602616    // User can cancel action.
    603617    if(filename != null) {
     
    619633        }
    620634        result = Gatherer.c_man.loadCollection(filename);
     635        filename = null;
    621636    }
    622637    return result;
  • trunk/gli/src/org/greenstone/gatherer/gui/OpenCollectionDialog.java

    r5164 r5302  
    8282    }
    8383
     84    public void destroy() {
     85    }
     86
    8487    public String getFileName() {
    8588    // Continually loop until the use chooses an appropriate file or cancels.
Note: See TracChangeset for help on using the changeset viewer.