Changeset 12808


Ignore:
Timestamp:
2006-09-21T15:24:25+12:00 (18 years ago)
Author:
mdewsnip
Message:

Removed CollectionManager.configurationChanged() and all 50 calls to it. The CollectionConfiguration class now works out itself whether it needs to be changed or not -- a far more reliable approach.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
15 edited

Legend:

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

    r12798 r12808  
    112112        Node target_node = CollectionConfiguration.findInsertionPoint(element);
    113113        add(root, classifier, target_node);
    114         Gatherer.c_man.configurationChanged();
    115114    }
    116115    }
     
    230229    }
    231230   
    232     Gatherer.c_man.configurationChanged();
    233231    // tell the format manager to update the names of its format statements
    234232    Gatherer.c_man.getCollection().cdm.format_manager.refresh();
     
    241239    private void removeClassifier(Classifier classifier) {
    242240    remove(classifier);
    243     Gatherer.c_man.configurationChanged();
    244241    }
    245242
     
    467464            ac.destroy();
    468465            ac = null;
    469             // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure
    470             Gatherer.c_man.configurationChanged();
    471466            }
    472467        }
     
    493488           ac.destroy();
    494489           ac = null;
    495            // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure
    496            Gatherer.c_man.configurationChanged();
    497490        }
    498491        }
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java

    r12806 r12808  
    9090    static final public int NOTHING = 0;
    9191    static private int rebuildTypeRequired = NOTHING; //Rebuild type required if only design options have changed
    92     static public boolean update_collect_cfg_required = false;
    9392
    9493    /** Constructor. Loads a certain collection configuration file, which is parsed into a DOM. This model is then registered with the command information managers, each of whom knows how to, and provides controls to, alter certain commands.
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMeta.java

    r12798 r12808  
    171171        // And determine if this makes the metadata assigned
    172172        setAssigned(raw_value != null && raw_value.length() > 0);
    173         Gatherer.c_man.configurationChanged();
    174173    }
    175174    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java

    r10556 r12808  
    5959        Node target_node = CollectionConfiguration.findInsertionPoint(element);
    6060        add(root, metadata, target_node);
    61         if (!metadata.getValue(CollectionMeta.TEXT).equals("")) {
    62         // if just adding an empty metadata, the configuration hasn't changed.
    63         Gatherer.c_man.configurationChanged();
    64         }
    65     }
    66     //Gatherer.c_man.configurationChanged();
     61    }
    6762    }
    6863
     
    180175        if(name.equals(other.getName()) && language.equals(other.getLanguage())) {
    181176            remove(i);
    182             Gatherer.c_man.configurationChanged();
    183177            return;
    184178        }
     
    192186    /** Removes all of the metadata with a certain name, regardless of language or value. */
    193187    public void removeMetadata(String name) {
    194     boolean removed_entry = false;
    195188    for(int i = getSize(); i != 0; i--) {
    196189        CollectionMeta other = (CollectionMeta) getElementAt(i - 1);
    197190        if(name.equals(other.getName())) {
    198191        remove(i - 1);
    199         removed_entry = true;
    200192        }
    201193        other = null;
    202194    }   
    203     if(removed_entry) {
    204         Gatherer.c_man.configurationChanged();
    205     }
    206195    }
    207196
  • trunk/gli/src/org/greenstone/gatherer/cdm/DesignChangeListener.java

    r10237 r12808  
    5050
    5151    public void maybeSetRebuildRequired() {
    52     if(rebuildType > CollectionDesignManager.getRebuildTypeRequired()) {
     52    if (rebuildType > CollectionDesignManager.getRebuildTypeRequired()) {
    5353        CollectionDesignManager.setRebuildTypeRequired(rebuildType);
    54     }
    55     //We need to keep track of this seperately, as collect.cfg is uploaded if needed, when the collect.cfg is saved.
    56     if(rebuildType == CollectionDesignManager.UPDATE_COLLECT_CFG) {
    57         CollectionDesignManager.update_collect_cfg_required = true;
    5854    }
    5955    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r12708 r12808  
    152152        Node target_node = CollectionConfiguration.findInsertionPoint(element);
    153153        add(root, format, target_node);
    154         Gatherer.c_man.configurationChanged();
    155154    }
    156155    }
     
    207206    private void removeFormat(Format format) {
    208207    remove(format);
    209     Gatherer.c_man.configurationChanged();
    210        
    211208    }
    212209
     
    528525        addFormat(format);
    529526        existingFormat();
    530         // Save the collection configuration file immediately
    531    
    532         Gatherer.c_man.configurationChanged();
    533527
    534528            // Update list selection
     
    582576                    if (shouldSave){
    583577            format.setValue(editor_textarea.getText());
    584                         Gatherer.c_man.configurationChanged();
    585578                        model.refresh((DOMProxyListEntry)format);
    586579            }
     
    605598            if (shouldSave){
    606599            format.setState(enabled_checkbox.isSelected());
    607                         Gatherer.c_man.configurationChanged();
    608600                        model.refresh((DOMProxyListEntry)format);
    609601            }
     
    933925            removeFormat((Format)format_list.getSelectedValue());
    934926
    935             // Save the collection configuration file immediately
    936             Gatherer.c_man.configurationChanged();
    937927            // Change buttons
    938928            add_button.setEnabled(true);
    939929            newFormat();
    940                    
    941930        }
    942931        }
  • trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java

    r12800 r12808  
    104104        setDefault(index);
    105105        }
    106         Gatherer.c_man.configurationChanged();
    107106    }
    108107    else {
     
    330329        add(position, index);
    331330    }
    332 
    333     // Schedule the collection for saving
    334     Gatherer.c_man.configurationChanged();
    335331    }
    336332
     
    361357            default_index.setAssigned(false);
    362358        }
    363         }
    364         Gatherer.c_man.configurationChanged();
     359        }
    365360    }
    366361    }
     
    389384    // add the new one at that position
    390385    add(position, new_index);
    391 
    392     // Schedule the collection for saving
    393     Gatherer.c_man.configurationChanged();
    394386    }
    395387
     
    424416        }
    425417    }
    426     Gatherer.c_man.configurationChanged();
    427                
    428418    }
    429419
  • trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java

    r12800 r12808  
    112112        CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum);
    113113        add(getSize(), language);
    114         Gatherer.c_man.configurationChanged();
    115114    }
    116115    }
     
    204203    }
    205204
    206     // Schedule the collection for saving
    207     Gatherer.c_man.configurationChanged();
    208205    return new_position;
    209206    }
     
    221218        setDefault(null);
    222219    }
    223     Gatherer.c_man.configurationChanged();
    224220    }
    225221
     
    239235    remove(old_language);
    240236    add(position, new_language);
    241 
    242     // Schedule the collection for saving
    243     Gatherer.c_man.configurationChanged();
    244 
    245     }
     237    }
     238
     239
    246240    /** Method to set the default language.
    247241     * @param language The <strong>Language</strong> to use as a default, or <i>null</i> for no default.
     
    271265        }
    272266    }
    273     Gatherer.c_man.configurationChanged();
    274267    }
    275268
     
    372365            language_metadata.setAttribute(StaticStrings.ASSIGNED_ATTRIBUTE, StaticStrings.TRUE_STR);
    373366            language_metadata.setAttribute(StaticStrings.NAME_ATTRIBUTE, value);
    374             Gatherer.c_man.configurationChanged();
    375367            }
    376368        });
  • trunk/gli/src/org/greenstone/gatherer/cdm/LevelManager.java

    r12800 r12808  
    5858        meta.setValue(level);
    5959        CollectionDesignManager.collectionmeta_manager.addMetadatum(meta);
    60 
    61         Gatherer.c_man.configurationChanged();
    62     }
    63    
     60    }
    6461    }
    6562   
     
    110107    if ((level_elem = getLevel(level_name)) != null) {
    111108        levels_model.remove(level_elem);
    112         Gatherer.c_man.configurationChanged();
    113109    }
    114110    }
     
    143139        }
    144140    }
    145     Gatherer.c_man.configurationChanged();
    146141    }
    147142
  • trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java

    r12798 r12808  
    157157        addBefore(plugin, separator_plugin);
    158158    }
    159     Gatherer.c_man.configurationChanged();
    160159    }
    161160
     
    270269        addBefore(plugin, first_plugin);
    271270        first_plugin = null;
    272         Gatherer.c_man.configurationChanged();
    273271        }
    274272        else {
     
    277275        // Add the moving plugin before the separator
    278276        addBefore(plugin, separator_plugin);
    279         Gatherer.c_man.configurationChanged();
    280277        }
    281278    }
     
    295292        remove(plugin);
    296293        add(index, plugin);
    297         Gatherer.c_man.configurationChanged();
    298294        }
    299295        else {
     
    309305        remove(plugin);
    310306        add(index, plugin);
    311         Gatherer.c_man.configurationChanged();
    312307        }
    313308    }
     
    355350    private void removePlugin(Plugin plugin) {
    356351    remove(plugin);
    357     Gatherer.c_man.configurationChanged();
    358352    }
    359353
     
    626620                ac.destroy();
    627621                ac = null;
    628                 // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure
    629                 Gatherer.c_man.configurationChanged();
    630622            }
    631623            }
     
    653645            ac.destroy();
    654646            ac = null;
    655             // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure
    656             Gatherer.c_man.configurationChanged();
    657647            }
    658648        }
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java

    r12800 r12808  
    8484        CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum);
    8585        add(getSize(), subcollection_index);
    86         Gatherer.c_man.configurationChanged();
    8786    }
    8887    }
     
    154153    }
    155154
    156     // Schedule the collection for saving
    157     Gatherer.c_man.configurationChanged();
    158155    return new_position;
    159156    }
     
    174171        // Remove the index
    175172        remove(subcollection_index);
    176         Gatherer.c_man.configurationChanged();
    177173    }
    178174    }
     
    211207    remove(old_subcollection);
    212208    add(position, new_subcollection);
    213    
    214     // Schedule the collection for saving
    215     Gatherer.c_man.configurationChanged();
    216 
    217209    }
    218210
     
    246238        }
    247239    }
    248     Gatherer.c_man.configurationChanged();
    249240    }
    250241
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r12123 r12808  
    8888        // Failing that we insert immediately after a language string
    8989        add(root, subcollection, target_node);
    90         Gatherer.c_man.configurationChanged();
    9190    }
    9291    }
     
    142141    private void removeSubcollection(Subcollection subcollection) {
    143142    remove(subcollection);
    144     Gatherer.c_man.configurationChanged();
    145143    }
    146144
     
    152150    subcollection.setSource(source);
    153151    refresh(subcollection);
    154     Gatherer.c_man.configurationChanged();
    155152    }
    156153
  • trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java

    r12121 r12808  
    7575    if(!contains(supercollection)) {
    7676        add(getSize(), supercollection);
    77         Gatherer.c_man.configurationChanged();
    78     }
    79    
     77    }
    8078    }
    8179
     
    113111    if(contains(supercollection)) {
    114112        remove(supercollection);
    115         Gatherer.c_man.configurationChanged();
    116113    }
    117114    }
  • trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java

    r12748 r12808  
    366366            translation_text = null;
    367367            remove_button.setEnabled(true);
    368             Gatherer.c_man.configurationChanged();
    369368        }
    370369        add_button.setEnabled(false);
     
    386385            // If a remove occured then enable add
    387386            add_button.setEnabled(true);
    388             Gatherer.c_man.configurationChanged();
    389387        }
    390388        // Either way disable replace and remove
     
    410408            metadata = null;
    411409            remove_button.setEnabled(true);
    412             Gatherer.c_man.configurationChanged();
    413410        }
    414411        // Either way disable replace
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r12806 r12808  
    251251    }
    252252
    253  
    254  /** Method that is called whenever something has changed in the configuration of this collection. */
    255     public void configurationChanged() {
    256     if(collection != null) {
    257         collection.setSaved(false);
    258         collection.cdm.update_collect_cfg_required = true;
    259     }
    260     }
    261 
    262    
     253
    263254    public void convertToGS3Collection() {
    264255    // Generate the convert_coll_from_gs2.pl command
Note: See TracChangeset for help on using the changeset viewer.