Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/f-spot/ChangeLog,v
retrieving revision 1.1535
diff -u -r1.1535 ChangeLog
--- ChangeLog	11 Aug 2006 17:17:26 -0000	1.1535
+++ ChangeLog	29 Aug 2006 20:33:55 -0000
@@ -1,3 +1,8 @@
+2006-08-29  Gautier Portet <kassoulet gmail com>
+
+	* src/FileImportBackend.cs: Add an option to delete files after
+	importing. Fixes BGO #321596. 
+
 2006-08-11  Gabriel Burt  <gabriel.burt@gmail.com>
 
 	* src/FolderExport.cs: Internationalize several strings in generated HTML
Index: src/FileImportBackend.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/FileImportBackend.cs,v
retrieving revision 1.36
diff -u -r1.36 FileImportBackend.cs
--- src/FileImportBackend.cs	18 Jul 2006 23:17:42 -0000	1.36
+++ src/FileImportBackend.cs	29 Aug 2006 20:33:56 -0000
@@ -14,6 +14,7 @@
 public class FileImportBackend : ImportBackend {
 	PhotoStore store;
 	bool recurse;
+	bool delete;
 	bool copy;
 	string [] base_paths;
 	Tag [] tags;
@@ -207,6 +208,11 @@
 				photo = store.Create (info.DestinationPath, out thumbnail);
 			} else {
 				System.IO.File.Copy (info.OriginalPath, destination);
+				
+				if (delete) {
+					System.IO.File.Delete (info.OriginalPath);
+				}
+				
 				info.DestinationPath = destination;
 
 				photo = store.Create (info.DestinationPath, info.OriginalPath, out thumbnail);
@@ -289,12 +295,13 @@
 		count = 0;
 	}
 
-	public FileImportBackend (PhotoStore store, string [] base_paths, bool recurse) : this (store, base_paths, false, recurse, null) {}
+	public FileImportBackend (PhotoStore store, string [] base_paths, bool recurse) : this (store, base_paths, false, false, recurse, null) {}
 
-	public FileImportBackend (PhotoStore store, string [] base_paths, bool copy, bool recurse, Tag [] tags)
+	public FileImportBackend (PhotoStore store, string [] base_paths, bool copy, bool delete, bool recurse, Tag [] tags)
 	{
 		this.store = store;
 		this.copy = copy;
+		this.delete = delete;
 		this.base_paths = base_paths;
 		this.recurse = recurse;
 		this.tags = tags;
Index: src/ImportCommand.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/ImportCommand.cs,v
retrieving revision 1.63
diff -u -r1.63 ImportCommand.cs
--- src/ImportCommand.cs	9 Jun 2006 22:53:02 -0000	1.63
+++ src/ImportCommand.cs	29 Aug 2006 20:33:58 -0000
@@ -298,6 +298,7 @@
 	[Glade.Widget] Gtk.CheckButton attach_check;
 	[Glade.Widget] Gtk.CheckButton recurse_check;
 	[Glade.Widget] Gtk.CheckButton copy_check;
+	[Glade.Widget] Gtk.CheckButton delete_check;
 	[Glade.Widget] Gtk.Button ok_button;
 	[Glade.Widget] Gtk.Image tag_image;
 	[Glade.Widget] Gtk.Label tag_label;
@@ -508,7 +509,7 @@
 			SetImportPath (path);
 		}
 	}
-	
+
 	public string ChoosePath ()
 	{
 		string path = null;
@@ -546,10 +547,17 @@
 		//tag_label.Text = t.Name;
 	}
 
+	private void HandleCopyCheck()
+	{
+		delete_check.Sensitive = copy_check.Active;
+	}
+
 	private void HandleRecurseToggled (object sender, System.EventArgs args)
 	{
 		this.Cancel ();
 		this.Dialog.Sensitive = false;
+
+		HandleCopyCheck ();
 	       
 		idle_start.Start ();
 	}
 		
@@ -731,8 +739,14 @@
 		bool recurse = true;
 		if (recurse_check != null)
 			recurse = recurse_check.Active;
+			
+		bool delete = false;
+		if (delete_check != null)
+			delete = delete_check.Active;
+
+		HandleCopyCheck ();
 		
-		importer = new FileImportBackend (store, pathimport, copy, recurse, null);
+		importer = new FileImportBackend (store, pathimport, copy, delete, recurse, null);
 		AllowFinish = false;
 		
 		total = importer.Prepare ();
@@ -749,20 +763,20 @@
 		return false;
 	}
 
-	public int ImportFromPaths (PhotoStore store, string [] paths, bool copy)
+	public int ImportFromPaths (PhotoStore store, string [] paths, bool copy, bool delete)
 	{
-		return ImportFromPaths (store, paths, null, copy);
+		return ImportFromPaths (store, paths, null, copy, delete);
 	}
 	
 	public int ImportFromPaths (PhotoStore store, string [] paths, Tag [] tags)
 	{
-		return ImportFromPaths (store, paths, tags, false);
+		return ImportFromPaths (store, paths, tags, false, false);
 	}
 	
-	public int ImportFromPaths (PhotoStore store, string [] paths, Tag [] tags, bool copy)
+	public int ImportFromPaths (PhotoStore store, string [] paths, Tag [] tags, bool copy, bool delete)
 	{
 		collection = new FSpot.PhotoList (new Photo [0]);
-		int count = DoImport (new FileImportBackend (store, paths, copy, true, tags));
+		int count = DoImport (new FileImportBackend (store, paths, copy, delete, true, tags));
 
 		Finish ();
 
Index: src/MainWindow.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/MainWindow.cs,v
retrieving revision 1.304
diff -u -r1.304 MainWindow.cs
--- src/MainWindow.cs	11 Aug 2006 16:35:53 -0000	1.304
+++ src/MainWindow.cs	29 Aug 2006 20:34:03 -0000
@@ -1052,7 +1052,7 @@
 	public void ImportUriList (UriList list, bool copy) 
 	{
 		ImportCommand command = new ImportCommand (main_window);
-		if (command.ImportFromPaths (db.Photos, list.ToLocalPaths (), copy) > 0) {
+		if (command.ImportFromPaths (db.Photos, list.ToLocalPaths (), copy, false) > 0) {
 			UpdateQuery ();
 		}
 	}
Index: src/f-spot.glade
===================================================================
RCS file: /cvs/gnome/f-spot/src/f-spot.glade,v
retrieving revision 1.164
diff -u -r1.164 f-spot.glade
--- src/f-spot.glade	6 Jun 2006 18:09:47 -0000	1.164
+++ src/f-spot.glade	29 Aug 2006 20:34:38 -0000
@@ -9649,6 +9649,25 @@
 	      <property name="fill">False</property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <widget class="GtkCheckButton" id="delete_check">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label" translatable="yes">Delete file after copy</property>
+	      <property name="use_underline">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="active">False</property>
+	      <property name="inconsistent">False</property>
+	      <property name="draw_indicator">True</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>
