Merge lp:~gary-lasker/software-center/search-down-arrow-lp842711 into lp:software-center

Proposed by Gary Lasker
Status: Merged
Merged at revision: 2649
Proposed branch: lp:~gary-lasker/software-center/search-down-arrow-lp842711
Merge into: lp:software-center
Diff against target: 67 lines (+26/-1)
3 files modified
debian/changelog (+4/-1)
softwarecenter/ui/gtk3/panes/softwarepane.py (+13/-0)
softwarecenter/ui/gtk3/session/viewmanager.py (+9/-0)
To merge this branch: bzr merge lp:~gary-lasker/software-center/search-down-arrow-lp842711
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+88421@code.launchpad.net

Description of the change

This branch fixes usability bug 842711 by allowing you to use the down arrow to select the first item in the result list a search. This is one of the bugs targeted in the consumer-p-software-center-enhancements blueprint.

Thanks!

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Looks great, merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-01-10 21:00:13 +0000
3+++ debian/changelog 2012-01-12 20:31:23 +0000
4@@ -14,8 +14,11 @@
5 - do not add an icon to the Unity launcher for packages that do
6 not have an Exec entry in their corresponding desktop file,
7 e.g. ubuntu-restricted-extras, wine (LP: #913756)
8+ * lp:~gary-lasker/software-center/search-down-arrow-lp842711:
9+ - select the first item in the result list when the down
10+ arrow is pressed during a search (LP: #842711)
11
12- -- Gary Lasker <gary.lasker@canonical.com> Tue, 10 Jan 2012 15:56:44 -0500
13+ -- Gary Lasker <gary.lasker@canonical.com> Thu, 12 Jan 2012 15:18:54 -0500
14
15 software-center (5.1.5.1) precise; urgency=low
16
17
18=== modified file 'softwarecenter/ui/gtk3/panes/softwarepane.py'
19--- softwarecenter/ui/gtk3/panes/softwarepane.py 2012-01-09 17:28:56 +0000
20+++ softwarecenter/ui/gtk3/panes/softwarepane.py 2012-01-12 20:31:23 +0000
21@@ -511,6 +511,19 @@
22 # use the appview combo
23 return self.app_view.get_sort_mode()
24
25+ def on_search_entry_key_press_event(self, event):
26+ """callback when a key is pressed in the search entry widget"""
27+ if not self.is_applist_view_showing():
28+ return
29+ if ((event.keyval == Gdk.keyval_from_name("Down") or
30+ event.keyval == Gdk.keyval_from_name("KP_Down")) and
31+ self.is_applist_view_showing() and
32+ len(self.app_view.tree_view.get_model()) > 0):
33+ # select the first item in the applist search result
34+ self.app_view.tree_view.grab_focus()
35+ self.app_view.tree_view.set_cursor(Gtk.TreePath(),
36+ None, False)
37+
38 def on_search_terms_changed(self, terms):
39 " stub implementation "
40 pass
41
42=== modified file 'softwarecenter/ui/gtk3/session/viewmanager.py'
43--- softwarecenter/ui/gtk3/session/viewmanager.py 2011-12-07 17:17:31 +0000
44+++ softwarecenter/ui/gtk3/session/viewmanager.py 2012-01-12 20:31:23 +0000
45@@ -41,6 +41,8 @@
46 self.search_entry = SearchEntry()
47 self.search_entry.connect(
48 "terms-changed", self.on_search_terms_changed)
49+ self.search_entry.connect(
50+ "key-press-event", self.on_search_entry_key_press_event)
51
52 self.back_forward = BackForwardButton()
53 self.back_forward.connect(
54@@ -80,6 +82,13 @@
55 if hasattr(pane, "on_nav_forward_clicked"):
56 pane.on_nav_forward_clicked(widget)
57 return
58+
59+ def on_search_entry_key_press_event(self, widget, event):
60+
61+ pane = self.get_current_view_widget()
62+ if hasattr(pane, "on_search_entry_key_press_event"):
63+ pane.on_search_entry_key_press_event(event)
64+ return
65
66 def register(self, pane, view_id):
67 page_id = self.notebook_view.append_page(

Subscribers

People subscribed via source and target branches