Index: src/MainWindow.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/MainWindow.cs,v
retrieving revision 1.220
diff -b -u -r1.220 MainWindow.cs
--- src/MainWindow.cs	20 Oct 2005 02:44:39 -0000	1.220
+++ src/MainWindow.cs	23 Oct 2005 20:44:07 -0000
@@ -81,6 +81,7 @@
 	Gtk.ToggleButton view_button;
 
 	InfoBox info_box;
+	FSpot.FindBox find_box;
 	FSpot.InfoDisplay info_display;
 	QueryView icon_view;
 	PhotoView photo_view;
@@ -192,6 +193,10 @@
 		view_vbox.PackStart (query_display, false, false, 0);
 		view_vbox.ReorderChild (query_display, 1);
 
+		find_box = new FSpot.FindBox(query, tag_selection_widget);
+		view_vbox.PackEnd(find_box, false, false,0);
+		view_vbox.ReorderChild(find_box, 2);		
+
 		icon_view = new QueryView (query);
 		icon_view_scrolled.Add (icon_view);
 		icon_view.Selection.Changed += HandleSelectionChanged;
@@ -255,6 +260,7 @@
 		main_window.Destroyed += HandleCloseCommand;
 
 		query_display.HandleChanged (query);
+		find_box.WarningBox.Visible = false;
 
 		if (Toplevel == null)
 			Toplevel = this;
@@ -1367,6 +1373,15 @@
 			info_vpaned.Hide ();
 		else
 			info_vpaned.Show ();
+	}
+	
+	void HandleDisplayFind (object sender, EventArgs args)
+	{
+		if (find_box.Visible)
+			find_box.Hide();
+		else
+			find_box.Show();
+		
 	}
 
 	public Gtk.Window Window {
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/f-spot/src/Makefile.am,v
retrieving revision 1.44
diff -b -u -r1.44 Makefile.am
--- src/Makefile.am	19 Oct 2005 05:30:45 -0000	1.44
+++ src/Makefile.am	23 Oct 2005 20:44:07 -0000
@@ -18,6 +18,7 @@
 	$(srcdir)/DirectoryCollection.cs	\
 	$(srcdir)/Exif.cs			\
 	$(srcdir)/ExifUtils.cs			\
+	$(srcdir)/FindBox.cs			\
 	$(srcdir)/FlickrExport.cs		\
 	$(srcdir)/FlickrRemote.cs		\
 	$(srcdir)/FileImportBackend.cs		\
Index: src/TagSelectionWidget.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/TagSelectionWidget.cs,v
retrieving revision 1.17
diff -b -u -r1.17 TagSelectionWidget.cs
--- src/TagSelectionWidget.cs	22 Oct 2005 07:20:43 -0000	1.17
+++ src/TagSelectionWidget.cs	23 Oct 2005 20:44:08 -0000
@@ -35,6 +35,12 @@
 public class TagSelectionWidget : TreeView {
 	TagSelectionWidget widget;
 	private TagStore tag_store;
+		
+	public TagStore Store {
+		get {
+			return tag_store;
+		}
+	}
 
 	// FIXME this is a hack.
 	private static Pixbuf empty_pixbuf = new Pixbuf (Colorspace.Rgb, true, 8, 1, 1);
Index: src/TagStore.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/TagStore.cs,v
retrieving revision 1.19
diff -b -u -r1.19 TagStore.cs
--- src/TagStore.cs	27 Sep 2005 03:15:05 -0000	1.19
+++ src/TagStore.cs	23 Oct 2005 20:44:08 -0000
@@ -509,6 +509,31 @@
 			TagChanged(tag);
 	}
 
+	public Tag [] Query (string name)
+	{
+		string query = String.Format(	"SELECT id " +
+						"FROM   tags " + 
+						"WHERE  name LIKE '%{0}%'", name);
+		
+		SqliteCommand command = new SqliteCommand ();
+		command.Connection = Connection;
+		command.CommandText = query;
+		SqliteDataReader reader = command.ExecuteReader ();
+		
+	
+		ArrayList id_list = new ArrayList ();
+		while (reader.Read ()) {
+			uint id = Convert.ToUInt32 (reader [0]);
+			Tag tag = LookupInCache (id) as Tag;
+			
+			id_list.Add (tag);
+		}
+		
+		command.Dispose ();
+
+		return id_list.ToArray (typeof (Tag)) as Tag [];
+	}	
+	
 
 #if TEST_TAG_STORE
 
Index: src/f-spot.glade
===================================================================
RCS file: /cvs/gnome/f-spot/src/f-spot.glade,v
retrieving revision 1.110
diff -b -u -r1.110 f-spot.glade
--- src/f-spot.glade	21 Oct 2005 19:41:58 -0000	1.110
+++ src/f-spot.glade	23 Oct 2005 20:44:28 -0000
@@ -7006,6 +7006,16 @@
 		  </child>
 
 		  <child>
+		    <widget class="GtkCheckMenuItem" id="display_find_menu_item">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Display F_ind Box</property>
+		      <property name="use_underline">True</property>
+		      <property name="active">True</property>
+		      <signal name="activate" handler="HandleDisplayFind" last_modification_time="Thu, 29 Sep 2005 05:47:47 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
 		    <widget class="GtkSeparatorMenuItem" id="separator17">
 		      <property name="visible">True</property>
 		    </widget>
@@ -7489,6 +7499,10 @@
 		      <property name="expand">True</property>
 		      <property name="fill">True</property>
 		    </packing>
+		  </child>
+
+		  <child>
+		    <placeholder/>
 		  </child>
 		</widget>
 		<packing>
