summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2009-12-26 18:23:17 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2009-12-26 18:23:17 +0800
commitf78154887c46df98c840631f9979c8c210cc7b1b (patch)
treebea5f717e2ee7e410bcc27217026a18a563e1f68
parent22a0c1242327dc3a8e40d1542e6b6ffa3be47676 (diff)
totem: rename films_ids to movie_class_path
-rw-r--r--totem/plugin/ppstream.py92
1 files changed, 46 insertions, 46 deletions
diff --git a/totem/plugin/ppstream.py b/totem/plugin/ppstream.py
index 050fcbf..a8ae496 100644
--- a/totem/plugin/ppstream.py
+++ b/totem/plugin/ppstream.py
@@ -517,7 +517,7 @@ class PPStream (totem.Plugin):
self.ppslist.reset()
if self.ppslist.getClasses() == []:
- self.films_ids = ()
+ self.movie_class_path = ()
self.subclass_index = 0
self.categories_count += 1
self.films_count += 1
@@ -990,14 +990,14 @@ class PPStream (totem.Plugin):
self.update_category (self.favorites)
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
- clsid, subclsid = self.films_ids
+ clsid, subclsid = self.movie_class_path
if (clsid, subclsid) != (CATEGORY_ID_FAVORITES, 0):
return
- self.films_ids = ()
+ self.movie_class_path = ()
self.show_films (clsid, subclsid, False, True)
def setup_recent (self):
@@ -1058,16 +1058,16 @@ class PPStream (totem.Plugin):
films.remove (film)
else:
while len (films) > MAX_RECENT - 1:
- if self.films_ids == (CATEGORY_ID_RECENT, 0):
+ if self.movie_class_path == (CATEGORY_ID_RECENT, 0):
del self.liststore[-1]
del films[-1]
self.recent.resetMovies()
self.recent.setMovies([film] + films)
- if self.films_ids == (CATEGORY_ID_RECENT, 0):
+ if self.movie_class_path == (CATEGORY_ID_RECENT, 0):
if old_index < 0:
- self.storelist_append_film (liststore, film, self.films_ids[0],
- self.films_ids[1], 0)
+ self.storelist_append_film (liststore, film, self.movie_class_path[0],
+ self.movie_class_path[1], 0)
else:
iter = liststore.get_iter (old_index)
liststore.move_after (iter, None)
@@ -1084,14 +1084,14 @@ class PPStream (totem.Plugin):
def refresh_recent (self):
self.refresh_recent_num ()
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
- clsid, subclsid = self.films_ids
+ clsid, subclsid = self.movie_class_path
if (clsid, subclsid) != (CATEGORY_ID_RECENT, 0):
return
- self.films_ids = ()
+ self.movie_class_path = ()
self.show_films (clsid, subclsid, False, True)
def setup_search (self):
@@ -1145,9 +1145,9 @@ class PPStream (totem.Plugin):
liststore.set (iter, 4, s)
def update_current_category (self):
- if not self.films_ids:
+ if not self.movie_class_path:
return
- cls, subcls = self.get_movie_class(*self.films_ids)
+ cls, subcls = self.get_movie_class(*self.movie_class_path)
if not subcls:
subcls = cls
self.update_category (subcls)
@@ -1181,7 +1181,7 @@ class PPStream (totem.Plugin):
try:
### check whether the treeview has been cleared.
- if self.films_ids == (clsid, subclsid) and self.films_count == count:
+ if self.movie_class_path == (clsid, subclsid) and self.films_count == count:
if self.configs['show_posters']:
treeview.set (iter, 0, pixbuf)
else:
@@ -1280,7 +1280,7 @@ class PPStream (totem.Plugin):
self.update_category (subcls)
def fill_films (self, films, clsid, subclsid):
- if self.films_ids != (clsid, subclsid):
+ if self.movie_class_path != (clsid, subclsid):
return
treeview_name = 'films'
liststore = self.liststore[treeview_name]
@@ -1291,29 +1291,29 @@ class PPStream (totem.Plugin):
def refetch_films (self, clsid = None, subclsid = None):
if clsid is None and subclsid is None:
- clsid, subclsid = self.films_ids
+ clsid, subclsid = self.movie_class_path
self.purge_cached_films (clsid, subclsid)
self.retrieveimage.cancel_tasks ()
- self.films_ids = ()
+ self.movie_class_path = ()
self.show_films (clsid, subclsid, True)
def show_films (self, clsid, subclsid, force = False, cancel = True):
### force -- refetch movie list from server
### cancel -- discard the current movie list
- if self.films_ids == (clsid, subclsid) and not force:
+ if self.movie_class_path == (clsid, subclsid) and not force:
return
- self.films_ids = (clsid, subclsid)
+ self.movie_class_path = (clsid, subclsid)
### cancel current fetching thread
if cancel:
self.films_count += 1
- if self.films_ids != ():
- cls, subcls = self.get_movie_class (*self.films_ids)
+ if self.movie_class_path != ():
+ cls, subcls = self.get_movie_class (*self.movie_class_path)
subcls = cls
subcls.fetching_films = False
- self.films_ids = (clsid, subclsid)
+ self.movie_class_path = (clsid, subclsid)
if not self.configs['show_posters']:
self.retrieveimage.cancel_tasks ()
@@ -1355,7 +1355,7 @@ class PPStream (totem.Plugin):
self.start_index[treeview_name] = 1
self.results[treeview_name] = 0
self.entry[treeview_name] = None
- self.films_ids = ()
+ self.movie_class_path = ()
self.films_count = 0
self.films_page = 0
@@ -1613,10 +1613,10 @@ class PPStream (totem.Plugin):
self.add_to_favorites_button.set_sensitive(all_files_fetched)
def on_first_page_clicked(self, *args):
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
- cls, subcls = self.get_movie_class(*self.films_ids)
+ cls, subcls = self.get_movie_class(*self.movie_class_path)
if not subcls:
subcls = cls
@@ -1624,21 +1624,21 @@ class PPStream (totem.Plugin):
return
self.films_page = 0
- self.show_films(*self.films_ids, force = True)
+ self.show_films(*self.movie_class_path, force = True)
def on_prev_page_clicked(self, *args):
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
if self.films_page < 1:
return
self.films_page -= 1
- self.show_films(*self.films_ids, force = True)
+ self.show_films(*self.movie_class_path, force = True)
def on_next_page_clicked(self, *args):
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
- cls, subcls = self.get_movie_class(*self.films_ids)
+ cls, subcls = self.get_movie_class(*self.movie_class_path)
if not subcls:
subcls = cls
@@ -1646,25 +1646,25 @@ class PPStream (totem.Plugin):
return
self.films_page += 1
- self.show_films(*self.films_ids, force = True)
+ self.show_films(*self.movie_class_path, force = True)
def on_last_page_clicked(self, *args):
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
- cls, subcls = self.get_movie_class(*self.films_ids)
+ cls, subcls = self.get_movie_class(*self.movie_class_path)
if not subcls:
subcls = cls
if self.films_page == subcls.getMaxPage() - 1:
return
self.films_page = subcls.getMaxPage() - 1
- self.show_films(self.films_ids, force = True)
+ self.show_films(self.movie_class_path, force = True)
def on_goto_page_clicked(self, *args):
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
- cls, subcls = self.get_movie_class(*self.films_ids)
+ cls, subcls = self.get_movie_class(*self.movie_class_path)
if not subcls:
subcls = cls
@@ -1674,7 +1674,7 @@ class PPStream (totem.Plugin):
if page == self.films_page:
return
self.films_page = page
- self.show_films(*self.films_ids, force = True)
+ self.show_films(*self.movie_class_path, force = True)
def set_page_max(self, max_page):
adjustment = self.which_page_button.get_adjustment()
@@ -1718,9 +1718,9 @@ class PPStream (totem.Plugin):
self.page_hbox.set_sensitive (False)
self.update_progress_bar ()
elif self.current_treeview_name == 'films':
- if self.films_ids == ():
+ if self.movie_class_path == ():
self.refresh_button.set_sensitive (False)
- elif self.films_ids == (0, 0):
+ elif self.movie_class_path == (0, 0):
self.remove_from_favorites_button.set_sensitive (True)
else:
self.refresh_button.set_sensitive (True)
@@ -1753,13 +1753,13 @@ class PPStream (totem.Plugin):
def update_progress_bar (self):
if self.current_treeview_name == 'categories':
return True
- if self.films_ids == ():
+ if self.movie_class_path == ():
self.progress_bar.set_fraction (0.0)
self.progress_bar.set_text ("")
self.progress_bar.hide ()
return True
- cls, subcls = self.get_movie_class (*self.films_ids)
+ cls, subcls = self.get_movie_class (*self.movie_class_path)
if not subcls:
subcls = cls
if subcls.fetching_films:
@@ -1792,7 +1792,7 @@ class PPStream (totem.Plugin):
return True
def on_update_progress_bar (self, clsid, subclsid, count):
- if self.films_ids == (clsid, subclsid) and self.films_count == count:
+ if self.movie_class_path == (clsid, subclsid) and self.films_count == count:
return self.update_progress_bar ()
return False
@@ -1873,15 +1873,15 @@ class PPStream (totem.Plugin):
self.fetch_classes (True)
def refresh_films (self):
- if self.films_ids != ():
+ if self.movie_class_path != ():
self.refetch_films ()
def set_show_posters (self, show = True):
self.cell_video_renderer.set_property ('use_placeholder', show)
- if self.films_ids == ():
+ if self.movie_class_path == ():
return
- clsid, subclsid = self.films_ids
- self.films_ids = ()
+ clsid, subclsid = self.movie_class_path
+ self.movie_class_path = ()
self.show_films (clsid, subclsid, False, False)
def sync_config (self):