Index: gedit/dialogs/gedit-preferences-dialog.glade
===================================================================
--- gedit/dialogs/gedit-preferences-dialog.glade	(revision 5425)
+++ gedit/dialogs/gedit-preferences-dialog.glade	(working copy)
@@ -17,6 +17,7 @@
   <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">False</property>
 
   <child internal-child="vbox">
@@ -1084,6 +1085,127 @@
 			  </child>
 
 			  <child>
+			    <widget class="GtkHBox" id="hbox166">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label884">
+				  <property name="width_request">24</property>
+				  <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.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>
+
+			      <child>
+				<widget class="GtkVBox" id="backup_dir_vbox">
+				  <property name="visible">True</property>
+				  <property name="homogeneous">False</property>
+				  <property name="spacing">6</property>
+
+				  <child>
+				    <widget class="GtkRadioButton" id="backup_cur_dir_radio">
+				      <property name="visible">True</property>
+				      <property name="can_focus">True</property>
+				      <property name="label" translatable="yes">In the file's current folder</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="GtkHBox" id="hbox167">
+				      <property name="visible">True</property>
+				      <property name="homogeneous">False</property>
+				      <property name="spacing">6</property>
+
+				      <child>
+					<widget class="GtkRadioButton" id="backup_other_dir_radio">
+					  <property name="visible">True</property>
+					  <property name="can_focus">True</property>
+					  <property name="label" translatable="yes">In folder</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">backup_cur_dir_radio</property>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+
+				      <child>
+					<widget class="GtkFileChooserButton" id="backup_dir_button">
+					  <property name="visible">True</property>
+					  <property name="title" translatable="yes">Select Folder</property>
+					  <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+					  <property name="local_only">True</property>
+					  <property name="show_hidden">False</property>
+					  <property name="do_overwrite_confirmation">False</property>
+					  <property name="width_chars">-1</property>
+					</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">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">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
 			    <widget class="GtkHBox" id="autosave_hbox">
 			      <property name="visible">True</property>
 			      <property name="homogeneous">False</property>
@@ -1289,7 +1411,7 @@
 			    <widget class="GtkCheckButton" id="default_font_checkbutton">
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
-			      <property name="label" translatable="no">_Use the system fixed width font (%s)</property>
+			      <property name="label">_Use the system fixed width font (%s)</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
 			      <property name="focus_on_click">True</property>
Index: gedit/dialogs/gedit-preferences-dialog.c
===================================================================
--- gedit/dialogs/gedit-preferences-dialog.c	(revision 5425)
+++ gedit/dialogs/gedit-preferences-dialog.c	(working copy)
@@ -103,6 +103,10 @@
 
 	/* File Saving */
 	GtkWidget	*backup_copy_checkbutton;
+	GtkWidget	*backup_dir_vbox;
+	GtkWidget	*backup_cur_dir_radio;
+	GtkWidget	*backup_other_dir_radio;
+	GtkWidget	*backup_dir_button;
 	GtkWidget	*auto_save_checkbutton;
 	GtkWidget	*auto_save_spinbutton;
 	GtkWidget	*autosave_hbox;
@@ -249,9 +253,65 @@
 	g_return_if_fail (button == GTK_TOGGLE_BUTTON (dlg->priv->backup_copy_checkbutton));
 	
 	gedit_prefs_manager_set_create_backup_copy (gtk_toggle_button_get_active (button));
+
+	gtk_widget_set_sensitive(dlg->priv->backup_dir_vbox,
+				 gedit_prefs_manager_get_create_backup_copy ());
 }
 
 static void
