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
=== modified file 'README'
--- README 2012-02-02 19:43:07 +0000
+++ README 2012-08-21 13:58:24 +0000
@@ -1,8 +1,17 @@
11# Install
2#Install
3sudo mkdir /usr/share/unity/lenses/video2sudo mkdir /usr/share/unity/lenses/video
4sudo cp video.lens /usr/share/unity/lenses/video3sudo cp video.lens /usr/share/unity/lenses/video
54
6#Run5# Run
7./src/unity-lens-video6./src/unity-lens-video
87
8# Dependencies
9python2.7
10gir1.2-unity-5.0
11gir1.2-dee-1.0
12gir1.2-glib-2.0
13python-zeitgeist
14girl1.2-gstreamer-1.0
15gstreamer1.0-plugins-base
16gstreamer1.0-plugins-good
17gstreamer1.0-libav
918
=== modified file 'po/unity-lens-video.pot'
--- po/unity-lens-video.pot 2012-02-22 14:05:03 +0000
+++ po/unity-lens-video.pot 2012-08-21 13:58:24 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2012-02-22 11:42+0100\n"11"POT-Creation-Date: 2012-08-15 11:40-0400\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,30 +17,30 @@
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919
20#: ../src/unity-lens-video:78 ../src/unity-lens-video:8420#: ../src/unity-lens-video:54 ../src/unity-lens-video:60
21msgid "My Videos"21msgid "My Videos"
22msgstr ""22msgstr ""
2323
24#: ../src/unity-lens-video:7924#: ../src/unity-lens-video:55
25msgid "Online"25msgid "Online"
26msgstr ""26msgstr ""
2727
28#: ../src/unity-lens-video:80 ../video.lens.in.h:228#: ../src/unity-lens-video:56 ../video.lens.in.h:1
29msgid "Videos"29msgid "Videos"
30msgstr ""30msgstr ""
3131
32#: ../src/unity-lens-video:8132#: ../src/unity-lens-video:57
33msgid "Recently Viewed"33msgid "Recently Viewed"
34msgstr ""34msgstr ""
3535
36#: ../src/unity-lens-video:8236#: ../src/unity-lens-video:58
37msgid "Search Videos"37msgid "Search Videos"
38msgstr ""38msgstr ""
3939
40#: ../src/unity-lens-video:8340#: ../src/unity-lens-video:59
41msgid "Sources"41msgid "Sources"
42msgstr ""42msgstr ""
4343
44#: ../video.lens.in.h:144#: ../video.lens.in.h:2
45msgid "Search local videos"45msgid "Search local videos"
46msgstr ""46msgstr ""
4747
=== modified file 'src/unity-lens-video'
--- src/unity-lens-video 2012-08-14 12:44:20 +0000
+++ src/unity-lens-video 2012-08-21 13:58:24 +0000
@@ -55,6 +55,7 @@
55CAT_ONLINE = _("Online")55CAT_ONLINE = _("Online")
56CAT_GLOBAL = _("Videos")56CAT_GLOBAL = _("Videos")
57CAT_RECENT = _("Recently Viewed")57CAT_RECENT = _("Recently Viewed")
58CAT_RECOMMENDED = _("Recommended Videos")
58HINT = _("Search Videos")59HINT = _("Search Videos")
59SOURCES = _("Sources")60SOURCES = _("Sources")
60LOCAL_VIDEOS = _("My Videos")61LOCAL_VIDEOS = _("My Videos")
@@ -73,11 +74,11 @@
7374
74# pylint: disable=R090375# pylint: disable=R0903
75class Daemon:76class Daemon:
76 77
77 """Creation of a lens with a local scope."""78 """Creation of a lens with a local scope."""
7879
79 def __init__(self):80 def __init__(self):
80 #Create the lens81 # Create the lens
81 self._lens = Unity.Lens.new("/net/launchpad/lens/video", "video")82 self._lens = Unity.Lens.new("/net/launchpad/lens/video", "video")
82 self._lens.props.search_hint = HINT83 self._lens.props.search_hint = HINT
83 self._lens.props.visible = True84 self._lens.props.visible = True
@@ -99,12 +100,16 @@
99 cats.append(Unity.Category.new(CAT_GLOBAL,100 cats.append(Unity.Category.new(CAT_GLOBAL,
100 Gio.ThemedIcon.new("/usr/share/unity/6/lens-nav-video.svg"),101 Gio.ThemedIcon.new("/usr/share/unity/6/lens-nav-video.svg"),
101 Unity.CategoryRenderer.VERTICAL_TILE))102 Unity.CategoryRenderer.VERTICAL_TILE))
103 # Home Dash recommended online videos category
104 cats.append(Unity.Category.new(CAT_RECOMMENDED,
105 Gio.ThemedIcon.new("/usr/share/unity/6/lens-nav-video.svg"),
106 Unity.CategoryRenderer.FLOW))
102 self._lens.props.categories = cats107 self._lens.props.categories = cats
103108
104 filters = []109 filters = []
105 self._lens.props.filters = filters110 self._lens.props.filters = filters
106 111
107 112
108 # Create the scope113 # Create the scope
109 self._scope = Unity.Scope.new("/net/launchpad/lens/video/main")114 self._scope = Unity.Scope.new("/net/launchpad/lens/video/main")
110 self._scope.search_in_global = True115 self._scope.search_in_global = True
@@ -130,7 +135,7 @@
130 return True135 return True
131 else:136 else:
132 return False137 return False
133 138
134 def on_preview_uri(self, scope, uri):139 def on_preview_uri(self, scope, uri):
135 """Preview request handler"""140 """Preview request handler"""
136 preview = None141 preview = None
@@ -159,6 +164,8 @@
159 preview.add_info(Unity.InfoHint.new("format", _("Format"), None, GstPbutils.pb_utils_get_codec_description(vstream.get_caps())))164 preview.add_info(Unity.InfoHint.new("format", _("Format"), None, GstPbutils.pb_utils_get_codec_description(vstream.get_caps())))
160 preview.add_info(Unity.InfoHint.new("dimensions", _("Dimensions"), None, dimensions))165 preview.add_info(Unity.InfoHint.new("dimensions", _("Dimensions"), None, dimensions))
161 preview.add_info(Unity.InfoHint.new("size", _("Size"), None, GLib.format_size(os.path.getsize(GLib.filename_from_uri(uri, None)))))166 preview.add_info(Unity.InfoHint.new("size", _("Size"), None, GLib.format_size(os.path.getsize(GLib.filename_from_uri(uri, None)))))
167 else:
168 print "No video streams detected that can be previewed."
162 except Exception as e:169 except Exception as e:
163 print "Couldn't get video details", e170 print "Couldn't get video details", e
164 show_folder = Unity.PreviewAction.new("show-in-folder", _("Show in Folder"), None)171 show_folder = Unity.PreviewAction.new("show-in-folder", _("Show in Folder"), None)
@@ -198,16 +205,18 @@
198 print "Search changed to \"%s\"" % search_string205 print "Search changed to \"%s\"" % search_string
199 model = search.props.results_model206 model = search.props.results_model
200 if self.source_activated('local'):207 if self.source_activated('local'):
208 # Global search
201 if search_type is Unity.SearchType.GLOBAL:209 if search_type is Unity.SearchType.GLOBAL:
202 if search_string == '':210 if search_string == '':
203 model.clear ()211 model.clear ()
204 if search_status:212 if search_status:
205 search_status.finished ()213 search_status.finished ()
206 print "Global view without search string : hide"214 print "Global view without search string : hide"
207 215
208 else:216 else:
209 self.update_results_model(search_string, model, 'global', cancellable, search_status)217 self.update_results_model(search_string, model, 'global', cancellable, search_status)
210 else:218 else:
219 # Lens search
211 self.update_results_model(search_string, model, 'lens', cancellable, search_status)220 self.update_results_model(search_string, model, 'lens', cancellable, search_status)
212 else:221 else:
213 model.clear()222 model.clear()
@@ -243,6 +252,7 @@
243 results = None252 results = None
244 else:253 else:
245 results = None254 results = None
255 # Populate the search results to display to the user
246 result_list = []256 result_list = []
247 blacklist = self.get_blacklist ()257 blacklist = self.get_blacklist ()
248 if results:258 if results:
@@ -253,6 +263,7 @@
253 if self.is_video(video) and not self.is_hidden(video, blacklist):263 if self.is_video(video) and not self.is_hidden(video, blacklist):
254 video_counter+= 1264 video_counter+= 1
255 title = self.get_name(video)265 title = self.get_name(video)
266 print "title: " + title
256 comment = ''267 comment = ''
257 uri = 'file://%s' % video268 uri = 'file://%s' % video
258 icon = self.get_icon(video)269 icon = self.get_icon(video)
@@ -264,14 +275,14 @@
264 item.append(icon)275 item.append(icon)
265 result_list.append(item)276 result_list.append(item)
266 result_list = self.sort_alpha(result_list)277 result_list = self.sort_alpha(result_list)
267 278
268 GLib.idle_add(self.add_results, search_status, model, cat, cancellable, result_list, search)279 GLib.idle_add(self.add_results, search_status, model, cat, cancellable, result_list, search)
269 280
270281
271 def add_results (self, search_status=None, model=None, 282 def add_results (self, search_status=None, model=None,
272 cat=None, cancellable=None, result_list=[], search=None):283 cat=None, cancellable=None, result_list=[], search=None):
273 result_sets = []284 result_sets = []
274 285
275 if cancellable and not cancellable.is_cancelled():286 if cancellable and not cancellable.is_cancelled():
276 if cat == 'global':287 if cat == 'global':
277 # Create only one result set for the Global search288 # Create only one result set for the Global search

Subscribers

People subscribed via source and target branches