Index: /trunk/gli/classes/dictionary.properties
===================================================================
--- /trunk/gli/classes/dictionary.properties	(revision 10658)
+++ /trunk/gli/classes/dictionary.properties	(revision 10659)
@@ -463,4 +463,5 @@
 WriteCDImagePrompt.Instructions:Export one or more collections to a self-installing Windows CD/DVD (although this works on any platform, the CD/DVD that is created only runs under Windows).
 WriteCDImagePrompt.Progress_Label:Copying Files. This could take some time...
+WriteCDImagePrompt.Size_Label:Estimated size: 
 WriteCDImagePrompt.Successful_Export:The collections ({0}) have been exported.
 WriteCDImagePrompt.Successful_Title:Export Complete
Index: /trunk/gli/src/org/greenstone/gatherer/gui/WriteCDImagePrompt.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/gui/WriteCDImagePrompt.java	(revision 10658)
+++ /trunk/gli/src/org/greenstone/gatherer/gui/WriteCDImagePrompt.java	(revision 10659)
@@ -49,4 +49,5 @@
 import org.greenstone.gatherer.LocalGreenstone;
 import org.greenstone.gatherer.collection.BasicCollectionConfiguration;
+import org.greenstone.gatherer.collection.CollectionManager;
 import org.greenstone.gatherer.shell.GShell;
 import org.greenstone.gatherer.shell.GShellEvent;
@@ -90,5 +91,7 @@
     /** A string array used to pass arguments to the phrase retrieval method. */
     private JTextField title_field = null;
+    private JTextField estimated_size_field = null;
     private JLabel title_label = null;
+    private JLabel estimated_size_label = null;
     private String args[] = null;
     private String cd_title = null;
@@ -99,4 +102,6 @@
     /** the error message if any */
     private StringBuffer error_message = null;
+    /** This is the size of the exported stuff on its own (no collections). */
+    private long total_exported_size = 52000000;
     /** The size of the export prompt screen. */
     public static final Dimension SIZE = new Dimension(500, 500);
@@ -138,4 +143,12 @@
 	title_label = new JLabel();
 	Dictionary.setText(title_label, "WriteCDImagePrompt.CD_Name");
+
+	estimated_size_field = new JTextField();
+	estimated_size_field.setEditable(false);
+	estimated_size_field.setText(Utility.formatFileLength(total_exported_size));
+	estimated_size_field.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
+	estimated_size_label = new JLabel();
+	Dictionary.setText(estimated_size_label, "WriteCDImagePrompt.Size_Label");
+
 	scanForCollections();
 	list.setListData(all_collections);
@@ -206,4 +219,9 @@
 
 	// Lower pane
+	JPanel estimated_size_pane = new JPanel(new BorderLayout());
+	estimated_size_pane.add(estimated_size_label, BorderLayout.WEST);
+	estimated_size_pane.add(estimated_size_field, BorderLayout.CENTER);
+	estimated_size_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
+
 	JPanel button_pane = new JPanel(new GridLayout(1, 2));
 	button_pane.add(ok_button);
@@ -212,4 +230,5 @@
 
 	JPanel lower_pane = new JPanel(new BorderLayout());
+	lower_pane.add(estimated_size_pane, BorderLayout.NORTH);
 	lower_pane.add(button_pane, BorderLayout.SOUTH);
 	lower_pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
@@ -424,4 +443,9 @@
 	public void valueChanged(ListSelectionEvent event)
 	{
+	    // Wait for things to settle down a bit
+	    if (event.getValueIsAdjusting()) {
+		return;
+	    }
+
 	    // Can only export when something is ticked
 	    ok_button.setEnabled(!list.isNothingTicked());
@@ -440,4 +464,42 @@
 	    Dictionary.setText(details_textarea, "DeleteCollectionPrompt.Details", args);
 	    details_textarea.setCaretPosition(0);
+
+	    // Find the size of the "etc", "images" and "index" directories of the collection
+	    String collection_directory_path = CollectionManager.getCollectionDirectoryPath(collection.getShortName());
+	    File etc_directory = new File(collection_directory_path + "etc");
+	    File images_directory = new File(collection_directory_path + "images");
+	    File index_directory = new File(collection_directory_path + "index");
+	    long collection_size_built = getFileSize(etc_directory) + getFileSize(images_directory) + getFileSize(index_directory);
+
+	    // Add/subtract it from the total, depending on whether the collection has just been ticked/unticked
+	    if (((CheckListEntry) list.getSelectedValue()).isSelected()) {
+		total_exported_size += collection_size_built;
+	    }
+	    else {
+		total_exported_size -= collection_size_built;
+	    }
+
+	    // Update the size field
+	    estimated_size_field.setText(Utility.formatFileLength(total_exported_size));
+	}
+
+
+	private long getFileSize(File file)
+	{
+	    long file_size = 0;
+
+	    // Directory case
+	    if (file.isDirectory()) {
+		File files[] = file.listFiles();
+		for (int i = 0; i < files.length; i++) {
+		    file_size += getFileSize(files[i]);
+		}
+	    }
+	    // File case
+	    else {
+		file_size = file.length();
+	    }
+
+	    return file_size;
 	}
     }
