[gnome-boxes] searchbar: Don't display searchbar until app is ready



commit fa5de4f1cf10a71ece1241511cfa658110ea6b48
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Feb 20 22:07:46 2014 +0000

    searchbar: Don't display searchbar until app is ready
    
    Until we have items to search through, there is no point is presenting
    search on key press events.

 src/searchbar.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/searchbar.vala b/src/searchbar.vala
index 255a73c..a3dc329 100644
--- a/src/searchbar.vala
+++ b/src/searchbar.vala
@@ -16,7 +16,9 @@ private class Boxes.Searchbar: Gtk.SearchBar {
     private ulong key_handler_id;
 
     public Searchbar () {
-        key_handler_id = App.app.window.key_press_event.connect (on_app_key_pressed);
+        search_mode_enabled = false;
+
+        App.app.call_when_ready (on_app_ready);
     }
 
     [GtkCallback]
@@ -41,6 +43,10 @@ private class Boxes.Searchbar: Gtk.SearchBar {
         set { entry.set_text (value); }
     }
 
+    private void on_app_ready () {
+        key_handler_id = App.app.window.key_press_event.connect (on_app_key_pressed);
+    }
+
     private bool on_app_key_pressed (Gtk.Widget widget, Gdk.EventKey event) {
         if (App.app.ui_state != UIState.COLLECTION)
             return false;


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