Merge lp:~jhodapp/unity-lens-video/unity-lens-videos.previews into lp:unity-lens-video

Proposed by Jim Hodapp
Status: Rejected
Rejected by: Timo Jyrinki
Proposed branch: lp:~jhodapp/unity-lens-video/unity-lens-videos.previews
Merge into: lp:unity-lens-video
Diff against target: 192 lines (+40/-20)
3 files modified
README (+12/-3)
po/unity-lens-video.pot (+8/-8)
src/unity-lens-video (+20/-9)
To merge this branch: bzr merge lp:~jhodapp/unity-lens-video/unity-lens-videos.previews
Reviewer Review Type Date Requested Status
Paweł Stołowski Pending
Review via email: mp+120573@code.launchpad.net

Description of the change

* Added dependencies section to README that details existing and new package dependencies necessary for a complete previews experience.

* Useful error message for an error condition when there was no video stream to preview.

* Added Recommend Videos category to display in the global home view by default. This view will use the coverflow renderer.

Don't merge this until the design team is finished testing usability.

To post a comment you must log in.
Revision history for this message
Jim Hodapp (jhodapp) wrote :

This merge is no longer necessary since mhr3's work to consolidate categories and display recommended videos as 3rd on the home Dash view was committed.

Unmerged revisions

100. By Jim Hodapp

Added a dependencies section to README that details existing and new dependencies necessary for a complete previews experience.

99. By Jim Hodapp

Useful error message for an error condition.

98. By Jim Hodapp

Merged changes from trunk.

97. By Jim Hodapp

Added Recommended Videos category to display in the global home view by default. This view will use the coverflow rendere when it becomes available.

96. By Jim Hodapp

