Index: branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/GAI.java
===================================================================
--- branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/GAI.java	(revision 9974)
+++ branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/GAI.java	(revision 10792)
@@ -25,5 +25,4 @@
  *########################################################################
  */
-
 // Graphical Adminstration Interface
 package org.greenstone.admin;
@@ -41,4 +40,5 @@
 import org.greenstone.admin.GAIManager;
 import org.greenstone.core.Configuration;
+import org.greenstone.core.Dictionary;
 import org.greenstone.admin.gui.SetServerPane;
 
@@ -58,5 +58,8 @@
     public static String admin_path;
     public static String tomcat_file_path;
+    public static String images_path;
     public static File build_file;
+    public static File site_conf;
+    public static File interface_conf;
     /** A public reference to the GAIManager. */
     static public GAIManager ga_man;
@@ -67,5 +70,9 @@
 	this.admin_path = this.gsdl3_path + "/src/java/org/greenstone/admin/";
 	this.tomcat_file_path = this.gsdl3_path + "/comms/jakarta/tomcat/logs/";
+	this.images_path = this.admin_path + "images/";
        	this.build_file = new File(gsdl3_path, "build.properties"); 
+	this.site_conf = new File (gsdl3_path,"/web/sites/localsite/siteConfig.xml");
+	this.interface_conf = new File (gsdl3_path, "/web/interfaces/default/interfaceConfig.xml");
+	init();
     }
     
@@ -75,8 +82,15 @@
 	new Configuration (admin_path);
 	GAI gai = new GAI();
+	
+	ga_man  = new GAIManager(screen_size);
+	ga_man.display();
+    }
 
-	/*Check if the user want to set up their own TOMCAT/MYSQL server
-	 * when they first time run GAI*/
-	GAIFirstSettingFrame first_setting = new GAIFirstSettingFrame();
+    public void init (){
+	// Read Dictionary
+	new Dictionary(Configuration.getLocale("general.locale", true), Configuration.getFont("general.font", true));
+
     }
 }
