? RenameMoveCopy.cs
? f-spot.gladep
Index: MainWindow.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/MainWindow.cs,v
retrieving revision 1.266
diff -u -p -r1.266 MainWindow.cs
--- MainWindow.cs	30 Jan 2006 07:14:28 -0000	1.266
+++ MainWindow.cs	3 Feb 2006 23:08:50 -0000
@@ -18,7 +18,7 @@ using LibGPhoto2;
 
 public class MainWindow {
 
-        public static MainWindow Toplevel;
+	public static MainWindow Toplevel;
 
 	Db db;
 
@@ -52,6 +52,8 @@ public class MainWindow {
 	[Glade.Widget] MenuItem select_none;
 	[Glade.Widget] MenuItem rotate_left;
 	[Glade.Widget] MenuItem rotate_right;
+	
+	[Glade.Widget] MenuItem rename_pictures_menu_item;
 
 	[Glade.Widget] MenuItem adjust_color;
 	[Glade.Widget] MenuItem sharpen;
@@ -1278,6 +1280,12 @@ public class MainWindow {
 		PreferenceDialog.Show ();
 	}
 	
+
+	void HandleRenamePicturesCommand (object sender, EventArgs args)
+	{
+		new FSpot.RenameMoveCopy (db.Photos, new FSpot.PhotoArray (SelectedPhotos ()));
+	}
+	
 	void HandleViewFullExif (object sender, EventArgs args)
 	{
 		if (info_display_window != null) {
@@ -2340,6 +2348,7 @@ public class MainWindow {
 		update_thumbnail.Sensitive = active_selection;
 		delete_from_drive.Sensitive = active_selection;
 		
+		rename_pictures_menu_item.Sensitive = active_selection;		
 		send_mail.Sensitive = active_selection;
 		print.Sensitive = active_selection;
 		export.Sensitive = active_selection;
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/f-spot/src/Makefile.am,v
retrieving revision 1.56
diff -u -p -r1.56 Makefile.am
--- Makefile.am	24 Jan 2006 04:49:17 -0000	1.56
+++ Makefile.am	3 Feb 2006 23:08:51 -0000
@@ -97,6 +97,7 @@ F_SPOT_CSDISTFILES =				\
 	$(srcdir)/ProgressDialog.cs		\
 	$(srcdir)/RafFile.cs			\
 	$(srcdir)/RotateCommand.cs		\
+	$(srcdir)/RenameMoveCopy.cs             \
 	$(srcdir)/ScalingIconView.cs		\
 	$(srcdir)/SlideView.cs			\
 	$(srcdir)/SingleView.cs			\
Index: PhotoStore.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/PhotoStore.cs,v
retrieving revision 1.85
diff -u -p -r1.85 PhotoStore.cs
--- PhotoStore.cs	23 Jan 2006 21:04:52 -0000	1.85
+++ PhotoStore.cs	3 Feb 2006 23:08:52 -0000
@@ -368,6 +368,36 @@ public class Photo : DbItem, IComparable
 		version_names [version_id] = new_name;
 	}
 
+    public void RenameFile (string new_base)
+    {
+		string version_name;
+		string old_path;
+		string new_path;
+		string new_name = new_base + System.IO.Path.GetExtension (name);
+		for (uint version_id = OriginalVersionId; version_id <= highest_version_id; version_id++) {
+			if (version_id == OriginalVersionId) {
+				old_path = Path;                                                                                        // Old photo file name
+				new_path = new_base + System.IO.Path.GetExtension (name);       // New photo file name
+			} else {
+				version_name = version_names [version_id] as string;
+				old_path = GetVersionPath (version_id);
+				new_path = new_base + " (" + version_name + ")" + System.IO.Path.GetExtension (name);   // new photo file name
+			}
+
+			if (File.Exists (new_path))
+				throw new Exception ("File with this name already exists");
+
+			File.Move (old_path, new_path);
+
+			PhotoStore.MoveThumbnail (old_path, new_path);
+
+		} // for
+
+		// Set the Original name.
+		directory_path = System.IO.Path.GetDirectoryName (new_base);
+		name = System.IO.Path.GetFileName (new_name);
+	} // RenameFile
+
 
 	// Tag management.
 
@@ -1024,13 +1054,17 @@ public class PhotoStore : DbStore {
 		SqliteCommand command = new SqliteCommand ();
 		command.Connection = Connection;
 		command.CommandText = String.Format ("UPDATE photos SET description = '{0}',     " +
-						     "                  default_version_id = {1}, " +
-						     "                  time = {2} " +
-						     "              WHERE id = {3}",
-						     SqlString (photo.Description),
-						     photo.DefaultVersionId,
-						     DbUtils.UnixTimeFromDateTime (photo.Time),
-						     photo.Id);
+												"              default_version_id = {1}, " +
+												"              directory_path = '{2}',   " +
+												"              name = '{3}' ,             " +
+												"               time = {4} " +
+												"              WHERE id = {5}            ",
+							SqlString (photo.Description),
+							photo.DefaultVersionId,
+							SqlString (photo.DirectoryPath),
+							SqlString (photo.Name),
+							DbUtils.UnixTimeFromDateTime (photo.Time),
+							photo.Id);
 		command.ExecuteNonQuery ();
 		command.Dispose ();
 
Index: f-spot.glade
===================================================================
RCS file: /cvs/gnome/f-spot/src/f-spot.glade,v
retrieving revision 1.145
diff -u -p -r1.145 f-spot.glade
--- f-spot.glade	30 Jan 2006 07:14:28 -0000	1.145
+++ f-spot.glade	3 Feb 2006 23:09:10 -0000
@@ -6965,6 +6965,15 @@ Photo Details</property>
 		  </child>
 
 		  <child>
+		    <widget class="GtkMenuItem" id="rename_pictures_menu_item">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Rename/Move/Copy...</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="HandleRenamePicturesCommand" last_modification_time="Sun, 31 Jul 2005 04:24:02 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
 		    <widget class="GtkSeparatorMenuItem" id="separator1">
 		      <property name="visible">True</property>
 		    </widget>
@@ -12760,6 +12769,1158 @@ Custom
 		  <property name="padding">0</property>
 		  <property name="expand">False</property>
 		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="rename_dialog">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Rename / Move / Copy</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox15">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+	<widget class="GtkHButtonBox" id="dialog-action_area15">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+	  <child>
+	    <widget class="GtkButton" id="cancelbutton7">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-cancel</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-6</property>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="okbutton8">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-ok</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-5</property>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	  <property name="pack_type">GTK_PACK_END</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkVBox" id="vbox74">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkFrame" id="frame44">
+	      <property name="border_width">6</property>
+	      <property name="visible">True</property>
+	      <property name="label_xalign">0</property>
+	      <property name="label_yalign">0.5</property>
+	      <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment54">
+		  <property name="visible">True</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">1</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">12</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox75">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkRadioButton" id="rename_radio">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Same as source (just rename)</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>
+			  <signal name="toggled" handler="on_rename_radio_toggled" last_modification_time="Fri, 05 Aug 2005 12:08:05 GMT"/>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkTable" id="table22">
+			  <property name="visible">True</property>
+			  <property name="n_rows">2</property>
+			  <property name="n_columns">3</property>
+			  <property name="homogeneous">False</property>
+			  <property name="row_spacing">0</property>
+			  <property name="column_spacing">0</property>
+
+			  <child>
+			    <widget class="GtkRadioButton" id="move_radio">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Move picture to </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>
+			      <property name="group">rename_radio</property>
+			      <signal name="toggled" handler="on_move_radio_toggled" last_modification_time="Mon, 01 Aug 2005 01:26:00 GMT"/>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkRadioButton" id="copy_radio">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Copy picture to </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>
+			      <property name="group">rename_radio</property>
+			      <signal name="toggled" handler="on_copy_radio_toggled" last_modification_time="Mon, 01 Aug 2005 01:26:37 GMT"/>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkEntry" id="move_target_entry">
+			      <property name="visible">True</property>
+			      <property name="sensitive">False</property>
+			      <property name="can_focus">True</property>
+			      <property name="editable">True</property>
+			      <property name="visibility">True</property>
+			      <property name="max_length">0</property>
+			      <property name="text" translatable="yes"></property>
+			      <property name="has_frame">True</property>
+			      <property name="invisible_char">*</property>
+			      <property name="activates_default">False</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkEntry" id="copy_target_entry">
+			      <property name="visible">True</property>
+			      <property name="sensitive">False</property>
+			      <property name="can_focus">True</property>
+			      <property name="editable">True</property>
+			      <property name="visibility">True</property>
+			      <property name="max_length">0</property>
+			      <property name="text" translatable="yes"></property>
+			      <property name="has_frame">True</property>
+			      <property name="invisible_char">*</property>
+			      <property name="activates_default">False</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkButton" id="move_target_folderpopup_button">
+			      <property name="visible">True</property>
+			      <property name="sensitive">False</property>
+			      <property name="can_focus">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <signal name="clicked" handler="HandleSelectTargetMoveDirectory" last_modification_time="Mon, 01 Aug 2005 01:09:29 GMT"/>
+
+			      <child>
+				<widget class="GtkAlignment" id="alignment58">
+				  <property name="visible">True</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xscale">0</property>
+				  <property name="yscale">0</property>
+				  <property name="top_padding">0</property>
+				  <property name="bottom_padding">0</property>
+				  <property name="left_padding">0</property>
+				  <property name="right_padding">0</property>
+
+				  <child>
+				    <widget class="GtkHBox" id="hbox64">
+				      <property name="visible">True</property>
+				      <property name="homogeneous">False</property>
+				      <property name="spacing">2</property>
+
+				      <child>
+					<widget class="GtkImage" id="image15">
+					  <property name="visible">True</property>
+					  <property name="stock">gtk-open</property>
+					  <property name="icon_size">4</property>
+					  <property name="xalign">0.5</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+
+				      <child>
+					<widget class="GtkLabel" id="label170">
+					  <property name="visible">True</property>
+					  <property name="label" translatable="yes">...</property>
+					  <property name="use_underline">True</property>
+					  <property name="use_markup">False</property>
+					  <property name="justify">GTK_JUSTIFY_LEFT</property>
+					  <property name="wrap">False</property>
+					  <property name="selectable">False</property>
+					  <property name="xalign">0.5</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+					  <property name="width_chars">-1</property>
+					  <property name="single_line_mode">False</property>
+					  <property name="angle">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">2</property>
+			      <property name="right_attach">3</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkButton" id="copy_target_folderpopup_button">
+			      <property name="visible">True</property>
+			      <property name="sensitive">False</property>
+			      <property name="can_focus">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <signal name="clicked" handler="HandleSelectTargetCopyDirectory" last_modification_time="Mon, 01 Aug 2005 01:23:58 GMT"/>
+
+			      <child>
+				<widget class="GtkAlignment" id="alignment62">
+				  <property name="visible">True</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xscale">0</property>
+				  <property name="yscale">0</property>
+				  <property name="top_padding">0</property>
+				  <property name="bottom_padding">0</property>
+				  <property name="left_padding">0</property>
+				  <property name="right_padding">0</property>
+
+				  <child>
+				    <widget class="GtkHBox" id="hbox67">
+				      <property name="visible">True</property>
+				      <property name="homogeneous">False</property>
+				      <property name="spacing">2</property>
+
+				      <child>
+					<widget class="GtkImage" id="image17">
+					  <property name="visible">True</property>
+					  <property name="stock">gtk-open</property>
+					  <property name="icon_size">4</property>
+					  <property name="xalign">0.5</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+
+				      <child>
+					<widget class="GtkLabel" id="label184">
+					  <property name="visible">True</property>
+					  <property name="label" translatable="yes">...</property>
+					  <property name="use_underline">True</property>
+					  <property name="use_markup">False</property>
+					  <property name="justify">GTK_JUSTIFY_LEFT</property>
+					  <property name="wrap">False</property>
+					  <property name="selectable">False</property>
+					  <property name="xalign">0.5</property>
+					  <property name="yalign">0.5</property>
+					  <property name="xpad">0</property>
+					  <property name="ypad">0</property>
+					  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+					  <property name="width_chars">-1</property>
+					  <property name="single_line_mode">False</property>
+					  <property name="angle">0</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">2</property>
+			      <property name="right_attach">3</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label166">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Destination&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="type">label_item</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkFrame" id="frame45">
+	      <property name="border_width">6</property>
+	      <property name="visible">True</property>
+	      <property name="label_xalign">0</property>
+	      <property name="label_yalign">0.5</property>
+	      <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment55">
+		  <property name="visible">True</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">1</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">12</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox76">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkRadioButton" id="no_subdir_radio">
+			  <property name="visible">True</property>
+			  <property name="sensitive">False</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">No (&lt;target directory&gt;/&lt;Pictures&gt;)</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>
+
+		      <child>
+			<widget class="GtkRadioButton" id="year_subdir_radio">
+			  <property name="visible">True</property>
+			  <property name="sensitive">False</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">&lt;target directory&gt;/&lt;Year&gt;/&lt;Pictures&gt;</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>
+			  <property name="group">no_subdir_radio</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkRadioButton" id="year_month_subdir_radio">
+			  <property name="visible">True</property>
+			  <property name="sensitive">False</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">&lt;target directory&gt;/&lt;Year&gt;/&lt;Month&gt;/&lt;Pictures&gt;</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>
+			  <property name="group">no_subdir_radio</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkRadioButton" id="year_month_day_subdir_radio">
+			  <property name="visible">True</property>
+			  <property name="sensitive">False</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">&lt;target directory&gt;/&lt;Year&gt;/&lt;Month&gt;/&lt;Day&gt;/&lt;Pictures&gt;</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>
+			  <property name="group">no_subdir_radio</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label167">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Create sub directories?&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="type">label_item</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkFrame" id="frame46">
+	      <property name="border_width">6</property>
+	      <property name="visible">True</property>
+	      <property name="label_xalign">0</property>
+	      <property name="label_yalign">0.5</property>
+	      <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment56">
+		  <property name="visible">True</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">1</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">12</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkVBox" id="vbox77">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkTable" id="table23">
+			  <property name="visible">True</property>
+			  <property name="n_rows">3</property>
+			  <property name="n_columns">2</property>
+			  <property name="homogeneous">False</property>
+			  <property name="row_spacing">0</property>
+			  <property name="column_spacing">0</property>
+
+			  <child>
+			    <widget class="GtkLabel" id="label171">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Original name (sample) </property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label172">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">New name (sample)</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label173">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Pattern of new name</property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">10</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">0</property>
+			      <property name="right_attach">1</property>
+			      <property name="top_attach">2</property>
+			      <property name="bottom_attach">3</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkEntry" id="pattern_name_entry">
+			      <property name="visible">True</property>
+			      <property name="tooltip" translatable="yes">&lt;YYYY&gt; 		Long year (2006)
+&lt;YY&gt;		Short year (06)
+&lt;MM&gt;		Month (02)
+&lt;DD&gt;		Day (30)
+&lt;hh&gt;		Hour (15)
+&lt;mm&gt;		Minute (58)
+&lt;ss&gt;		Second (56)
+&lt;orig&gt;		The original file name (without number serie)</property>
+			      <property name="can_focus">True</property>
+			      <property name="editable">True</property>
+			      <property name="visibility">True</property>
+			      <property name="max_length">0</property>
+			      <property name="text" translatable="yes"></property>
+			      <property name="has_frame">True</property>
+			      <property name="invisible_char">*</property>
+			      <property name="activates_default">False</property>
+			      <signal name="changed" handler="on_pattern_name_entry_changed" last_modification_time="Mon, 01 Aug 2005 02:35:30 GMT"/>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">2</property>
+			      <property name="bottom_attach">3</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="preview_new_name_text">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes"></property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">1</property>
+			      <property name="bottom_attach">2</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="preview_original_name_text">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes"></property>
+			      <property name="use_underline">False</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="left_attach">1</property>
+			      <property name="right_attach">2</property>
+			      <property name="top_attach">0</property>
+			      <property name="bottom_attach">1</property>
+			      <property name="x_options">fill</property>
+			      <property name="y_options"></property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkHBox" id="hbox65">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">0</property>
+
+			  <child>
+			    <widget class="GtkFrame" id="frame47">
+			      <property name="border_width">6</property>
+			      <property name="visible">True</property>
+			      <property name="label_xalign">0</property>
+			      <property name="label_yalign">0.5</property>
+			      <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+			      <child>
+				<widget class="GtkAlignment" id="alignment59">
+				  <property name="visible">True</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xscale">1</property>
+				  <property name="yscale">1</property>
+				  <property name="top_padding">0</property>
+				  <property name="bottom_padding">0</property>
+				  <property name="left_padding">12</property>
+				  <property name="right_padding">0</property>
+
+				  <child>
+				    <widget class="GtkVBox" id="vbox78">
+				      <property name="visible">True</property>
+				      <property name="homogeneous">False</property>
+				      <property name="spacing">0</property>
+
+				      <child>
+					<widget class="GtkRadioButton" id="no_number_serie_radio">
+					  <property name="visible">True</property>
+					  <property name="can_focus">True</property>
+					  <property name="label" translatable="yes">No</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>
+					  <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:29:20 GMT"/>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+
+				      <child>
+					<widget class="GtkRadioButton" id="original_number_serie_radio">
+					  <property name="visible">True</property>
+					  <property name="can_focus">True</property>
+					  <property name="label" translatable="yes">Original (the last digits in the file names)</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>
+					  <property name="group">no_number_serie_radio</property>
+					  <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:29:12 GMT"/>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+
+				      <child>
+					<widget class="GtkHBox" id="hbox66">
+					  <property name="visible">True</property>
+					  <property name="homogeneous">False</property>
+					  <property name="spacing">0</property>
+
+					  <child>
+					    <widget class="GtkRadioButton" id="new_number_serie_radio">
+					      <property name="visible">True</property>
+					      <property name="can_focus">True</property>
+					      <property name="label" translatable="yes">Start at </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>
+					      <property name="group">no_number_serie_radio</property>
+					      <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:29:04 GMT"/>
+					    </widget>
+					    <packing>
+					      <property name="padding">0</property>
+					      <property name="expand">False</property>
+					      <property name="fill">False</property>
+					    </packing>
+					  </child>
+
+					  <child>
+					    <widget class="GtkHBox" id="hbox68">
+					      <property name="visible">True</property>
+					      <property name="homogeneous">False</property>
+					      <property name="spacing">0</property>
+
+					      <child>
+						<widget class="GtkEntry" id="new_number_serie_start_entry">
+						  <property name="visible">True</property>
+						  <property name="sensitive">False</property>
+						  <property name="can_focus">True</property>
+						  <property name="editable">True</property>
+						  <property name="visibility">True</property>
+						  <property name="max_length">5</property>
+						  <property name="text" translatable="yes"></property>
+						  <property name="has_frame">True</property>
+						  <property name="invisible_char">*</property>
+						  <property name="activates_default">False</property>
+						  <property name="width_chars">5</property>
+						  <signal name="changed" handler="on_new_number_serie_start_entry_changed" last_modification_time="Mon, 01 Aug 2005 10:30:14 GMT"/>
+						</widget>
+						<packing>
+						  <property name="padding">0</property>
+						  <property name="expand">False</property>
+						  <property name="fill">False</property>
+						</packing>
+					      </child>
+
+					      <child>
+						<widget class="GtkLabel" id="padd_to_label">
+						  <property name="visible">True</property>
+						  <property name="sensitive">False</property>
+						  <property name="label" translatable="yes">Padd to</property>
+						  <property name="use_underline">False</property>
+						  <property name="use_markup">False</property>
+						  <property name="justify">GTK_JUSTIFY_LEFT</property>
+						  <property name="wrap">False</property>
+						  <property name="selectable">False</property>
+						  <property name="xalign">0.5</property>
+						  <property name="yalign">0.5</property>
+						  <property name="xpad">10</property>
+						  <property name="ypad">0</property>
+						  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+						  <property name="width_chars">-1</property>
+						  <property name="single_line_mode">False</property>
+						  <property name="angle">0</property>
+						</widget>
+						<packing>
+						  <property name="padding">0</property>
+						  <property name="expand">False</property>
+						  <property name="fill">False</property>
+						</packing>
+					      </child>
+
+					      <child>
+						<widget class="GtkHBox" id="hbox69">
+						  <property name="visible">True</property>
+						  <property name="homogeneous">False</property>
+						  <property name="spacing">0</property>
+
+						  <child>
+						    <widget class="GtkRadioButton" id="padd_1_radio">
+						      <property name="visible">True</property>
+						      <property name="sensitive">False</property>
+						      <property name="can_focus">True</property>
+						      <property name="label" translatable="yes">1</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>
+						      <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:28:30 GMT"/>
+						    </widget>
+						    <packing>
+						      <property name="padding">0</property>
+						      <property name="expand">False</property>
+						      <property name="fill">False</property>
+						    </packing>
+						  </child>
+
+						  <child>
+						    <widget class="GtkRadioButton" id="padd_01_radio">
+						      <property name="visible">True</property>
+						      <property name="sensitive">False</property>
+						      <property name="can_focus">True</property>
+						      <property name="label" translatable="yes">01</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>
+						      <property name="group">padd_1_radio</property>
+						      <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:28:36 GMT"/>
+						    </widget>
+						    <packing>
+						      <property name="padding">0</property>
+						      <property name="expand">False</property>
+						      <property name="fill">False</property>
+						    </packing>
+						  </child>
+
+						  <child>
+						    <widget class="GtkRadioButton" id="padd_001_radio">
+						      <property name="visible">True</property>
+						      <property name="sensitive">False</property>
+						      <property name="can_focus">True</property>
+						      <property name="label" translatable="yes">001</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>
+						      <property name="group">padd_1_radio</property>
+						      <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:28:43 GMT"/>
+						    </widget>
+						    <packing>
+						      <property name="padding">0</property>
+						      <property name="expand">False</property>
+						      <property name="fill">False</property>
+						    </packing>
+						  </child>
+
+						  <child>
+						    <widget class="GtkRadioButton" id="padd_0001_radio">
+						      <property name="visible">True</property>
+						      <property name="sensitive">False</property>
+						      <property name="can_focus">True</property>
+						      <property name="label" translatable="yes">0001</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>
+						      <property name="group">padd_1_radio</property>
+						      <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:28:49 GMT"/>
+						    </widget>
+						    <packing>
+						      <property name="padding">0</property>
+						      <property name="expand">False</property>
+						      <property name="fill">False</property>
+						    </packing>
+						  </child>
+
+						  <child>
+						    <widget class="GtkRadioButton" id="padd_00001_radio">
+						      <property name="visible">True</property>
+						      <property name="sensitive">False</property>
+						      <property name="can_focus">True</property>
+						      <property name="label" translatable="yes">00001</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>
+						      <property name="group">padd_1_radio</property>
+						      <signal name="toggled" handler="on_number_radio_toggled" last_modification_time="Mon, 01 Aug 2005 10:28:55 GMT"/>
+						    </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>
+						  <property name="expand">True</property>
+						  <property name="fill">True</property>
+						</packing>
+					      </child>
+					    </widget>
+					    <packing>
+					      <property name="padding">0</property>
+					      <property name="expand">False</property>
+					      <property name="fill">True</property>
+					    </packing>
+					  </child>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label174">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">&lt;b&gt;Append a number serie&lt;/b&gt;</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">True</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="type">label_item</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label168">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Picture name pattern&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="type">label_item</property>
 		</packing>
 	      </child>
 	    </widget>
--- /dev/null	2006-01-28 10:39:36.246703448 +1100
+++ RenameMoveCopy.cs	2006-02-04 09:35:58.359177012 +1100
@@ -0,0 +1,470 @@
+//
+// RenameMoveCopy.cs: Renames, moves or copies one or more images,
+//			with possible its different versions.
+//
+// Fixes F-Spot enhancement bug 302566 
+//	(http://bugzilla.gnome.org/show_bug.cgi?id=302566)
+//
+// Author:
+//   Bengt Thuree (bengt@thuree.com)
+//
+
+using System.IO;
+using System; 
+using Gtk;
+
+
+namespace FSpot {
+	public class RenameMoveCopy : GladeDialog {
+		IBrowsableCollection selection;
+		PhotoStore store;
+
+		[Glade.Widget] private Gtk.RadioButton rename_radio;
+		[Glade.Widget] private Gtk.RadioButton move_radio;
+		[Glade.Widget] private Gtk.RadioButton copy_radio;
+		[Glade.Widget] private Gtk.Entry move_target_entry;
+		[Glade.Widget] private Gtk.Button move_target_folderpopup_button;
+		[Glade.Widget] private Gtk.Entry copy_target_entry;
+		[Glade.Widget] private Gtk.Button copy_target_folderpopup_button;
+
+		[Glade.Widget] private Gtk.RadioButton no_subdir_radio;
+		[Glade.Widget] private Gtk.RadioButton year_subdir_radio;
+		[Glade.Widget] private Gtk.RadioButton year_month_subdir_radio;
+		[Glade.Widget] private Gtk.RadioButton year_month_day_subdir_radio;
+
+		[Glade.Widget] private Gtk.Label preview_original_name_text;
+		[Glade.Widget] private Gtk.Label preview_new_name_text;
+		[Glade.Widget] private Gtk.Entry pattern_name_entry;
+
+		[Glade.Widget] private Gtk.RadioButton no_number_serie_radio;
+		[Glade.Widget] private Gtk.RadioButton original_number_serie_radio;
+		[Glade.Widget] private Gtk.RadioButton new_number_serie_radio;
+		[Glade.Widget] private Gtk.Entry new_number_serie_start_entry;
+		[Glade.Widget] private Gtk.Label padd_to_label;
+		[Glade.Widget] private Gtk.RadioButton padd_1_radio;
+		[Glade.Widget] private Gtk.RadioButton padd_01_radio;
+		[Glade.Widget] private Gtk.RadioButton padd_001_radio;
+		[Glade.Widget] private Gtk.RadioButton padd_0001_radio;
+		[Glade.Widget] private Gtk.RadioButton padd_00001_radio;
+		
+		System.Threading.Thread command_thread;
+		ThreadProgressDialog progress_dialog;
+		ProgressItem progress_item;
+
+		int photo_index;
+		DateTime sampleTime;
+		string NewNamePattern = "";
+		string CommandStr = "";
+		string targetdir = "";
+		bool MoveCopy = false;
+
+		public RenameMoveCopy (PhotoStore store, IBrowsableCollection selection) : base ("rename_dialog")
+		{
+			this.selection = selection;
+			this.store = store;
+
+			Dialog.Modal = false;
+			Dialog.TransientFor = null;
+
+			// We just need the first photo, so exit directly.
+			foreach (IBrowsableItem photo in selection.Items) {
+				preview_original_name_text.Text = System.IO.Path.GetFileNameWithoutExtension (photo.Name);
+				sampleTime = photo.Time; // This is for the pattern sample.
+				break;					
+			}
+			
+//			preview_new_name_text.Text = preview_original_name_text.Text;
+			pattern_name_entry.Text = "<orig>";
+			targetdir = System.Environment.GetEnvironmentVariable ("HOME");
+			move_target_entry.Text = targetdir;			
+			copy_target_entry.Text = targetdir;
+
+			UpdateNewNameSample();
+
+			Dialog.ShowAll ();
+			Dialog.Response += HandleResponse;
+		}
+
+		void SelectTargetDirectory (bool move_activity)
+		{		
+			CompatFileChooserDialog file_selector =
+				new CompatFileChooserDialog (Mono.Posix.Catalog.GetString ("Select Destination"), 
+							     this.Dialog, CompatFileChooserDialog.Action.SelectFolder);
+			
+			if (move_activity)
+				file_selector.Filename = move_target_entry.Text;
+			else
+				file_selector.Filename = copy_target_entry.Text;
+			if (file_selector.Filename == "")
+				file_selector.Filename = targetdir;
+
+			int result = file_selector.Run ();
+			
+			if ((ResponseType)result == ResponseType.Ok)
+				if (move_activity)
+					move_target_entry.Text = file_selector.Filename;
+				else
+					copy_target_entry.Text = file_selector.Filename;
+				
+			file_selector.Destroy ();
+		}
+
+		string paddedNewNumber (int newNumber)
+		{
+			if (padd_01_radio.Active)
+				return (String.Format) ("{0:00}", newNumber);
+			if (padd_001_radio.Active)
+				return (String.Format) ("{0:000}", newNumber);
+			if (padd_0001_radio.Active)
+				return (String.Format) ("{0:0000}", newNumber);
+			if (padd_00001_radio.Active)
+				return (String.Format) ("{0:00000}", newNumber);
+			return (String.Format) ("{0}", newNumber);
+		}
+		
+		string paddedNewNumber (string newNumber)
+		{
+			try {
+				return paddedNewNumber (Int32.Parse(newNumber));
+			}   
+			catch  (Exception e) {
+				HigMessageDialog md = new HigMessageDialog (	Dialog, 
+														DialogFlags.DestroyWithParent,
+														MessageType.Error,
+														ButtonsType.Close, 
+														"Error converting start number",
+														"Please re-enter the start number, and ensure that you type a valid number (0-99999)");
+				int result = md.Run();
+				if (result==0) // Just to get rid of warning message 
+					{}
+				md.Destroy();
+				new_number_serie_start_entry.Text = "";
+			}
+			return "";
+		}
+		
+		bool IsThisCharNumber (string str)
+		{
+			try {
+				return (Int16.Parse(str) >= 0);	// any number is >= 0 --> return true
+			}   
+			catch { // If not a number, an error will be thrown and we return false.
+				return false;
+			}
+		}
+		
+		
+		// This method will return the last digits in the filename (without extension)
+		// for example "filename-1234" --> returns "1234"
+		string getOriginalNumberStr (string origNameNoExt)
+		{
+			if (origNameNoExt.Length == 0) {
+				return "";
+			}
+			int end_pos = origNameNoExt.Length-1;
+			int start_pos = end_pos;
+			if (! IsThisCharNumber (origNameNoExt.Substring(end_pos,1))) {
+				return "";
+			}
+			while ((start_pos > 0) && (IsThisCharNumber (origNameNoExt.Substring(start_pos - 1,1)))) {
+				start_pos = start_pos -1;
+			}
+			return origNameNoExt.Substring(start_pos, end_pos - start_pos + 1);
+		}
+		
+		string GetNextPatternToken (string tmpPattern, int _start_pos)
+		{
+			int NextTokenPos;
+			string _ReturnToken = "";
+			bool cont = true;
+			// If empty string
+			if (_start_pos == tmpPattern.Length)
+				return _ReturnToken;
+			
+			// if starts with "<"
+			if (cont && tmpPattern[_start_pos] == '<') {
+				NextTokenPos=tmpPattern.IndexOf('>', _start_pos);
+				if (NextTokenPos==-1) {	// do not contain end ">", so return all 
+					_ReturnToken = tmpPattern.Substring(_start_pos);
+					return _ReturnToken;
+				}
+				// return the token contained by "<" and ">"
+				_ReturnToken = tmpPattern.Substring(_start_pos, NextTokenPos - _start_pos+1);
+				return _ReturnToken;
+			} // end starts with "<"
+			
+			NextTokenPos=tmpPattern.IndexOf('<', _start_pos);
+			if (NextTokenPos==-1) { // No more start token "<" so return all
+				_ReturnToken = tmpPattern.Substring(_start_pos);
+				return _ReturnToken;
+			}
+			// Return all up to next start token "<"
+			_ReturnToken = tmpPattern.Substring(_start_pos, NextTokenPos - _start_pos);
+			return _ReturnToken;
+		}
+
+		string NewNameFromTarget (string _origNameNoExt, string _orignumber, int new_number, DateTime timeinfo)
+		{
+			int _current_pos = 0;
+			int OriginalNumberLength = _orignumber.Length;
+			int OriginalNameLength = _origNameNoExt.Length;
+			string _origNameNoNumber = _origNameNoExt.Substring (0, OriginalNameLength - OriginalNumberLength);
+
+			string NewName="";
+			string NextPatternToken="";
+			string tmpPattern=pattern_name_entry.Text;
+			while ( _current_pos < tmpPattern.Length ) {
+				NextPatternToken = GetNextPatternToken (tmpPattern, _current_pos);
+				_current_pos += NextPatternToken.Length;
+				switch (NextPatternToken) {
+				case "<YYYY>" 	: 	NewName += timeinfo.ToString("yyyy"); break;
+				case "<YY>" 	: 	NewName += timeinfo.ToString("yy"); break;			
+				case "<MM>" 	: 	NewName += timeinfo.ToString("MM"); break;
+				case "<DD>" 	: 	NewName += timeinfo.ToString("dd"); break;					
+				case "<hh>" 	: 	NewName += timeinfo.ToString("hh"); break;
+				case "<mm>" 	: 	NewName += timeinfo.ToString("mm"); break;				
+				case "<ss>" 	: 	NewName += timeinfo.ToString("ss"); break;
+				case "<orig>" 	: 	NewName += _origNameNoNumber; break;					
+				default:			NewName += NextPatternToken; break;
+				}
+			}
+			if (original_number_serie_radio.Active)
+				NewName += _orignumber;
+			else if ((new_number_serie_radio.Active) && (new_number_serie_start_entry.Text != ""))
+				NewName += paddedNewNumber (new_number);
+			return NewName;
+					
+		}
+
+		void UpdateNewNameSample ()
+		{
+			string NewName = "";
+			string _newNumber = "0";
+			if ((new_number_serie_radio.Active) && (new_number_serie_start_entry.Text != ""))
+				_newNumber = paddedNewNumber (new_number_serie_start_entry.Text);	
+			
+			NewName = NewNameFromTarget (preview_original_name_text.Text, 
+					getOriginalNumberStr (preview_original_name_text.Text), 
+					Int32.Parse(_newNumber),
+					sampleTime );
+
+			preview_new_name_text.Text = NewName;
+		}
+
+		void AddToPattern (string addThis, bool clearPattern)
+		{
+			pattern_name_entry.Text += addThis;
+			if (clearPattern)
+				pattern_name_entry.Text = "";
+		}
+
+		void on_pattern_name_entry_changed (object sender, System.EventArgs args)
+		{		
+			UpdateNewNameSample ();
+		}
+		
+
+		void HandleSelectTargetMoveDirectory (object sender, System.EventArgs args)
+		{		
+			if (move_radio.Active)
+				SelectTargetDirectory(move_radio.Active);
+		}
+
+		void HandleSelectTargetCopyDirectory (object sender, System.EventArgs args)
+		{		
+			if (copy_radio.Active)
+				SelectTargetDirectory(move_radio.Active);
+		}
+		
+
+		void on_rename_radio_toggled (object sender, System.EventArgs args)
+		{		
+			no_subdir_radio.Active = true;
+			no_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_month_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_month_day_subdir_radio.Sensitive = ! rename_radio.Active;
+		}
+
+
+		void on_move_radio_toggled (object sender, System.EventArgs args)
+		{		
+			move_target_entry.Sensitive = move_radio.Active;
+			move_target_folderpopup_button.Sensitive = move_radio.Active;
+			no_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_month_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_month_day_subdir_radio.Sensitive = ! rename_radio.Active;
+		}
+
+		void on_copy_radio_toggled (object sender, System.EventArgs args)
+		{		
+			copy_target_entry.Sensitive = copy_radio.Active;
+			copy_target_folderpopup_button.Sensitive = copy_radio.Active;
+			no_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_month_subdir_radio.Sensitive = ! rename_radio.Active;
+			year_month_day_subdir_radio.Sensitive = ! rename_radio.Active;
+		}
+		
+		void on_number_radio_toggled (object sender, System.EventArgs args)
+		{		
+			new_number_serie_start_entry.Sensitive = new_number_serie_radio.Active;
+			padd_to_label.Sensitive = new_number_serie_radio.Active;
+			padd_1_radio.Sensitive = new_number_serie_radio.Active;
+			padd_01_radio.Sensitive = new_number_serie_radio.Active;
+			padd_001_radio.Sensitive = new_number_serie_radio.Active;	
+			padd_0001_radio.Sensitive = new_number_serie_radio.Active;	
+			padd_00001_radio.Sensitive = new_number_serie_radio.Active;	
+			UpdateNewNameSample ();
+		}
+
+		void on_new_number_serie_start_entry_changed (object sender, System.EventArgs args)
+		{		
+			UpdateNewNameSample ();
+		}
+
+		private void HandleProgressChanged (ProgressItem item)
+		{
+			//System.Console.WriteLine ("Changed value = {0}", item.Value);
+			progress_dialog.Fraction = (photo_index - 1.0 + item.Value) / (double) selection.Count;	
+		}
+		
+
+		private void DoWork() 
+		{
+			FSpot.ProgressItem Progress = new ProgressItem ();
+			Progress.Changed += HandleProgressChanged;
+			photo_index = 0;
+			int NewNumberIndex = 0;
+			if (new_number_serie_radio.Active)
+				NewNumberIndex = Int32.Parse(new_number_serie_start_entry.Text);
+			try {
+
+				foreach (IBrowsableItem item in selection.Items) {
+					Photo photo = (Photo) item;
+					progress_dialog.Message = System.String.Format (
+                     		                         Mono.Posix.Catalog.GetString ("\"{0}\" picture \"{1}\""), CommandStr, photo.Name);
+					progress_dialog.Fraction = photo_index / (double) selection.Count;
+					photo_index++;
+					progress_dialog.ProgressText = System.String.Format (
+								Mono.Posix.Catalog.GetString ("{0} of {1}"), photo_index, selection.Count);
+								
+					string origpath = photo.DirectoryPath;
+					string origNameNoExt = Path.GetFileNameWithoutExtension (photo.Name);
+					string origNumber = getOriginalNumberStr (origNameNoExt);
+					string origDefaultVersion = photo.DefaultVersionPath;
+					System.Console.WriteLine ("Name = {0}, Path = {1}, origNumber = {2}", origNameNoExt, origpath, origNumber );					
+					string Newpath = origpath; // default (rename) same as original path
+					if (copy_radio.Active || move_radio.Active)
+						Newpath = targetdir;
+
+					Newpath = Newpath + "/";	// Ensure the path ends with "/"
+					// if create subdir, create them here
+					if (year_subdir_radio.Active)  {
+						string yearstr = photo.Time.ToString("yyyy");		
+						Newpath = Newpath + "/" + yearstr + "/";
+						Directory.CreateDirectory ( Newpath );
+					} else							
+						if (year_month_subdir_radio.Active) {
+							string yearstr  = photo.Time.ToString("yyyy");		
+							string monthstr = photo.Time.ToString("MM");						
+							Newpath = Newpath + "/" + yearstr + "/" + monthstr + "/";
+							Directory.CreateDirectory ( Newpath );
+						} else							
+							if (year_month_day_subdir_radio.Active) {
+								string yearstr  = photo.Time.ToString("yyyy");		
+								string monthstr = photo.Time.ToString("MM");						
+								string daystr = photo.Time.ToString("dd");						
+								Newpath = Newpath + "/" + yearstr + "/" + monthstr + "/" + daystr  + "/";
+								Directory.CreateDirectory ( Newpath );
+							}	
+					
+					if (copy_radio.Active) {
+
+						string NewName = Newpath + NewNameFromTarget (origNameNoExt,
+								origNumber, 
+								NewNumberIndex, photo.Time) + Path.GetExtension (photo.Name);
+						System.Console.WriteLine ("Copying {0} to {1}", origDefaultVersion, NewName );
+						File.Copy (origDefaultVersion, NewName);
+					} else {
+							
+							// Do the actual rename/move 						
+							System.Console.WriteLine ("Moving/Renaming {0}", Newpath );
+							string NewBase = Newpath + 
+											NewNameFromTarget (origNameNoExt, 
+												origNumber, 
+												NewNumberIndex, 
+												photo.Time);
+							System.Console.WriteLine ("Moving/Renaming {0}, new base={1}", origNameNoExt, NewBase );
+							photo.RenameFile (NewBase);
+							store.Commit(photo);
+						}
+
+					NewNumberIndex++; // increase the number index...
+				} // foreach photo
+				progress_dialog.Message = System.String.Format (
+						Mono.Posix.Catalog.GetString ("Done \"{0}\" Photos"), CommandStr);
+				progress_dialog.Fraction = 1.0;
+				progress_dialog.ProgressText = System.String.Format (
+						Mono.Posix.Catalog.GetString ("\"{0}\" Complete"), CommandStr);
+				progress_dialog.ButtonLabel = Gtk.Stock.Ok;
+
+			} catch (System.Exception e) {
+// FIXME
+// HOW to recover if failure???
+			
+				progress_dialog.Message = e.ToString ();
+				progress_dialog.ProgressText = System.String.Format (
+					Mono.Posix.Catalog.GetString ("Error \"{0}\" pictures"), CommandStr);
+			}
+		}
+
+		
+		private void HandleResponse (object sender, Gtk.ResponseArgs args)
+		{
+			if (args.ResponseId != Gtk.ResponseType.Ok) {
+				Dialog.Destroy ();
+				return;
+			}
+			
+			if (rename_radio.Active) {
+				CommandStr = Mono.Posix.Catalog.GetString ("Renaming");
+				MoveCopy = false;
+			}
+			if (copy_radio.Active) {
+				CommandStr = Mono.Posix.Catalog.GetString ("Copying");
+				targetdir = copy_target_entry.Text;
+				MoveCopy = true;
+			}
+			if (move_radio.Active) {
+				CommandStr = Mono.Posix.Catalog.GetString ("Moving");
+				targetdir = move_target_entry.Text;
+				MoveCopy = true;
+			}
+
+			if (MoveCopy && targetdir == "") {
+				HigMessageDialog md = new HigMessageDialog (Dialog, 
+									    Gtk.DialogFlags.Modal |
+									    Gtk.DialogFlags.DestroyWithParent,
+									    Gtk.MessageType.Error, Gtk.ButtonsType.Ok, 
+									    Mono.Posix.Catalog.GetString ("Target directory is empty."),
+									    Mono.Posix.Catalog.GetString ("To copy or move we have to have a target directory."));
+				md.Run ();
+				md.Destroy ();
+				return;
+			} else {
+
+				command_thread = new  System.Threading.Thread (new System.Threading.ThreadStart (this.DoWork));
+
+				command_thread.Name = CommandStr + Mono.Posix.Catalog.GetString (" pictures" );
+			
+				Dialog.Destroy ();
+				progress_dialog = new FSpot.ThreadProgressDialog (command_thread, selection.Count);
+				progress_dialog.Start ();
+			}
+		}
+		
+	} // RenameMoveCopy
+
+} // NameSpace
