[gnome-music/freeze-break: 6/107] Open search bar on Ctrl-F



commit cd14967a1d6f696b90dfe45028afcd0c6afe5fec
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Aug 6 15:54:40 2013 +0200

    Open search bar on Ctrl-F

 gnomemusic/window.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index aefb234..1265611 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -129,6 +129,7 @@ class Window(Gtk.ApplicationWindow):
 
             self._on_notify_model_id = self._stack.connect('notify::visible-child', self._on_notify_mode)
             self.connect('destroy', self._notify_mode_disconnect)
+            self.connect('key_press_event', self._on_key_press)
 
             self.views[0].populate()
         #To revert to the No Music View when no songs are found
@@ -142,6 +143,10 @@ class Window(Gtk.ApplicationWindow):
         self._box.show()
         self.show()
 
+    def _on_key_press(self, widget, event):
+        if event.keyval == 102: # Ctrl-f
+            self.toolbar.searchbar.set_property('search-mode-enabled', True)
+
     def _notify_mode_disconnect(self, data=None):
         self._stack.disconnect(self._on_notify_model_id)
 


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