Index: gedit/dialogs/gedit-preferences-dialog.glade
===================================================================
--- gedit/dialogs/gedit-preferences-dialog.glade	(revision 5406)
+++ gedit/dialogs/gedit-preferences-dialog.glade	(working copy)
@@ -1084,6 +1084,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 directory</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 directory</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>
Index: gedit/dialogs/gedit-preferences-dialog.c
===================================================================
--- gedit/dialogs/gedit-preferences-dialog.c	(revision 5406)
+++ 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,60 @@
 	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_dir_pref_to_chooser_value (GeditPreferencesDialog *dlg)
+{
+	gchar *directory_uri;
+	gchar *directory_path;
+
+	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 (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_cur_dir_radio)))
+	{
+		/* cur dir is active; conf key should be set to "" */
+		gedit_prefs_manager_set_backup_copy_directory ("");
+	}
+	else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_other_dir_radio)))
+	{
+		/* other dir is active; conf key should be set to backup_dir_button's selected dir */
+		set_backup_dir_pref_to_chooser_value (dlg);
+	}
+	else
+	{	/* neither of them are active - something's wrong */	}
+}
+
+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));
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_other_dir_radio), TRUE);
+	
+	set_backup_dir_pref_to_chooser_value (dlg);
+}
+
+static void
 auto_save_spinbutton_value_changed (GtkSpinButton          *spin_button,
 				    GeditPreferencesDialog *dlg)
 {
@@ -265,6 +320,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 +333,21 @@
 				      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 ());
+
+	backup_dir = gedit_prefs_manager_get_backup_copy_directory ();
+	if (g_ascii_strcasecmp (GPM_DEFAULT_BACKUP_COPY_DIRECTORY, backup_dir) == 0)
+	{ /* No backup dir is set */
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_cur_dir_radio), TRUE);
+	}
+	else
+	{
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->backup_other_dir_radio), TRUE);
+		gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (dlg->priv->backup_dir_button), 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 +369,9 @@
 				  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_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 +399,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 +1418,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,
Index: gedit/gedit-prefs-manager.c
===================================================================
--- gedit/gedit-prefs-manager.c	(revision 5406)
+++ gedit/gedit-prefs-manager.c	(working copy)
@@ -531,6 +531,11 @@
 		  GPM_CREATE_BACKUP_COPY,
 		  GPM_DEFAULT_CREATE_BACKUP_COPY)
 
+/* Backup copy directory */
+DEFINE_STRING_PREF (backup_copy_directory,
+		    GPM_BACKUP_COPY_DIRECTORY,
+		    GPM_DEFAULT_BACKUP_COPY_DIRECTORY)
+
 /* Backup extension. This is configurable only using gconftool or gconf-editor */
 gchar *
 gedit_prefs_manager_get_backup_extension (void)
Index: gedit/gedit-prefs-manager.h
===================================================================
--- gedit/gedit-prefs-manager.h	(revision 5406)
+++ gedit/gedit-prefs-manager.h	(working copy)
@@ -54,6 +54,7 @@
 
 #define GPM_SAVE_DIR			GPM_PREFS_DIR  "/editor/save"
 #define GPM_CREATE_BACKUP_COPY  	GPM_SAVE_DIR "/create_backup_copy"
+#define GPM_BACKUP_COPY_DIRECTORY	GPM_SAVE_DIR "/backup_copy_directory"
 #define GPM_BACKUP_COPY_EXTENSION	GPM_SAVE_DIR "/backup_copy_extension"
 
 #define GPM_AUTO_SAVE			GPM_SAVE_DIR "/auto_save"
@@ -164,6 +165,7 @@
 #define GPM_DEFAULT_SELECTION_COLOR	(const gchar*) "#000000009c9c"
 
 #define GPM_DEFAULT_CREATE_BACKUP_COPY	1 /* TRUE */
+#define GPM_DEFAULT_BACKUP_COPY_DIRECTORY (const gchar*) ""
 #define GPM_DEFAULT_BACKUP_COPY_EXTENSION (const gchar*) "~"
 
 #define GPM_DEFAULT_AUTO_SAVE		0 /* FALSE */
@@ -293,6 +295,11 @@
 /* Backup extension. This is configurable only using gconftool or gconf-editor */
 gchar			*gedit_prefs_manager_get_backup_extension	(void);
 
