Changeset 12805


Ignore:
Timestamp:
2006-09-21T14:42:34+12:00 (18 years ago)
Author:
mdewsnip
Message:

All instances of saving the collection now go through CollectionManager.saveCollection().

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

Legend:

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

    r12803 r12805  
    190190    }
    191191
    192     public void save() {
    193     save(false);
    194     }
    195192
    196193    /** Cause the current collection configuration to be written out to disk.
    197194     */
    198     public void save(boolean force_save)
     195    public void saveIfNecessary()
    199196    {
    200     general_manager.loseFocus();
    201     if (!update_collect_cfg_required && !force_save) {
    202         DebugStream.println("Asked to save the config file, but don't need to");
    203         return;
    204     }
    205 
    206     DebugStream.println("Saving the collection config file");
    207 
    208197    collect_config.save();
    209 
    210     // Unset formats changed
    211     update_collect_cfg_required = false;
    212198    }
    213199
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r12804 r12805  
    496496        }
    497497
    498         collection.cdm.save(true);
     498        saveCollection();
    499499
    500500        // Create a lock file
     
    12591259
    12601260    // Write out the collection configuration file
    1261     collection.cdm.save();
     1261    collection.cdm.saveIfNecessary();
    12621262
    12631263    // Change cursor back to normal
  • trunk/gli/src/org/greenstone/gatherer/gui/BaseConfigPane.java

    r12804 r12805  
    101101    }
    102102
    103     public void gainFocus() {
     103
     104    public void gainFocus()
     105    {
    104106    if (cdm == null && Gatherer.c_man.ready()) {
    105107        // Retrieve the new config manager.
     
    109111        view.gainFocus();
    110112    }
    111 
    112     }
    113 
    114     public void loseFocus() {
    115     if (cdm != null) {
    116         cdm.save();
    117     }
     113    }
     114
     115
     116    public void loseFocus()
     117    {
    118118    if (view != null) {
    119119        view.loseFocus();
    120120    }
    121 
    122     }
     121    if (cdm != null) {
     122        Gatherer.c_man.saveCollection();
     123    }
     124    }
     125
    123126
    124127    public void destroy() {
    125128    tree = null;
    126129    view = null;
    127 
    128130    }
    129131
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r12739 r12805  
    136136    }
    137137
    138  
    139 
    140     public void windowGainedFocus(WindowEvent e) {
    141     //System.out.println("JPanel windowGainedFocus.");
    142     }
    143 
    144     public void windowLostFocus(WindowEvent e) {
    145         //System.out.println("JPanel windowLostFocus.");
    146 
     138
     139    public void windowGainedFocus(WindowEvent e)
     140    {
     141    }
     142
     143
     144    public void windowLostFocus(WindowEvent e)
     145    {
     146    // Save the loaded collection
    147147    if (Gatherer.c_man != null && Gatherer.c_man.ready() && Gatherer.c_man.getCollection().cdm != null) {
    148         Gatherer.c_man.getCollection().cdm.save();
    149     }
    150     //Gatherer.g_man.design_pane.saveConfiguration();
    151    
    152     }
    153  
     148        Gatherer.c_man.saveCollection();
     149    }
     150    }
     151
    154152
    155153    private class GLIGUIFocusListener
  • trunk/gli/src/org/greenstone/gatherer/gui/PreviewButton.java

    r12116 r12805  
    120120
    121121    public void actionPerformed(ActionEvent event) {
    122         Gatherer.c_man.getCollection().cdm.save(); // save the config file just in case
     122        Gatherer.c_man.saveCollection();
    123123       
    124124        configureHomeURL();
Note: See TracChangeset for help on using the changeset viewer.