Added some useful comments after studying the source code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2012-02-02 19:43:07 +0000
3+++ README 2012-08-21 13:58:24 +0000
4@@ -1,8 +1,17 @@
5-
6-#Install
7+# Install
8 sudo mkdir /usr/share/unity/lenses/video
9 sudo cp video.lens /usr/share/unity/lenses/video
10
11-#Run
12+# Run
13 ./src/unity-lens-video
14
15+# Dependencies
16+python2.7
17+gir1.2-unity-5.0
18+gir1.2-dee-1.0
19+gir1.2-glib-2.0
20+python-zeitgeist
21+girl1.2-gstreamer-1.0
22+gstreamer1.0-plugins-base
23+gstreamer1.0-plugins-good
24+gstreamer1.0-libav
25
26=== modified file 'po/unity-lens-video.pot'
27--- po/unity-lens-video.pot 2012-02-22 14:05:03 +0000
28+++ po/unity-lens-video.pot 2012-08-21 13:58:24 +0000
29@@ -8,7 +8,7 @@
30 msgstr ""
31 "Project-Id-Version: PACKAGE VERSION\n"
32 "Report-Msgid-Bugs-To: \n"
33-"POT-Creation-Date: 2012-02-22 11:42+0100\n"
34+"POT-Creation-Date: 2012-08-15 11:40-0400\n"
35 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
36 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
37 "Language-Team: LANGUAGE <LL@li.org>\n"
38@@ -17,30 +17,30 @@
39 "Content-Type: text/plain; charset=CHARSET\n"
40 "Content-Transfer-Encoding: 8bit\n"
41
42-#: ../src/unity-lens-video:78 ../src/unity-lens-video:84
43+#: ../src/unity-lens-video:54 ../src/unity-lens-video:60
44 msgid "My Videos"
45 msgstr ""
46
47-#: ../src/unity-lens-video:79
48+#: ../src/unity-lens-video:55
49 msgid "Online"
50 msgstr ""
51
52-#: ../src/unity-lens-video:80 ../video.lens.in.h:2
53+#: ../src/unity-lens-video:56 ../video.lens.in.h:1
54 msgid "Videos"
55 msgstr ""
56
57-#: ../src/unity-lens-video:81
58+#: ../src/unity-lens-video:57
59 msgid "Recently Viewed"
60 msgstr ""
61
62-#: ../src/unity-lens-video:82
63+#: ../src/unity-lens-video:58
64 msgid "Search Videos"
65 msgstr ""
66
67-#: ../src/unity-lens-video:83
68+#: ../src/unity-lens-video:59
69 msgid "Sources"
70 msgstr ""
71
72-#: ../video.lens.in.h:1
73+#: ../video.lens.in.h:2
74 msgid "Search local videos"
75 msgstr ""
76
77=== modified file 'src/unity-lens-video'
78--- src/unity-lens-video 2012-08-14 12:44:20 +0000
79+++ src/unity-lens-video 2012-08-21 13:58:24 +0000
80@@ -55,6 +55,7 @@
81 CAT_ONLINE = _("Online")
82 CAT_GLOBAL = _("Videos")
83 CAT_RECENT = _("Recently Viewed")
84+CAT_RECOMMENDED = _("Recommended Videos")
85 HINT = _("Search Videos")
86 SOURCES = _("Sources")
87 LOCAL_VIDEOS = _("My Videos")
88@@ -73,11 +74,11 @@
89
90 # pylint: disable=R0903
91 class Daemon:
92-
93+
94 """Creation of a lens with a local scope."""
95
96 def __init__(self):
97- #Create the lens
98+ # Create the lens
99 self._lens = Unity.Lens.new("/net/launchpad/lens/video", "video")
100 self._lens.props.search_hint = HINT
101 self._lens.props.visible = True
102@@ -99,12 +100,16 @@
103 cats.append(Unity.Category.new(CAT_GLOBAL,
104 Gio.ThemedIcon.new("/usr/share/unity/6/lens-nav-video.svg"),
105 Unity.CategoryRenderer.VERTICAL_TILE))
106+ # Home Dash recommended online videos category
107+ cats.append(Unity.Category.new(CAT_RECOMMENDED,
108+ Gio.ThemedIcon.new("/usr/share/unity/6/lens-nav-video.svg"),
109+ Unity.CategoryRenderer.FLOW))
110 self._lens.props.categories = cats
111
112 filters = []
113 self._lens.props.filters = filters
114-
115-
116+
117+
118 # Create the scope
119 self._scope = Unity.Scope.new("/net/launchpad/lens/video/main")
120 self._scope.search_in_global = True
121@@ -130,7 +135,7 @@
122 return True
123 else:
124 return False
125-
126+
127 def on_preview_uri(self, scope, uri):
128 """Preview request handler"""
129 preview = None
130@@ -159,6 +164,8 @@
131 preview.add_info(Unity.InfoHint.new("format", _("Format"), None, GstPbutils.pb_utils_get_codec_description(vstream.get_caps())))
132 preview.add_info(Unity.InfoHint.new("dimensions", _("Dimensions"), None, dimensions))
133 preview.add_info(Unity.InfoHint.new("size", _("Size"), None, GLib.format_size(os.path.getsize(GLib.filename_from_uri(uri, None)))))
134+ else:
135+ print "No video streams detected that can be previewed."
136 except Exception as e:
137 print "Couldn't get video details", e
138 show_folder = Unity.PreviewAction.new("show-in-folder", _("Show in Folder"), None)
139@@ -198,16 +205,18 @@
140 print "Search changed to \"%s\"" % search_string
141 model = search.props.results_model
142 if self.source_activated('local'):
143+ # Global search
144 if search_type is Unity.SearchType.GLOBAL:
145 if search_string == '':
146 model.clear ()
147 if search_status:
148 search_status.finished ()
149 print "Global view without search string : hide"
150-
151+
152 else:
153 self.update_results_model(search_string, model, 'global', cancellable, search_status)
154 else:
155+ # Lens search
156 self.update_results_model(search_string, model, 'lens', cancellable, search_status)
157 else:
158 model.clear()
159@@ -243,6 +252,7 @@
160 results = None
161 else:
162 results = None
163+ # Populate the search results to display to the user
164 result_list = []
165 blacklist = self.get_blacklist ()
166 if results:
167@@ -253,6 +263,7 @@
168 if self.is_video(video) and not self.is_hidden(video, blacklist):
169 video_counter+= 1
170 title = self.get_name(video)
171+ print "title: " + title
172 comment = ''
173 uri = 'file://%s' % video
174 icon = self.get_icon(video)
175@@ -264,14 +275,14 @@
176 item.append(icon)
177 result_list.append(item)
178 result_list = self.sort_alpha(result_list)
179-
180+
181 GLib.idle_add(self.add_results, search_status, model, cat, cancellable, result_list, search)
182-
183+
184
185 def add_results (self, search_status=None, model=None,
186 cat=None, cancellable=None, result_list=[], search=None):
187 result_sets = []
188-
189+
190 if cancellable and not cancellable.is_cancelled():
191 if cat == 'global':
192 # Create only one result set for the Global search

Subscribers

People subscribed via source and target branches