Index: data/rhythmbox.schemas
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/rhythmbox.schemas,v
retrieving revision 1.55
diff -u -u -r1.55 rhythmbox.schemas
--- data/rhythmbox.schemas	3 Dec 2005 08:57:17 -0000	1.55
+++ data/rhythmbox.schemas	5 Dec 2005 04:29:03 -0000
@@ -37,6 +37,17 @@
 	<long>A list of directory URIs that Rhythmbox should monitor for changes and new tracks.</long>
         </locale>
       </schema>
+      <schema>
+        <key>/schemas/apps/rhythmbox/monitor_library</key>
+        <applyto>/apps/rhythmbox/monitor_library</applyto>
+        <owner>rhythmbox</owner>
+        <type>bool</type>
+        <default>0</default>
+        <locale name="C">
+          <short>Whether the library location are monitored</short>
+          <long>If true, the locations listed in /apps/rhythmbox/library_locations are monitored for new files</long>
+        </locale>
+      </schema>
 
       <schema>
         <key>/schemas/apps/rhythmbox/state/paned_position</key>
Index: data/glade/library-prefs.glade
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/glade/library-prefs.glade,v
retrieving revision 1.7
diff -u -u -r1.7 library-prefs.glade
--- data/glade/library-prefs.glade	2 Dec 2005 04:00:40 -0000	1.7
+++ data/glade/library-prefs.glade	5 Dec 2005 04:29:03 -0000
@@ -298,14 +317,46 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkFileChooserButton" id="library_location_chooser">
+		    <widget class="GtkVBox" id="vbox12">
 		      <property name="visible">True</property>
-		      <property name="title" translatable="yes">Select A 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>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">3</property>
+
+		      <child>
+			<widget class="GtkFileChooserButton" id="library_location_chooser">
+			  <property name="visible">True</property>
+			  <property name="title" translatable="yes">Select A 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">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="watch_library_check">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Watch my library for new files</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
Index: lib/rb-preferences.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-preferences.h,v
retrieving revision 1.19
diff -u -u -r1.19 rb-preferences.h
--- lib/rb-preferences.h	2 Dec 2005 04:00:41 -0000	1.19
+++ lib/rb-preferences.h	5 Dec 2005 04:29:03 -0000
@@ -30,6 +30,7 @@
 #define CONF_FIRST_TIME CONF_PREFIX   "/first_time_flag"
 #define CONF_GRACE_PERIOD CONF_PREFIX "/grace_period"
 #define CONF_LIBRARY_LOCATION	CONF_PREFIX "/library_locations"
+#define CONF_MONITOR_LIBRARY	CONF_PREFIX "/monitor_library"
 #define CONF_UI_DIR               CONF_PREFIX "/ui"
 #define CONF_UI_STATUSBAR_HIDDEN  CONF_PREFIX "/ui/statusbar_hidden"
 #define CONF_UI_SOURCELIST_HIDDEN CONF_PREFIX "/ui/sourcelist_hidden"
Index: rhythmdb/rhythmdb.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.c,v
retrieving revision 1.141
diff -u -u -r1.141 rhythmdb.c
--- rhythmdb/rhythmdb.c	4 Dec 2005 10:29:51 -0000	1.141
+++ rhythmdb/rhythmdb.c	5 Dec 2005 04:29:05 -0000
@@ -1067,6 +1067,9 @@
 			GSList *cur;
 			gboolean in_library = FALSE;
 			
+			if (!eel_gconf_get_boolean (CONF_MONITOR_LIBRARY))
+				return;
+
 			/* don't notices new files outside of the library locations */
 			for (cur = db->priv->library_locations; cur != NULL; cur = g_slist_next (cur)) {
 				if (g_str_has_prefix (info_uri, cur->data)) {
@@ -3811,10 +3814,12 @@
 		g_slist_free (db->priv->library_locations);
 	}
 
-	db->priv->library_locations = eel_gconf_get_string_list (CONF_LIBRARY_LOCATION);
+	if (eel_gconf_get_boolean (CONF_MONITOR_LIBRARY)) {
+		db->priv->library_locations = eel_gconf_get_string_list (CONF_LIBRARY_LOCATION);
 
-	if (db->priv->library_locations) {
-		g_slist_foreach (db->priv->library_locations, (GFunc) monitor_library_directory, db);
+		if (db->priv->library_locations) {
+			g_slist_foreach (db->priv->library_locations, (GFunc) monitor_library_directory, db);
+		}
 	}
 
 	/* monitor every directory that contains a (TYPE_SONG) track */
Index: sources/rb-library-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-library-source.c,v
retrieving revision 1.133
diff -u -u -r1.133 rb-library-source.c
--- sources/rb-library-source.c	2 Dec 2005 05:33:15 -0000	1.133
+++ sources/rb-library-source.c	5 Dec 2005 04:29:10 -0000
@@ -145,6 +145,8 @@
 					      GtkSelectionData *data,
 					      guint info, guint time,
 					      RBLibrarySource *source);
+static void rb_library_source_watch_toggled_cb (GtkToggleButton *button,
+						RBLibrarySource *source);
 
 
 #define CONF_UI_LIBRARY_DIR CONF_PREFIX "/ui/library"
@@ -196,6 +198,7 @@
 	GSList *browser_views_group;
 
 	GtkFileChooser *library_location_widget;
+	GtkWidget *watch_library_check;
 	gboolean library_location_change_pending, library_location_handle_pending;
 	
 	RhythmDBEntryType entry_type;
@@ -234,36 +237,8 @@
 	PROP_SORTING_KEY
 };
 