+
+
Index: branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/GAIManager.java
===================================================================
--- branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/GAIManager.java	(revision 9974)
+++ branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/GAIManager.java	(revision 10792)
@@ -54,20 +54,14 @@
     implements ActionListener, ChangeListener{
     
-    //private static final Dimension SIZE = new Dimension (800, 600);
     private Dimension size = null;
-    //public static String gsdl3_path = null;
-    
-    private JTabbedPane tab_pane = null;
-
-    // Call the ConfPane
+    // The ConfPane contains the configuration details of Greenstone III build and installation
     public ConfPane conf_pane = null;
-    
+    // The LogPane contains the log details for Tomcat Server used by gsdl3
+    public LogPane log_pane = null;
+    // Not designed yet
     public JPanel ext_pane = null;
+    // Not designed yet
+    public JPanel monitor_pane = null;
        
-    public JPanel monitor_pane = null;
-    
-    // Call the LogPane
-    public LogPane log_pane = null;
-    
     static public ImageIcon CONF_ICON = null; 
     static public ImageIcon EXT_ICON = null; 
@@ -77,10 +71,13 @@
     // Create a menu bar in the main Pane
     public MenuBar menu_bar = null;
-    // Setting up the MenuItem
-    public JMenu menu = null;
+
+    // HelpFrame
     
     private JPanel previous_pane = null;
     private JPanel content_pane = null;
-    //public static String admin_path = null;
+    private JTabbedPane tab_pane = null;
+
+    /** A threaded tab changer to try and avoid NPE on exit. */
+    private TabUpdater tab_updater = null;
     
     //Contructor
@@ -88,72 +85,35 @@
 	super();
 	this.size = size;
-	this.setDefaultCloseOperation(EXIT_ON_CLOSE);
+	this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
 	this.setTitle("GreenStone 3 Administration Tool");
-	
-	display();
-    }
-
-    //private createMenuEvent (){
-
-    public void actionPerformed (ActionEvent event){
-	Object esrc = event.getSource();
-	// File Options
-	if (esrc == menu_bar.file_exit){
-	    System.exit(1);
-	}	
-	//Edit Options
-	//Help Options
-	else if (esrc == menu_bar.help_conf){
-	}
-	else if (esrc == menu_bar.help_ext){
-	} 
-	else if (esrc == menu_bar.help_monitor){
-	}
-	else if (esrc == menu_bar.help_log){
-	}
-	else if (esrc == menu_bar.help_about) {
-	}
-    }
-
-    public void destory (){
-	// Destroying create pane ensures the latest log has been closed
-	//if (status_pane != null) {
-	//}
-    }
-
-    // Listens to actions upon the menu bar
-    private class MenuListenerImpl
-	implements MenuListener {
-
-	public void menuCanceled (MenuEvent e) {
-	}
-	
-	public void menuDeselected (MenuEvent e){
-	}
-	
-	public void menuSelected (MenuEvent e){
-	    if (e.getSource() == menu_bar.help){
-		if (menu_bar.help.isSelected()){
-		    menu_bar.help.doClick(10);
-		}
-	    }
-	}
-    }
-
-    public void display(){
-	CONF_ICON = new ImageIcon (GAI.admin_path+"images/properties24.gif");
-	EXT_ICON = new ImageIcon ("");	
-	MONITOR_ICON = new ImageIcon (GAI.admin_path+ "images/examine.gif");
-	LOG_ICON = new ImageIcon (GAI.admin_path+"images/collection.gif");
-	
+	/* Add a focus listener to ourselves. Thus if we gain focus when a Modal Dialog should 
+	 * instead have it, we can try to bring the modal dialog to the front*/
+	//this.addFocusListener(new GAIGUIFocusListener());	
+	//display();
+    }
+
+    private class GAIGUIFocusListener
+	extends FocusAdapter {
+	public void focusGained(FocusEvent e) {
+	    /*  if (ModalDialog.current_modal != null) {
+		ModalDialog.current_modal.makeVisible();
+		ModalDialog.current_modal.toFront();
+		}*/
+	}
+    }
+
+   public void display(){
+	CONF_ICON = new ImageIcon (GAI.images_path + "create.gif");
+	EXT_ICON = new ImageIcon (GAI.images_path + "toolbarButtonGraphics/general/Information16.gif");	
+	MONITOR_ICON = new ImageIcon (GAI.images_path + "toolbarButtonGraphics/general/Zoom16.gif");
+	LOG_ICON = new ImageIcon (GAI.images_path + "toolbarButtonGraphics/general/History16.gif");
 	content_pane = (JPanel) this.getContentPane();
 
 	try {
 	    this.setSize(size);
-
 	    //create a menuBar
-	    menu_bar = new MenuBar();
+	    menu_bar = new MenuBar(new MenuListenerImpl());
+	    this.setJMenuBar(menu_bar);
 	    
-	    this.setJMenuBar(menu_bar);
 	    //Create the tabbed pane and put it in the center
 	    tab_pane = new JTabbedPane();
@@ -202,4 +162,108 @@
     }
 
+    /** Any implementation of <i>ActionListener</i> must include this method so that we can be informed 
+     *  when an action has occured. In this case we are listening to actions from the menu-bar, and should 
+     *  react appropriately.
+     * @param event An <strong>ActionEvent</strong> containing information about the action that has occured.
+     */
+    
+    public void actionPerformed (ActionEvent event){
+	Object esrc = event.getSource();
+	boolean project_conf_changed = false;
+	boolean site_conf_changed = false;
+	boolean interface_conf_changed = false;
+	if (esrc == menu_bar.file_exit){
+	    project_conf_changed = conf_pane.ProjectConfChanged();
+	    site_conf_changed = conf_pane.site_conf.confChanged();
+	    interface_conf_changed = conf_pane.interface_conf.confChanged();
+	    /* Check if the Project and Site configuration files have been changed,
+	     * if changed, prompt to users if they want to save*/ 
+	    if (project_conf_changed || site_conf_changed || interface_conf_changed) {
+		int result = JOptionPane.showConfirmDialog((Component) null, "The Configuration files have been changed, do you want to save the change", "Save Confirmation", JOptionPane.YES_NO_OPTION);
+		if ( result == JOptionPane.YES_OPTION) {
+		    conf_pane.saveProjectConf(GAI.build_file);
+		    conf_pane.site_conf.saveFile(GAI.site_conf);
+		    conf_pane.interface_conf.saveFile(GAI.interface_conf);
+		} 
+	    }
+	    exit();
+	}
+	else if (esrc == menu_bar.file_save){
+	    /* sliently and Globally save Project and Site configuration*/
+	    project_conf_changed = conf_pane.ProjectConfChanged();
+	    site_conf_changed = conf_pane.site_conf.confChanged();
+	    interface_conf_changed = conf_pane.interface_conf.confChanged();
+	    if (project_conf_changed) {
+		conf_pane.saveProjectConf(GAI.build_file);
+	    }
+	    if (site_conf_changed){
+		conf_pane.site_conf.saveFile(GAI.site_conf);
+	    }
+	    if (interface_conf_changed) {
+		conf_pane.interface_conf.saveFile(GAI.interface_conf);
+	    }
+	}
+	else if (esrc == menu_bar.help_conf){
+	}
+	else if (esrc == menu_bar.help_ext){
+	} 
+	else if (esrc == menu_bar.help_monitor){
+	}
+	else if (esrc == menu_bar.help_log){
+	}
+	else if (esrc == menu_bar.help_about) {
+	}
+    }
+    
+    
+    public void destory (){
+	// Destroying create pane ensures the latest log has been closed
+	//if (status_pane != null) {
+	//}
+    }
+    /**Overridden from JFrame so we can exit safely when window is closed 
+     *(or destroyed). @param event A <strong>WindowEvent</strong> containing 
+     *information about the event that fired this call.
+     */
+    protected void processWindowEvent(WindowEvent event) {
+	if(event.getID() == WindowEvent.WINDOW_CLOSING) {
+	    exit();
+	}
+    }
+
+
+    /** Listens to actions upon the menu bar, and if it detects a click over 
+     *the help menu brings the help window to the front if it has become hidden.
+     */
+    private class MenuListenerImpl
+	implements MenuListener {
+	public void menuCanceled (MenuEvent e) {
+	}
+	
+	public void menuDeselected (MenuEvent e){
+	}
+	
+	public void menuSelected (MenuEvent e){
+	    if (e.getSource() == menu_bar.file_exit) {
+		exit();
+	    }
+	  
+	    if (e.getSource() == menu_bar.help){
+		if (menu_bar.help.isSelected()){
+		    menu_bar.help.doClick(10);
+		}
+	    }
+	}
+    }
+
+
+    /** This method ensures that all the things needing saving 
+     *  are saved before GAIManager.exit() is called.
+     */
+    public void exit() {
+	System.exit(0);
+    }
+
+
     /** Any implementation of ChangeListener must include this method 
      **so we can be informed when the state of one of the registered 
@@ -223,9 +287,4 @@
     }
     
-    public void exit(){
-	DebugStream.println("****exit called");
-	System.exit(1);
-    }
-    
     public void modeChanged (int mode){
 	if (log_pane != null){
@@ -241,6 +300,4 @@
 	if (log_pane != null ){
 	}
-	//if (status_pane != null) {
-	//}
     }
 
@@ -250,4 +307,21 @@
 	}
     }
+    public void wait(boolean waiting) {
+	Component glass_pane = getGlassPane();
+	if(waiting) {
+	    // Show wait cursor.
+	    //glass_pane.addMouseListener(mouse_blocker_listener);
+	    glass_pane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+	    glass_pane.setVisible(true);
+	}
+	else {
+	    // Hide wait cursor.
+	    glass_pane.setVisible(false);
+	    glass_pane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+	    //glass_pane.removeMouseListener(mouse_blocker_listener);
+	}
+	glass_pane = null;
+    }
+
     private class TabUpdater
 	implements Runnable {
@@ -304,4 +378,2 @@
     }
 }
-
-