+/* Backup copy directory */
+gchar			*gedit_prefs_manager_get_backup_copy_directory  (void);
+void			 gedit_prefs_manager_set_backup_copy_directory  (const gchar *directory);
+gboolean		 gedit_prefs_manager_backup_copy_directory_can_set (void);
+
 /* Auto save */
 gboolean		 gedit_prefs_manager_get_auto_save		(void);
 void			 gedit_prefs_manager_set_auto_save		(gboolean as);
Index: gedit/gedit-document-saver.c
===================================================================
--- gedit/gedit-document-saver.c	(revision 5406)
+++ gedit/gedit-document-saver.c	(working copy)
@@ -72,6 +72,7 @@
 	gboolean		  keep_backup;
 	gchar			 *backup_ext;
 	gboolean                  backups_in_curr_dir;
+	gchar			 *backup_dir;
 
 	time_t                    doc_mtime;
 	gchar                    *mime_type; //CHECK use FileInfo instead?
@@ -331,6 +332,8 @@
 get_backup_filename (GeditDocumentSaver *saver)
 {
 	gchar *fname;
+	gchar *dirname;
+	gchar *local_path;
 	gchar *bak_ext = NULL;
 
 	if ((saver->priv->backup_ext != NULL) &&
@@ -339,7 +342,20 @@
 	else
 		bak_ext = "~";
 
-	fname = g_strconcat (saver->priv->local_path, bak_ext, NULL);
+	/* Is there a backup dir set that we can use? */
+	if ((saver->priv->backup_dir != NULL) &&
+	    (saver->priv->backups_in_curr_dir == FALSE))
+	{
+		local_path = g_build_filename (saver->priv->backup_dir, saver->priv->local_path, NULL);
+		dirname = g_path_get_dirname (local_path);
+		g_mkdir_with_parents (dirname, 0777);
+		fname = g_strconcat (local_path, bak_ext, NULL);
+	
+		g_free (dirname);	
+		g_free (local_path);
+	}
+	else
+		fname = g_strconcat (saver->priv->local_path, bak_ext, NULL);
 
 	/* If we are not going to keep the backup file and fname
 	 * already exists, try to use another name.
@@ -1437,6 +1453,7 @@
 			   GeditDocumentSaveFlags  flags)
 {
 	gchar *local_path;
+	gchar *backup_dir;
 
 	g_return_if_fail (GEDIT_IS_DOCUMENT_SAVER (saver));
 	g_return_if_fail ((uri != NULL) && (strlen (uri) > 0));
@@ -1459,8 +1476,18 @@
 	else
 		saver->priv->keep_backup = gedit_prefs_manager_get_create_backup_copy ();
 
-	/* TODO: add support for configurable backup dir */
-	saver->priv->backups_in_curr_dir = TRUE;
+	/* is there an alternative directory for backup copies */
+	backup_dir = gedit_prefs_manager_get_backup_copy_directory ();
+	if (g_ascii_strcasecmp (GPM_DEFAULT_BACKUP_COPY_DIRECTORY, backup_dir) == 0)
+	{
+		saver->priv->backups_in_curr_dir = TRUE;
+		saver->priv->backup_dir = NULL;
+	}
+	else
+	{
+		saver->priv->backups_in_curr_dir = FALSE;
+		saver->priv->backup_dir = backup_dir;
+	}
 
 	if (encoding != NULL)
 		saver->priv->encoding = encoding;
Index: data/gedit.schemas.in
===================================================================
--- data/gedit.schemas.in	(revision 5406)
+++ data/gedit.schemas.in	(working copy)
@@ -115,6 +115,21 @@
 	"Backup Copy Extension" option.</long>
       </locale>
     </schema>
+	
+    <schema>
+      <key>/schemas/apps/gedit-2/preferences/editor/save/backup_copy_directory</key>
+      <applyto>/apps/gedit-2/preferences/editor/save/backup_copy_directory</applyto>
+      <owner>gedit</owner>
+      <type>string</type>
+	  <default></default>
+	  <locale name="C">
+	<short>Backup Copy Directory</short>
+	<long>Path to use to store backup copies of files in. This will only take
+	effect if the "Create Backup Copies" option is on. If this option is set to
+	an empty string (the default) the backup copies will be created in the file's
+	current directory. Must be an absolute path.</long>
+      </locale>
+    </schema>
 
     <schema>
       <key>/schemas/apps/gedit-2/preferences/editor/save/backup_copy_extension</key>
