Changeset 4392


Ignore:
Timestamp:
2003-05-28T13:46:54+12:00 (21 years ago)
Author:
jmt12
Message:

Now close collection actually closes collection (after yesterdays save prompt fix) and new collection can also be cancelled without the current open collection being prematurely closed.

File:
1 edited

Legend:

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

    r4381 r4392  
    187187        else if(esrc == menu_bar.file_new) {
    188188        if(!Gatherer.c_man.saved()) {
    189         cont = showSaveCollectionBox(true, false);
     189        cont = showSaveCollectionBox(false, false);
    190190        }
    191191        if(cont) {
    192         try {
    193             while(Gatherer.c_man.ready()) {
    194             wait(10);
    195             }
    196         }
    197         catch(Exception error) {
    198         }
    199192        showNewCollectionPrompt();
    200193        }
     
    202195    else if(esrc == menu_bar.file_open) {
    203196        if(!Gatherer.c_man.saved()) {
    204         cont = showSaveCollectionBox(true, false);
     197        cont = showSaveCollectionBox(false, false);
    205198        }
    206199        if(cont) {
     
    666659    // Create the new collection (if not cancelled) in a new thread.
    667660    if(!ncd_prompt.isCancelled() && (ncm_prompt == null || !ncm_prompt.isCancelled())) {
    668                 // Create new collection.
     661        // If there is already a collection open, close it.
     662        if(Gatherer.c_man.ready()) {
     663        Gatherer.c_man.closeCollection();
     664        // Wait until it is closed.
     665        try {
     666            while(Gatherer.c_man.ready()) {
     667            wait(10);
     668            }
     669        }
     670        catch(Exception error) {
     671        }
     672        }
     673        // Create new collection.
    669674        CreationTask task = new CreationTask(ncd_prompt, ncm_prompt);
    670675        SwingUtilities.invokeLater(task);
    671                 // Close prompt.
     676        // Close prompt.
    672677    }
    673678    // Done
     
    714719    //switch(result) {
    715720    //case SaveCollectionBox.SAVE_YES:
    716     Gatherer.c_man.saveCollection(false, exit_after);
     721    Gatherer.c_man.saveCollection(close_after, exit_after);
    717722    //content_pane.paintImmediately(bounds);
    718723    return true; 
Note: See TracChangeset for help on using the changeset viewer.