Index: /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java	(revision 34204)
+++ /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java	(revision 34205)
@@ -67,5 +67,9 @@
 	// This method is initilised in CollectionDesignManager.java constructor
 	public CollectionConfiguration(File collect_config_file)
-	{
+	{	    
+	    load(collect_config_file);
+	}
+
+	private void load(File collect_config_file) {
 		this.collect_config_file = collect_config_file;
 		this.collect_config_filename = collect_config_file.getName();
@@ -84,4 +88,9 @@
 
 		//XMLTools.printXMLNode(document.getDocumentElement());
+	}
+
+
+	public void reload() {
+	    load(this.collect_config_file);
 	}
 
Index: /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java	(revision 34204)
+++ /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java	(revision 34205)
@@ -120,4 +120,17 @@
     }
 
+
+    public void reloadConfig() {
+	// Parse and load the current collection configuration again
+	// Used after GLI > Edit > collectionConfig.xml > Save to get these edits into GLI.
+	
+	collect_config.reload();
+	if (DebugStream.isDebuggingEnabled()) {
+	    collect_config.display();
+	}
+	loadDesignDetails();
+	DebugStream.println("CollectionDesignModule loaded.");
+    }
+
     /** Reloads the various managers to ensure they have built themselves from the latest details available in the collection configuration class
      * @see org.greenstone.gatherer.cdm.ClassifierManager
Index: /main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 34204)
+++ /main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 34205)
@@ -1303,5 +1303,20 @@
     }
 
-
+    
+    public void reloadAfterConfigFileEdited() {
+	// Copying just the part of LoadCollectionInternal below that loads the config file
+	// Need to reload the *existing* config file, however. So calling custom method reloadConfig()
+	
+	// Don't see why this stuff here (vs LoadCollectionInternal) would need to happen in its own
+	// Thread for my use: when the modal Edit > collectionConfig.xml dialog has saved and closed.
+	
+	// reload current collection's config
+	collection.cdm.reloadConfig();
+
+	// We're done. Let everyone know.
+	DebugStream.println(Dictionary.get("CollectionManager.Loading_Successful", collection.getName()));
+	Gatherer.refresh(Gatherer.COLLECTION_OPENED);
+    }
+    
     public void loadCollection(String collection_file_path)
     {
Index: /main/trunk/gli/src/org/greenstone/gatherer/gui/ConfigFileEditor.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/gui/ConfigFileEditor.java	(revision 34204)
+++ /main/trunk/gli/src/org/greenstone/gatherer/gui/ConfigFileEditor.java	(revision 34205)
@@ -80,4 +80,10 @@
 	String collection_folder_path = Gatherer.getCollectDirectoryPath();
 	String collectionName  = Gatherer.c_man.getCollection().getName(); // we won't be in this constructor if collection is null.
+
+	// Gatherer.c_man.saveCollection(); // on Edit > collectionConfig.xml menu click,
+	// collection save has already happened as GLI pane.lostFocus() got called on current GLI Pane
+	// if/where this affects collectionConfig.xml. For an explanation, see GUIManager.java,
+	// look for "if(esrc == menu_bar.edit_config)"
+
 	this.config_file = new File(collection_folder_path + File.separator + collectionName, Utility.CONFIG_GS3_FILE); // col config editing is a GS3 feature
 
@@ -201,4 +207,12 @@
 	// Final dialog setup & positioning.
 	setDefaultCloseOperation(DISPOSE_ON_CLOSE); // get rid of this dialog when it's closed (on dispose())
+	this.addWindowListener(new WindowAdapter() { // called on dispose. Return focus to any curr GLI Pane
+		public void windowClose(WindowEvent we) {
+		    Gatherer.g_man.doRegainFocus();
+		}
+	    });
+	
+
+	
 	getRootPane().setDefaultButton(save_button);
 	Dimension screen_size = Configuration.screen_size;
@@ -234,6 +248,30 @@
 	    // close and reopen the collection in GLI
 	    String current_collection_filepath = Gatherer.c_man.getCollection().getCollectionPath();
-	    Gatherer.c_man.closeCollection();
-	    Gatherer.c_man.loadCollection(current_collection_filepath);
+	    ////Gatherer.c_man.closeCollection(); // explicit save was necessary after all
+	                                          // closeCollection() doesn't auto-save
+	    ////Gatherer.c_man.loadCollection(current_collection_filepath);
+
+	    
+	    // Fixing bug: Edit > colcfg wasn't being saved on Save when client-GLI.
+	    // And in fact, it wasn't properly saving in GLI for some GLI panes.
+	    // That's because save needs to be explicitly called. (Didn't understand how GLI's
+	    // "autosave" worked until now. GLI > File > Close a collection saves it, but underneath
+	    // it calles SAVEandCloseCollection.
+	    
+	    // Works - but arduous: have to load in the entire collection just because cfg changed?
+	    // Especial pain with client-GLI where reloading takes forever.
+	    //Gatherer.g_man.saveThenCloseCurrentCollection();
+	    //Gatherer.c_man.loadCollection(current_collection_filepath);
+
+	    // Better way: don't have to close and reopen the entire collection after editing colCfg.xml
+	    // This just updates GLI's interface with the current collCfg.xml.
+	    // Fingers crossed this works for client-GLI, because then the coll won't need to be closed
+	    // and reopened each time after Edit > collectionCfg.xml gets saved.
+	    Gatherer.c_man.saveCollection(); // should save colcfg whether GLI or client-GLI
+	    Gatherer.c_man.reloadAfterConfigFileEdited();
+	    //Gatherer.g_man.updateUI(); // didn't do what I hoped it would, so is this relevant here?
+	                 // It's done when a new collection is loaded, so may be useful?
+	                 // But all my tests concerning GLI > Edit > collConfig.xml worked out without it
+	    
 	}
 	
Index: /main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java	(revision 34204)
+++ /main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java	(revision 34205)
@@ -148,5 +148,5 @@
     }
 
-
+    
     public void windowLostFocus(WindowEvent e)
     {
@@ -266,5 +266,44 @@
 	else if(esrc == menu_bar.edit_config) {	   
 	    if(Gatherer.c_man.getCollection() != null) {
-
+		// Before we open the current collection's collectionConfig.xml for editing,
+		// need to make sure any presently unsaved edits are saved into collConfig
+		// so they are reflected in this config file when loaded into the editor for editing.
+		// A simple Gatherer.c_man.saveCollection() is not sufficient: it won't save ongoing
+		// edits in the currently selected GLI Pane (where relevant to colcfg)
+		
+		// Whenever a user swaps from one GLI pane to another, loseFocus() is called on the pane
+		// and for some GLI Panes, this triggers a collection save, but notably also triggers a
+		// loseFocus() on the pane's editing fields/controls, which saves any ongoing mods in that
+		// pane to the collectionConfiguration file.
+		// - See loseFocus() of BaseConfigPane.java (that only SOME gli Pane's inherit from)
+		// and also apparent in GUIManager.windowLostFocus().
+		// - And for implementations of Control.loseFocus(), see for example via
+		// CollectionManager.loadDesignDetails() -> GeneralManager (for Format > General tab)
+		// which leads to GeneralManager.loseFocus() which gets "Called to store the current
+		// value of the components" - of its Controls. Exactly the behaviour we want!
+		
+		// Not all GLI Panes inherit from BaseConfigPane, but then, not all GLI Panes
+		// make changes to the collection Config file; e.g. the Gather pane makes changes to 
+		// the file system, Enrich makes changes to metadata.xml files and *.mds metadata sets
+		// files. But Design and Format panes make changes to collectionConfig.xml.
+		// In theory Create pane ought to as well, e.g. can set import options which also exists
+		// as ImportOptions in collectionConfig.xml, but they're not linked (yet) and Create pane
+		// doesn't inherit from BaseConfigPane. CreatePane's loseFocus() also don't call
+		// for the the collection to be saved.
+
+		// What all this means is that when we prepare to open the collectionConfig.xml,
+		// we want a collection save but want also the current state of GLI edits to be saved
+		// into collConfig before we display the collConfig file for editing.
+		// To trigger this behaviour we want to call loseFocus() on the current pane, called
+		// "previous_pane". That method may or may not force a save to collConfig,
+		// depending on whether it is warranted for that pane, but in such cases it will also
+		// cascade the loseFocus() call to the controls in that pane, who will save their current
+		// values into the colcfg in memory before this gets saved to the colCfg.xml file.	
+		
+		if(previous_pane != null) {
+		    doLoseFocus();
+		} 
+		//Gatherer.c_man.saveCollection(); //shouldn't have to do this, in theory. See above comment
+		
 		ConfigFileEditor configEditor = new ConfigFileEditor();
 		configEditor.setVisible(true);
@@ -1035,5 +1074,53 @@
     }
 
-
+    // Want to triger loseFocus() on GLI Panes at will when Menu > Edit > collectionConfig.xml clicked.
+    // And when done editing, want to trigger doRegainFocs().
+    // loseFocus() on GLI Panes is not universally inherited from a common base class
+    // But loseFocus() is important as it forces saves as-is of user entered values in gui fields
+    // When alling doLoseFocus() on GLI > Edit > collConfig.xml, we force a save of the current state
+    // of the current pane (called "previous_pane").
+    // Else a save is only triggered when another GLI Pane is clicked. We can't expect a user to
+    // remember to click other panes whenever they want to edit the collConfig.xml.    
+    private void doLoseFocus() {
+    
+	if (previous_pane != null) {
+	    if (previous_pane == gather_pane) {
+		gather_pane.loseFocus();
+	    }
+	    else if (previous_pane == enrich_pane) {
+		enrich_pane.loseFocus();
+	    }
+	    else if (previous_pane == design_pane) {
+		design_pane.loseFocus();
+	    }
+	    else if (previous_pane == create_pane) {
+		create_pane.loseFocus();
+	    }
+	    else if (previous_pane == format_pane) {
+		format_pane.loseFocus();
+	    }
+	}
+    }
+    public void doRegainFocus() {
+    
+	if (previous_pane != null) {
+	    if (previous_pane == gather_pane) {
+		gather_pane.gainFocus();
+	    }
+	    else if (previous_pane == enrich_pane) {
+		enrich_pane.gainFocus();
+	    }
+	    else if (previous_pane == design_pane) {
+		design_pane.gainFocus();
+	    }
+	    else if (previous_pane == create_pane) {
+		create_pane.gainFocus();
+	    }
+	    else if (previous_pane == format_pane) {
+		format_pane.gainFocus();
+	    }
+	}
+    }
+    
     /** Any implementation of ChangeListener must include this method so we can be informed when the state of one of the registered objects changes. In this case we are listening to view changes within the tabbed pane.
      * @param event A ChangeEvent containing information about the event that fired this call.
