Index: data/glade/library-prefs.glade
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/glade/library-prefs.glade,v
retrieving revision 1.14
diff -u -r1.14 library-prefs.glade
--- data/glade/library-prefs.glade	18 Jun 2006 07:52:44 -0000	1.14
+++ data/glade/library-prefs.glade	30 Nov 2006 13:28:26 -0000
@@ -347,7 +347,7 @@
 		  <child>
 		    <widget class="GtkTable" id="table1">
 		      <property name="visible">True</property>
-		      <property name="n_rows">5</property>
+		      <property name="n_rows">6</property>
 		      <property name="n_columns">2</property>
 		      <property name="homogeneous">False</property>
 		      <property name="row_spacing">6</property>
@@ -402,8 +402,8 @@
 			<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="top_attach">2</property>
+			  <property name="bottom_attach">3</property>
 			  <property name="x_options">fill</property>
 			  <property name="y_options"></property>
 			</packing>
@@ -430,8 +430,8 @@
 			<packing>
 			  <property name="left_attach">0</property>
 			  <property name="right_attach">1</property>
-			  <property name="top_attach">4</property>
-			  <property name="bottom_attach">5</property>
+			  <property name="top_attach">5</property>
+			  <property name="bottom_attach">6</property>
 			  <property name="x_options">fill</property>
 			  <property name="y_options"></property>
 			</packing>
@@ -458,8 +458,8 @@
 			<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="top_attach">3</property>
+			  <property name="bottom_attach">4</property>
 			  <property name="x_options">fill</property>
 			  <property name="y_options"></property>
 			</packing>
@@ -498,8 +498,8 @@
 			<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="top_attach">2</property>
+			  <property name="bottom_attach">3</property>
 			  <property name="x_options">fill</property>
 			  <property name="y_options">fill</property>
 			</packing>
@@ -609,10 +609,31 @@
 			<packing>
 			  <property name="left_attach">1</property>
 			  <property name="right_attach">2</property>
-			  <property name="top_attach">4</property>
-			  <property name="bottom_attach">5</property>
+			  <property name="top_attach">5</property>
+			  <property name="bottom_attach">6</property>
 			  <property name="x_options">fill</property>
 			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkEntry" id="layout_path_custom">
+			  <property name="visible">True</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>
 		    </widget>
Index: sources/rb-library-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-library-source.c,v
retrieving revision 1.186
diff -u -r1.186 rb-library-source.c
--- sources/rb-library-source.c	20 Nov 2006 10:35:10 -0000	1.186
+++ sources/rb-library-source.c	30 Nov 2006 13:28:33 -0000
@@ -98,6 +98,9 @@
 #ifdef ENABLE_TRACK_TRANSFER
 static void rb_library_source_path_changed_cb (GtkComboBox *box,
 						RBLibrarySource *source);
+static void rb_library_custom_path_changed_cb (GtkEntry *box,
+					      RBLibrarySource *source);
+
 static void rb_library_source_filename_changed_cb (GtkComboBox *box,
 						   RBLibrarySource *source);
 static void rb_library_source_format_changed_cb (GtkWidget *widget,
@@ -122,6 +125,7 @@
 	{N_("Artist - Album"), "%aa - %at"},
 	{N_("Album"), "%at"},
 	{N_("Artist"), "%aa"},
+	{N_("Custom"), ""},
 };
 const int num_library_layout_paths = G_N_ELEMENTS (library_layout_paths);
 
@@ -151,6 +155,7 @@
 	GtkWidget *watch_library_check;
 #ifdef ENABLE_TRACK_TRANSFER
 	GtkWidget *layout_path_menu;
+	GtkWidget *layout_path_custom;
 	GtkWidget *layout_filename_menu;
 	GtkWidget *preferred_format_menu;
 	GtkWidget *layout_example_label;
@@ -426,6 +432,13 @@
 					   _(library_layout_paths[i].title));
 	}
 
+	source->priv->layout_path_custom = glade_xml_get_widget (xml, "layout_path_custom");
+	gtk_entry_set_text (GTK_ENTRY (source->priv->layout_path_custom), eel_gconf_get_string (CONF_LIBRARY_LAYOUT_PATH));
+	g_signal_connect (G_OBJECT (source->priv->layout_path_custom),
+			  "changed",
+			  G_CALLBACK (rb_library_custom_path_changed_cb),
+			  asource);
+
 	tmp = glade_xml_get_widget (xml, "layout_filename_menu_box");
 	label = glade_xml_get_widget (xml, "layout_filename_menu_label");
 	source->priv->layout_filename_menu = gtk_combo_box_new_text ();
@@ -745,7 +758,24 @@
 	gint index;
 
 	index = gtk_combo_box_get_active (box);
-	path = (index >= 0) ? library_layout_paths[index].path : "";
+
+	/* only change to defaults if not "custom" */
+	if (index != num_library_layout_paths - 1) {  
+		path = (index >= 0) ? library_layout_paths[index].path : "";
+		eel_gconf_set_string (CONF_LIBRARY_LAYOUT_PATH, path);
+		gtk_entry_set_editable (GTK_ENTRY (source->priv->layout_path_custom), FALSE);
+	} else {
+		gtk_entry_set_editable (GTK_ENTRY (source->priv->layout_path_custom), TRUE);
+	}
+	
+}
+
+static void
+rb_library_custom_path_changed_cb (GtkEntry *box, RBLibrarySource *source)
+{
+	const char *path;
+
+	path = gtk_entry_get_text (GTK_ENTRY (source->priv->layout_path_custom));
 	eel_gconf_set_string (CONF_LIBRARY_LAYOUT_PATH, path);
 }
 
@@ -1014,6 +1044,10 @@
 	while (library_layout_paths[i].path && strcmp (library_layout_paths[i].path, value) != 0) {
 		i++;
 	}
+	/* FIXME: this might be a bit kludgy */
+	/* we must be dealing with custom entry */
+	if (i >= num_library_layout_paths - 1)
+		i = num_library_layout_paths - 1;
 
 	g_free (value);
 	gtk_combo_box_set_active (GTK_COMBO_BOX (source->priv->layout_path_menu), i);
