Merge lp:~mvo/software-center/fix-recommenations-details-clicks into lp:software-center

Proposed by Michael Vogt on 2012-02-15
Status: Merged
Merged at revision: 2759
Proposed branch: lp:~mvo/software-center/fix-recommenations-details-clicks
Merge into: lp:software-center
Diff against target: 79 lines (+22/-4)
3 files modified
softwarecenter/ui/gtk3/panes/softwarepane.py (+2/-0)
softwarecenter/ui/gtk3/views/appdetailsview.py (+8/-3)
softwarecenter/ui/gtk3/widgets/recommendations.py (+12/-1)
To merge this branch: bzr merge lp:~mvo/software-center/fix-recommenations-details-clicks
Reviewer Review Type Date Requested Status
Gary Lasker (community) 2012-02-15 Approve on 2012-02-15
Review via email: mp+93233@code.launchpad.net

Description of the change

This makes the recommended apps in the detailsview clickable. It also allows the detailsview to make the "addons" clickable in the future by sending the same signal.

To post a comment you must log in.
Gary Lasker (gary-lasker) wrote :

Ah, I see! This broke temporarily with the refactor. Cool, this does the trick nicely!!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/panes/softwarepane.py'
2--- softwarecenter/ui/gtk3/panes/softwarepane.py 2012-02-15 11:02:29 +0000
3+++ softwarecenter/ui/gtk3/panes/softwarepane.py 2012-02-15 16:14:11 +0000
4@@ -235,6 +235,8 @@
5 self.icons,
6 self.cache,
7 self.datadir)
8+ self.app_details_view.connect(
9+ "different-application-selected", self.on_application_activated)
10 self.scroll_details.add(self.app_details_view)
11 # when the cache changes, refresh the app list
12 self.cache.connect("cache-ready", self.on_cache_ready)
13
14=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
15--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-02-15 15:16:09 +0000
16+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-02-15 16:14:11 +0000
17@@ -740,9 +740,9 @@
18 __gsignals__ = {'selected':(GObject.SignalFlags.RUN_FIRST,
19 None,
20 (GObject.TYPE_PYOBJECT,)),
21- "application-selected" : (GObject.SignalFlags.RUN_LAST,
22- None,
23- (GObject.TYPE_PYOBJECT, )),
24+ "different-application-selected" : (GObject.SignalFlags.RUN_LAST,
25+ None,
26+ (GObject.TYPE_PYOBJECT, )),
27 }
28
29
30@@ -1208,6 +1208,8 @@
31 catview = CategoriesViewGtk(
32 self.datadir, None, self.cache, self.db, self.icons, None)
33 self.recommended_for_app_panel = RecommendationsPanelDetails(catview)
34+ self.recommended_for_app_panel.connect(
35+ "application-activated", self._on_recommended_application_activated)
36 self.recommended_for_app_panel.show_all()
37 self.info_vb.pack_start(self.recommended_for_app_panel, False, False, 0)
38
39@@ -1260,6 +1262,9 @@
40 self.connect('size-allocate', lambda w,a: w.queue_draw())
41 return
42
43+ def _on_recommended_application_activated(self, recwidget, app):
44+ self.emit("different-application-selected", app)
45+
46 def _on_review_new(self, button):
47 self._review_write_new()
48
49
50=== modified file 'softwarecenter/ui/gtk3/widgets/recommendations.py'
51--- softwarecenter/ui/gtk3/widgets/recommendations.py 2012-02-15 15:20:29 +0000
52+++ softwarecenter/ui/gtk3/widgets/recommendations.py 2012-02-15 16:14:11 +0000
53@@ -38,14 +38,25 @@
54 """
55 Base class for widgets that display recommendations
56 """
57+
58+ __gsignals__ = {
59+ "application-activated" : (GObject.SIGNAL_RUN_LAST,
60+ GObject.TYPE_NONE,
61+ (GObject.TYPE_PYOBJECT,),
62+ ),
63+ }
64+
65 def __init__(self, catview):
66 FramedHeaderBox.__init__(self)
67 # FIXME: we only need the catview for "add_titles_to_flowgrid"
68 # and "on_category_clicked" so we should be able to
69 # extract this to a "leaner" widget
70 self.catview = catview
71+ self.catview.connect(
72+ "application-activated", self._on_application_activated)
73 self.recommender_agent = RecommenderAgent()
74-
75+ def _on_application_activated(self, catview, app):
76+ self.emit("application-activated", app)
77
78 class RecommendationsPanelLobby(RecommendationsPanel):
79 """

Subscribers

People subscribed via source and target branches