+set_backup_copy_dir_pref_to_chooser_value (GeditPreferencesDialog *dlg)
+{
+	gchar *directory_uri;
+	gchar *directory_path;
+
+	if (gedit_prefs_manager_backup_copy_directory_can_set () == TRUE)
+	{
+		directory_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dlg->priv->backup_dir_button));
+		directory_path = gnome_vfs_get_local_path_from_uri (directory_uri);
+
+		gedit_prefs_manager_set_backup_copy_directory (directory_path);
+
+		g_free (directory_path);
+		g_free (directory_uri);
+	}
+}
+
+static void
+backup_dir_radiobutton_toggled (GtkToggleButton		*button,
+				GeditPreferencesDialog	*dlg)
+{
+	gedit_debug (DEBUG_PREFS);
+	
+	if (gedit_prefs_manager_backups_in_current_dir_can_set () == TRUE)
+	{
+		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_cur_dir_radio)))
+		{	/* we are using current dir */
+			gedit_prefs_manager_set_backups_in_current_dir (TRUE);
+		}
+		else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_other_dir_radio)))
+		{
+			gedit_prefs_manager_set_backups_in_current_dir (FALSE);
+		}
+		else
+		{	/* neither of them are active - something's wrong */	}
+	}
+
+	gtk_widget_set_sensitive (dlg->priv->backup_dir_button,
+				  !gedit_prefs_manager_get_backups_in_current_dir ());
+}
+
+static void
+backup_dir_button_selection_changed (GtkFileChooser		*button,
+				  GeditPreferencesDialog	*dlg)
+{
+	gedit_debug (DEBUG_PREFS);
+
+	g_return_if_fail (button == GTK_FILE_CHOOSER (dlg->priv->backup_dir_button));
+
+	set_backup_copy_dir_pref_to_chooser_value (dlg);
+}
+
+static void
 auto_save_spinbutton_value_changed (GtkSpinButton          *spin_button,
 				    GeditPreferencesDialog *dlg)
 {
@@ -265,6 +325,8 @@
 setup_editor_page (GeditPreferencesDialog *dlg)
 {
 	gboolean auto_save;
+	gboolean backup_copy;
+	gchar *backup_dir;
 	gint auto_save_interval;
 
 	gedit_debug (DEBUG_PREFS);
@@ -276,8 +338,18 @@
 				      gedit_prefs_manager_get_insert_spaces ());
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->auto_indent_checkbutton), 
 				      gedit_prefs_manager_get_auto_indent ());
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_cur_dir_radio),
+				      gedit_prefs_manager_get_backups_in_current_dir ());
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_other_dir_radio),
+				      !gedit_prefs_manager_get_backups_in_current_dir ());
+
+	backup_dir = gedit_prefs_manager_get_backup_copy_directory ();
+	gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (dlg->priv->backup_dir_button), backup_dir);
+	g_free (backup_dir);
+
+	backup_copy = gedit_prefs_manager_get_create_backup_copy();
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_copy_checkbutton),
-				      gedit_prefs_manager_get_create_backup_copy ());
+				      backup_copy);
 
 	auto_save = gedit_prefs_manager_get_auto_save ();
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->auto_save_checkbutton),
@@ -299,6 +371,11 @@
 				  gedit_prefs_manager_auto_indent_can_set ());
 	gtk_widget_set_sensitive (dlg->priv->backup_copy_checkbutton,
 				  gedit_prefs_manager_create_backup_copy_can_set ());
+	gtk_widget_set_sensitive (dlg->priv->backup_dir_button,
+				  !gedit_prefs_manager_get_backups_in_current_dir ());
+	gtk_widget_set_sensitive (dlg->priv->backup_dir_vbox,
+				  gedit_prefs_manager_backup_copy_directory_can_set () &&
+				  backup_copy);
 	gtk_widget_set_sensitive (dlg->priv->autosave_hbox, 
 				  gedit_prefs_manager_auto_save_can_set ()); 
 	gtk_widget_set_sensitive (dlg->priv->auto_save_spinbutton, 
@@ -326,6 +403,18 @@
 			  "toggled",
 			  G_CALLBACK (backup_copy_checkbutton_toggled),
 			  dlg);
+	g_signal_connect (dlg->priv->backup_cur_dir_radio,
+			  "toggled",
+			  G_CALLBACK (backup_dir_radiobutton_toggled),
+			  dlg);
+	g_signal_connect (dlg->priv->backup_other_dir_radio,
+			  "toggled",
+			  G_CALLBACK (backup_dir_radiobutton_toggled),
+			  dlg);
+	g_signal_connect (GTK_FILE_CHOOSER (dlg->priv->backup_dir_button),
+			  "selection-changed",
+			  G_CALLBACK (backup_dir_button_selection_changed),
+			  dlg);
 	g_signal_connect (dlg->priv->auto_save_spinbutton,
 			  "value_changed",
 			  G_CALLBACK (auto_save_spinbutton_value_changed),
@@ -1333,6 +1422,10 @@
 		"auto_indent_checkbutton", &dlg->priv->auto_indent_checkbutton,
 
 		"autosave_hbox", &dlg->priv->autosave_hbox,
+		"backup_dir_vbox", &dlg->priv->backup_dir_vbox,
+		"backup_cur_dir_radio", &dlg->priv->backup_cur_dir_radio,
+		"backup_other_dir_radio", &dlg->priv->backup_other_dir_radio,
+		"backup_dir_button", &dlg->priv->backup_dir_button,
 		"backup_copy_checkbutton", &dlg->priv->backup_copy_checkbutton,
 		"auto_save_checkbutton", &dlg->priv->auto_save_checkbutton,
 		"auto_save_spinbutton", &dlg->priv->auto_save_spinbutton,