-static GObjectClass *parent_class = NULL;
 
-GType
-rb_library_source_get_type (void)
-{
-	static GType rb_library_source_type = 0;
-
-	if (rb_library_source_type == 0)
-	{
-		static const GTypeInfo our_info =
-		{
-			sizeof (RBLibrarySourceClass),
-			NULL,
-			NULL,
-			(GClassInitFunc) rb_library_source_class_init,
-			NULL,
-			NULL,
-			sizeof (RBLibrarySource),
-			0,
-			(GInstanceInitFunc) rb_library_source_init
-		};
-
-		rb_library_source_type = g_type_register_static (RB_TYPE_SOURCE,
-								 "RBLibrarySource",
-								 &our_info, 0);
-
-	}
-
-	return rb_library_source_type;
-}
+G_DEFINE_TYPE (RBLibrarySource, rb_library_source, RB_TYPE_SOURCE)
 
 static void
 rb_library_source_class_init (RBLibrarySourceClass *klass)
@@ -271,8 +246,6 @@
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	object_class->dispose = rb_library_source_dispose;
 	object_class->finalize = rb_library_source_finalize;
 	object_class->constructor = rb_library_source_constructor;
@@ -492,7 +465,7 @@
 	if (source->priv->cached_all_query)
 		g_object_unref (G_OBJECT (source->priv->cached_all_query));
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+	G_OBJECT_CLASS (rb_library_source_parent_class)->finalize (object);
 }
 
 static void
@@ -546,14 +519,12 @@
 {
 	RBLibrarySource *source;
 	RBLibrarySourceClass *klass;
-	GObjectClass *parent_class;  
 	RBShell *shell;
 
 	klass = RB_LIBRARY_SOURCE_CLASS (g_type_class_peek (RB_TYPE_LIBRARY_SOURCE));
-	parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
 
-	source = RB_LIBRARY_SOURCE (parent_class->constructor (type, n_construct_properties,
-							       construct_properties));
+	source = RB_LIBRARY_SOURCE (G_OBJECT_CLASS (rb_library_source_parent_class)
+			->constructor (type, n_construct_properties, construct_properties));
 
 	register_action_group (source);
 
@@ -1143,6 +1114,7 @@
 
 	source->priv->library_location_widget =
 		(GtkFileChooser*) glade_xml_get_widget (xml, "library_location_chooser");
+	source->priv->watch_library_check = glade_xml_get_widget (xml, "watch_library_check");
 
 	rb_glade_boldify_label (xml, "browser_views_label");
 	rb_glade_boldify_label (xml, "library_location_label");
@@ -1157,6 +1129,10 @@
 			  "hide",
 			  G_CALLBACK (rb_library_source_prefs_update),
 			  asource);
+	g_signal_connect (G_OBJECT (source->priv->watch_library_check),
+			  "toggled",
+			  G_CALLBACK (rb_library_source_watch_toggled_cb),
+			  asource);
 
 	return source->priv->config_widget;
 }
@@ -1188,6 +1164,9 @@
 
 	g_slist_foreach (list, (GFunc) g_free, NULL);
 	g_slist_free (list);
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (source->priv->watch_library_check),
+				      eel_gconf_get_boolean (CONF_MONITOR_LIBRARY));
 }
 
 void
@@ -1743,3 +1722,13 @@
 
 	g_idle_add ((GSourceFunc)rb_library_source_process_library_handle_selection, source);
 }
+
+static void
+rb_library_source_watch_toggled_cb (GtkToggleButton *button, RBLibrarySource *source)
+{
+	gboolean active;
+
+	active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (source->priv->watch_library_check));
+	eel_gconf_set_boolean (CONF_MONITOR_LIBRARY, active);
+}
+
