Re: 'Clear' Search Results



Whoops - I forgot the second half of the diff

--- Best/BestWindow.cs 2005-10-01 15:15:05.000000000 -0500
+++ Best/BestWindow-ds1.cs      2005-10-01 15:13:36.000000000 -0500
@@ -338,7 +338,7 @@ namespace Best {

                private Gtk.Widget CreateContents ()
                {
-                       Gtk.HBox entryLine = new HBox (false, 3);
+                       Gtk.HBox entryLine = new HBox (false, 4);

                        Gtk.Label words = new Gtk.Label (Catalog.GetString ("Search terms:"));
                        entryLine.PackStart (words, false, false, 3);
@@ -371,6 +371,11 @@ namespace Best {
                        button.Add (buttonContents);
                        button.Clicked += new EventHandler (this.DoSearch);
                        entryLine.PackStart (button, false, false, 3);
+
+                       Gtk.Button clearButton = new Gtk.Button ();
+                       clearButton.Label = "Clear";
+                       clearButton.Clicked += new EventHandler (this.ClearSearch);
+                       entryLine.PackStart (clearButton, false, false, 4);

                        canvas = new TileCanvas ();
                        canvas.Show ();
@@ -611,10 +616,18 @@ namespace Best {

                        return searches;
                }
+
+               private void ClearSearch (object o, EventArgs args)
+               {
+                       root.Clear ();
+                       UpdatePage ();
+                       entry.Text = "";
+               }

                public void ClearHistory ()
                {
                        history.Clear ();
+                       ClearSearch (null, null);
                }

                public void QuickSearch (string query)


--- Tiles/SimpleRootTile.cs    2005-10-01 15:15:05.000000000 -0500
+++ Tiles/SimpleRootTile-ds1.cs 2005-10-01 15:13:42.000000000 -0500
@@ -52,6 +52,11 @@ namespace Beagle.Tile {
                        get { return offerDaemonRestart; }
                        set { offerDaemonRestart = value; }
                }
+
+               public void Clear ()
+               {
+                       hit_collection.Clear ();
+               }

                public void Add (ICollection hits)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]