Changeset 5985


Ignore:
Timestamp:
2003-11-25T16:14:21+13:00 (20 years ago)
Author:
jmt12
Message:

Corrected some code so that certain visual components, such as the PreviewPane, are not created unless activated in the config.xml. This may cause problems with server configuration commands, until we are able to move said commands somewhere else

File:
1 edited

Legend:

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

    r5891 r5985  
    6868import org.greenstone.gatherer.gui.OpenCollectionDialog;
    6969import org.greenstone.gatherer.gui.Preferences;
    70 //import org.greenstone.gatherer.gui.PreviewPane;
     70import org.greenstone.gatherer.gui.PreviewPane;
    7171import org.greenstone.gatherer.gui.SimpleOpenCollectionDialog;
    7272import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame;
     
    105105    public MirrorPane mirror_pane = null;
    106106    /** The preview pane contains a preview of your build collection. */
    107     /** not used anymore */
    108     //public PreviewPane preview_pane = null;
     107    public PreviewPane preview_pane = null;
    109108    /** Are certain panes currently locked? */
    110109    private boolean locked = false;
     
    363362
    364363    if(!locked) {
    365                 // Now enable tabs as necessary. Do this on event queue to prevent crazy NPEs
     364        // Now enable tabs as necessary. Do this on event queue to prevent crazy NPEs
    366365        if(tab_updater == null) {
    367366        tab_updater = new TabUpdater(tab_pane, ready);
     
    414413
    415414        // May have to play with the order in which tabs are added.
    416         browser_pane = new BrowsingPane();
    417415        if(Gatherer.config.get("workflow.browse", true)) {
     416        browser_pane = new BrowsingPane();
    418417        tab_pane.addTab("GUI.Hunt", Utility.getImage("browsing.gif"), browser_pane);
    419418        tab_pane.setEnabledAt(tab_pane.indexOfComponent(browser_pane), Gatherer.config.get("workflow.browse", false));
    420419        }
    421420
    422         mirror_pane = new MirrorPane();
    423421        if(Gatherer.config.get("workflow.mirror", true)) {
     422        mirror_pane = new MirrorPane();
    424423        tab_pane.addTab("GUI.Mirror", Utility.getImage("mirroring.gif"), mirror_pane);
    425424        tab_pane.setEnabledAt(tab_pane.indexOfComponent(mirror_pane), Gatherer.config.get("workflow.mirror", false));
     
    459458        }
    460459
    461 //          preview_pane = new PreviewPane();
    462 //          preview_pane.display();
    463 //          if(Gatherer.config.get("workflow.preview", true)) {
    464 //          tab_pane.addTab("GUI.Preview", Utility.getImage("final.gif"), preview_pane);
    465 //          tab_pane.setEnabledAt(tab_pane.indexOfComponent(preview_pane), false);
    466 //          }
     460        if(Gatherer.config.get("workflow.preview", true)) {
     461        preview_pane = new PreviewPane();
     462        preview_pane.display();         
     463        tab_pane.addTab("GUI.Preview", Utility.getImage("final.gif"), preview_pane);
     464        tab_pane.setEnabledAt(tab_pane.indexOfComponent(preview_pane), false);
     465        }
    467466
    468467        // Find the first tab that is enabled and select that.
     
    557556        // Some tabs are also dependant on if a collection is ready
    558557        Component component = tab_pane.getComponentAt(index);
    559 //          if(component == preview_pane) {
    560 //          tab_pane.setEnabledAt(index, state && Gatherer.c_man != null && Gatherer.c_man.ready() && Gatherer.c_man.built());
    561 //          }
    562 //          else
    563         if(component == metaedit_pane || component == config_pane || component == export_pane || component == create_pane) {
     558        if(component == preview_pane) {
     559        tab_pane.setEnabledAt(index, state && Gatherer.c_man != null && Gatherer.c_man.ready() && Gatherer.c_man.built());
     560        }
     561        else if(component == metaedit_pane || component == config_pane || component == export_pane || component == create_pane) {
    564562        tab_pane.setEnabledAt(index, state && Gatherer.c_man != null && Gatherer.c_man.ready());
    565563        }
     
    795793        create_pane.gainFocus();
    796794    }
    797 //      else if(tab_pane.getSelectedIndex() == tab_pane.indexOfComponent(preview_pane)) {
    798 //          config_pane.saveConfiguration();
    799 //          preview_pane.gainFocus();
    800 //      }
     795    else if(tab_pane.getSelectedIndex() == tab_pane.indexOfComponent(preview_pane)) {
     796        config_pane.saveConfiguration();
     797        preview_pane.gainFocus();
     798    }
    801799
    802800    previous_pane = (JPanel) tab_pane.getSelectedComponent();
Note: See TracChangeset for help on using the changeset viewer.