summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2010-01-21 23:55:01 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2010-01-21 23:55:01 +0800
commit98ec4a0f1ad625b241091be7d46740b7c5240d3a (patch)
tree634ce1831f62fd2f5e676ebf6fb09d95f877e7a7
parent20ef6b02f0a205e839f3e09b0b38e9fec8ca90b1 (diff)
ppstream: separate out movie jump methods
-rw-r--r--totem/plugin/ppstream.py32
1 files changed, 22 insertions, 10 deletions
diff --git a/totem/plugin/ppstream.py b/totem/plugin/ppstream.py
index db9083c..ebcbb48 100644
--- a/totem/plugin/ppstream.py
+++ b/totem/plugin/ppstream.py
@@ -1418,10 +1418,7 @@ class PPStream (totem.Plugin):
else:
self.add_to_favorites_button.set_sensitive(all_files_fetched)
- def on_first_page_clicked(self, *args):
- if self.movie_class_path == ():
- return
-
+ def movie_goto_first_page(self):
cls = self.get_movie_class(self.movie_class_path)
if self.movies_page == 0:
@@ -1430,18 +1427,24 @@ class PPStream (totem.Plugin):
self.show_movies(self.movie_class_path, force = True)
- def on_prev_page_clicked(self, *args):
+ def on_first_page_clicked(self, *args):
if self.movie_class_path == ():
return
+ self.movie_goto_first_page()
+
+ def movie_goto_prev_page(self):
if self.movies_page < 1:
return
self.movies_page -= 1
self.show_movies(self.movie_class_path, force = True)
- def on_next_page_clicked(self, *args):
+ def on_prev_page_clicked(self, *args):
if self.movie_class_path == ():
return
+ self.movie_goto_prev_page()
+
+ def movie_goto_next_page(self):
cls = self.get_movie_class(self.movie_class_path)
if self.movies_page >= cls.getMaxPage() - 1:
@@ -1450,10 +1453,12 @@ class PPStream (totem.Plugin):
self.show_movies(self.movie_class_path, force = True)
- def on_last_page_clicked(self, *args):
+ def on_next_page_clicked(self, *args):
if self.movie_class_path == ():
return
+ self.movie_goto_next_page()
+ def movie_goto_last_page(self):
cls = self.get_movie_class(self.movie_class_path)
if self.movies_page == cls.getMaxPage() - 1:
@@ -1462,13 +1467,13 @@ class PPStream (totem.Plugin):
self.show_movies(self.movie_class_path, force = True)
- def on_goto_page_clicked(self, *args):
+ def on_last_page_clicked(self, *args):
if self.movie_class_path == ():
return
+ self.movie_goto_last_page()
+ def movie_goto_page(self, page):
cls = self.get_movie_class(self.movie_class_path)
-
- page = self.which_page_button.get_value_as_int() - 1
if page >= cls.getMaxPage():
return
if page == self.movies_page:
@@ -1476,6 +1481,13 @@ class PPStream (totem.Plugin):
self.movies_page = page
self.show_movies(self.movie_class_path, force = True)
+ def on_goto_page_clicked(self, *args):
+ if self.movie_class_path == ():
+ return
+
+ page = self.which_page_button.get_value_as_int() - 1
+ self.movie_goto_page(page)
+
def set_page_max(self, max_page):
adjustment = self.which_page_button.get_adjustment()
adjustment.upper = max_page