totem r5420 - in trunk: . src/plugins/publish src/plugins/youtube
- From: pwithnall svn gnome org
- To: svn-commits-list gnome org
- Subject: totem r5420 - in trunk: . src/plugins/publish src/plugins/youtube
- Date: Fri, 23 May 2008 12:24:17 +0000 (UTC)
Author: pwithnall
Date: Fri May 23 12:24:17 2008
New Revision: 5420
URL: http://svn.gnome.org/viewvc/totem?rev=5420&view=rev
Log:
2008-05-23 Philip Withnall <pwithnall svn gnome org>
* src/plugins/publish/totem-publish.c:
(totem_publish_plugin_stream_cb): Improve my fix for a
signed/unsigned
comparison warning.
* src/plugins/youtube/youtube.py:
* src/plugins/youtube/youtube.ui: Add a progress bar when doing
YouTube searches to show the current status of the operation.
(Closes: #522548)
Modified:
trunk/ChangeLog
trunk/src/plugins/publish/totem-publish.c
trunk/src/plugins/youtube/youtube.py
trunk/src/plugins/youtube/youtube.ui
Modified: trunk/src/plugins/publish/totem-publish.c
==============================================================================
--- trunk/src/plugins/publish/totem-publish.c (original)
+++ trunk/src/plugins/publish/totem-publish.c Fri May 23 12:24:17 2008
@@ -234,8 +234,8 @@
g_return_val_if_fail (NULL != contents, FALSE);
g_return_val_if_fail (NULL != length, FALSE);
- if (NULL == data || *length < ABS (size)) {
- *length = MAX (*length, ABS (size));
+ if (NULL == data || *length < (gsize)size) {
+ *length = MAX (*length, (gsize)size);
return FALSE;
}
Modified: trunk/src/plugins/youtube/youtube.py
==============================================================================
--- trunk/src/plugins/youtube/youtube.py (original)
+++ trunk/src/plugins/youtube/youtube.py Fri May 23 12:24:17 2008
@@ -71,6 +71,7 @@
self.search_entry.connect ("activate", self.on_search_entry_activated)
self.search_button = self.builder.get_object ("yt_search_button")
self.search_button.connect ("clicked", self.on_search_button_clicked)
+ self.progress_bar = self.builder.get_object ("yt_progress_bar")
self.notebook = self.builder.get_object ("yt_notebook")
self.notebook.connect ("switch-page", self.on_notebook_page_changed)
@@ -138,6 +139,7 @@
self.youtube_id = youtube_id
self.start_index["related"] = 1
self.results["related"] = 0
+ self.progress_bar.set_text (_("Fetching related videos..."))
self.get_results ("/feeds/api/videos/" + urllib.quote (youtube_id) + "/related?max-results=" + str (self.max_results), "related")
def check_url_for_redirects (self, url_path):
try:
@@ -201,6 +203,7 @@
"""Load more results when we get near the bottom of the treeview"""
if not self.button_down and (adjustment.get_value () + adjustment.page_size) / adjustment.upper > 0.8 and self.results[self.current_treeview_name] >= self.max_results:
self.results[self.current_treeview_name] = 0
+ self.progress_bar.set_text (_("Fetching more videos..."))
if self.current_treeview_name == "search":
self.get_results ("/feeds/api/videos?vq=" + urllib.quote_plus (self.search_terms) + "&max-results=" + str (self.max_results) + "&orderby=relevance&start-index=" + str (self.start_index["search"]), "search", False)
if self.debug:
@@ -215,6 +218,7 @@
def populate_list_from_results (self, treeview_name):
"""Check and acquire the lock"""
if self.entry_lock.acquire (False) == False:
+ self.progress_bar.pulse ()
return True
"""Return if there are no results (or we've finished)"""
@@ -222,6 +226,8 @@
"""Revert the cursor"""
window = self.vbox.window
window.set_cursor (None)
+ self.progress_bar.set_fraction (0.0)
+ self.progress_bar.set_text ("")
self.entry[treeview_name] = None
self.entry_lock.release ()
@@ -234,6 +240,9 @@
self.start_index[treeview_name] += 1
youtube_id = self.convert_url_to_id (entry.id.text)
+ """Update the progress bar"""
+ self.progress_bar.set_fraction (float (self.results[treeview_name]) / float (self.max_results))
+
self.entry_lock.release ()
"""Find the content tag"""
@@ -278,6 +287,7 @@
self.search_terms = search_terms
self.start_index["search"] = 1
self.results["search"] = 0
+ self.progress_bar.set_text (_("Fetching search results..."))
self.get_results ("/feeds/api/videos?vq=" + urllib.quote_plus (search_terms) + "&orderby=relevance&max-results=" + str (self.max_results), "search")
def on_search_entry_activated (self, entry):
self.search_button.clicked ()
@@ -291,6 +301,7 @@
"""Give us a nice waiting cursor"""
window = self.vbox.window
window.set_cursor (gtk.gdk.Cursor (gtk.gdk.WATCH))
+ self.progress_bar.pulse ()
self.results_downloaded = False
DownloadThread (self, url, treeview_name).start ()
Modified: trunk/src/plugins/youtube/youtube.ui
==============================================================================
--- trunk/src/plugins/youtube/youtube.ui (original)
+++ trunk/src/plugins/youtube/youtube.ui Fri May 23 12:24:17 2008
@@ -135,6 +135,14 @@
<property name="fill">True</property>
</packing>
</child>
+ <child>
+ <object class="GtkProgressBar" id="yt_progress_bar"/>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
</object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]