Changeset 8634


Ignore:
Timestamp:
2004-11-23T15:16:59+13:00 (19 years ago)
Author:
mdewsnip
Message:

Changes to the library URL now affect the preview button immediately.

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

Legend:

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

    r8629 r8634  
    384384    tree.clearSelection();
    385385    tree.setSelectionPath(path);
    386 
    387     // Validate the preview button
    388     if (Gatherer.c_man.built() && Configuration.library_url != null) {
    389         preview_button.setEnabled(true);
    390         simple_preview_button.setEnabled(true);
    391     }
    392     else {
    393         preview_button.setEnabled(false);
    394         simple_preview_button.setEnabled(false);
    395     }
    396386    }
    397387
     
    524514    public void refresh(int refresh_reason, boolean ready)
    525515    {
    526     if(Gatherer.c_man == null || !ready) {
     516    if (Gatherer.c_man == null || !ready) {
    527517        return;
    528518    }
     
    552542    }
    553543    tree.valueChanged(null);
     544
     545    // Validate the preview button
     546    if (Gatherer.c_man.built() && Configuration.library_url != null) {
     547        preview_button.setEnabled(true);
     548        simple_preview_button.setEnabled(true);
     549    }
     550    else {
     551        preview_button.setEnabled(false);
     552        simple_preview_button.setEnabled(false);
     553    }
    554554    }
    555555
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r8606 r8634  
    444444    public void refresh(int refresh_reason, boolean ready)
    445445    {
     446//  if (refresh_reason == PREFERENCES_CHANGED) {
     447//      valueChanged((TreeSelectionEvent) null); // Refresh metadata table
     448//  }
     449
    446450    if (ready) {
    447451        // Update label
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r8588 r8634  
    109109
    110110    static public final int GUI_REFRESHED = 0;
     111    static public final int PREFERENCES_CHANGED = 1;
    111112
    112113
     
    241242    }
    242243
    243     // *****************
    244     // Metadata Options.
    245     // *****************
    246 //  else if (esrc == menu_bar.metadata_view) {
    247 //      showMetaAuditBox();
    248 //  }
    249 
    250244    // *************
    251245    // Help Options.
     
    522516    if (create_pane != null) {
    523517        create_pane.refresh(refresh_reason, ready);
     518    }
     519
     520    if (refresh_reason == PREFERENCES_CHANGED) {
     521        // Force both workspace and collection trees to redraw
     522        Gatherer.g_man.refreshWorkspaceTree(DragTree.TREE_DISPLAY_CHANGED);
     523        Gatherer.g_man.refreshCollectionTree(DragTree.TREE_DISPLAY_CHANGED);
    524524    }
    525525
  • trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java

    r8629 r8634  
    604604        this.close = close;
    605605    }
    606     public void actionPerformed(ActionEvent event) {
    607         // Submit the various changes
     606    public void actionPerformed(ActionEvent event)
     607    {
    608608        // Connection preferences
    609609        String program_str = program_field.getText();
    610         if(program_str.length() > 0 && program_str.indexOf("%1") == -1) {
     610        if (program_str.length() > 0 && program_str.indexOf("%1") == -1) {
    611611        program_str = program_str + " %1";
    612612        }
     
    633633        Configuration.setSiteAndServlet(new_site, (String)servlet_combobox.getSelectedItem());
    634634        }
    635        
     635
    636636        Configuration.set("general.use_proxy", true, use_proxy_checkbox.isSelected());
    637637        Configuration.setString("general.proxy_host", true, proxy_host_field.getText());
     
    641641        // General preferences
    642642        Configuration.setEmail(email_field.getText());
    643 
    644643        Configuration.set("general.show_file_size", Configuration.COLLECTION_SPECIFIC, show_file_size_checkbox.isSelected());
    645         // Force both workspace and collection trees to redraw
    646         if (Gatherer.g_man != null) {
    647         Gatherer.g_man.refreshWorkspaceTree(DragTree.TREE_DISPLAY_CHANGED);
    648         Gatherer.g_man.refreshCollectionTree(DragTree.TREE_DISPLAY_CHANGED);
    649         }
    650 
    651644        Configuration.set("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC, view_extracted_metadata_checkbox.isSelected());
    652         Gatherer.g_man.enrich_pane.valueChanged((TreeSelectionEvent) null); // Refresh metadata table
    653645
    654646        String current_lang = Configuration.getLanguage();
     
    664656        int current_mode = Configuration.getMode();
    665657        int new_mode;
    666         if(assistant_mode_radio_button.isSelected()) {
     658        if (assistant_mode_radio_button.isSelected()) {
    667659        new_mode = Configuration.ASSISTANT_MODE;
    668660        }
    669         else if(systems_mode_radio_button.isSelected()) {
     661        else if (systems_mode_radio_button.isSelected()) {
    670662        new_mode = Configuration.SYSTEMS_MODE;
    671663        }
    672         else if(expert_mode_radio_button.isSelected()) {
     664        else if (expert_mode_radio_button.isSelected()) {
    673665        new_mode = Configuration.EXPERT_MODE;
    674666        }
    675         else  {
     667        else {
    676668        new_mode = Configuration.LIBRARIAN_MODE;
    677669        }
     670
    678671        // If there has been a change in modes, update the config, and also inform the persistant gui views that have a need to know
    679         if(new_mode != current_mode) {
     672        if (new_mode != current_mode) {
    680673        Configuration.setMode(new_mode);
    681674        Collection collection = Gatherer.c_man.getCollection();
     
    713706        // Always save configuration changes immediately (in case the GLI crashes)
    714707        Configuration.save();
     708
     709        // Refresh the GLI to account for the configuration changes
     710        Gatherer.g_man.refresh(GUIManager.PREFERENCES_CHANGED, Gatherer.c_man.ready());
    715711
    716712        // Hide dialog
Note: See TracChangeset for help on using the changeset viewer.