Changeset 13453


Ignore:
Timestamp:
2006-12-07T15:51:00+13:00 (17 years ago)
Author:
shaoqun
Message:

fixed bugs that the collection icons didn't get updated after changes have been made

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r12748 r13453  
    9292    implements Control {
    9393
    94     //private boolean has_been_warned = false;
    95     private boolean ready = false;
     94        private boolean ready = false;
    9695    private CollectionMeta collection_extra_collectionmeta;
    9796    private CollectionMeta collection_name_collectionmeta;
     
    264263    /** Called to refresh the components. */
    265264    public void gainFocus() {
    266         // Retrieve all of the elements that are dependant on default language.
     265             // Retrieve all of the elements that are dependant on default language.
    267266        collection_extra_collectionmeta = CollectionDesignManager.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONEXTRA_STR);
    268267        collection_name_collectionmeta = CollectionDesignManager.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR);
     
    286285        small_icon_textfield.setCaretPosition(0);
    287286        public_checkbox.setSelected(public_collectionmeta.getValue(CollectionMeta.TEXT).equals(StaticStrings.TRUE_STR));
    288         ready = true;
     287            ready = true;
    289288    }
    290289
     
    292291    public void loseFocus() {
    293292        // String values. Have to test if this component has actually ever recieved focus anyway.
    294         if(ready) {
    295         // Boolean values
    296         public_collectionmeta.setValue((public_checkbox.isSelected() ? StaticStrings.TRUE_STR : StaticStrings.FALSE_STR));
    297         String creator_email_str = creator_emailfield.getText();
    298         creator_collectionmeta.setValue(creator_email_str);
     293       
     294            if (!ready) return;
     295
     296        public_collectionmeta.setValue((public_checkbox.isSelected() ? StaticStrings.TRUE_STR : StaticStrings.FALSE_STR));
     297        String creator_email_str = creator_emailfield.getText();
     298        creator_collectionmeta.setValue(creator_email_str);
    299299        // If the email is currently empty, store this email
    300         if(Configuration.getEmail() == null) {
    301             Configuration.setEmail(creator_email_str); // Store the email address in the configuration
    302         }
    303         collection_extra_collectionmeta.setValue(description_textarea.getText());
    304         icon_collection_collectionmeta.setValue(icon_textfield.getText());
    305         maintainer_collectionmeta.setValue(maintainer_emailfield.getText());
    306         icon_collection_small_collectionmeta.setValue(small_icon_textfield.getText());
    307         collection_name_collectionmeta.setValue(name_textfield.getText());
    308         ready = false;
    309         }
    310 
    311     }
     300        if(Configuration.getEmail() == null) {
     301        Configuration.setEmail(creator_email_str); // Store the email address in the configuration
     302        }
     303        collection_extra_collectionmeta.setValue(description_textarea.getText());
     304        icon_collection_collectionmeta.setValue(icon_textfield.getText());
     305        maintainer_collectionmeta.setValue(maintainer_emailfield.getText());
     306        icon_collection_small_collectionmeta.setValue(small_icon_textfield.getText());
     307        collection_name_collectionmeta.setValue(name_textfield.getText());
     308     
     309   
     310    }
    312311
    313312    /** Listens for a click on either browse button, and when detected opens a file browser window initially pointed at the images folder of the collection. Once a user has selected a path, does it's best to construct the best address to the resource, such as _httpcollection_/images/about.gif */
     
    364363            if(event.getSource() == browse_about_icon_button) {
    365364            icon_textfield.setText(path);
     365                        icon_collection_collectionmeta.setValue(icon_textfield.getText());
    366366            }
    367367            else {
    368368            small_icon_textfield.setText(path);
     369                        icon_collection_small_collectionmeta.setValue(small_icon_textfield.getText());
    369370            }
    370371            path = null;
     
    416417        String collection_name = Gatherer.c_man.getCollection().getName();
    417418        Gatherer.g_man.setTitle(collection_title, collection_name);
     419                collection_name_collectionmeta.setValue(name_textfield.getText());
    418420        collection_title = null;
    419421        collection_name = null;
Note: See TracChangeset for help on using the changeset viewer.