From c5857a8fbf9fb356e8d6f99cff1e0c986a0ce0ee Mon Sep 17 00:00:00 2001 From: Daniel Francis Date: Mon, 16 Jul 2012 17:42:08 +0000 Subject: Update image preview --- diff --git a/activity.py b/activity.py index 21f836e..56f3af3 100644 --- a/activity.py +++ b/activity.py @@ -159,13 +159,13 @@ class AnimateActivity(activity.Activity): self._animation.set_fps(fps) def _set_return_mode(self, widget): - self._animation.set_mode(animation.RETURN_MODE) + self._animation.set_mode(animation.MODE_RETURN) def _set_normal_mode(self, widget): - self._animation.set_mode(animation.NORMAL_MODE) + self._animation.set_mode(animation.MODE_NORMAL) def _set_pingpong_mode(self, widget): - self._animation.set_mode(animation.PING_PONG_MODE) + self._animation.set_mode(animation.MODE_PING_PONG) def _previous_frame(self, widget): self._animation.back() @@ -209,12 +209,13 @@ class AnimateActivity(activity.Activity): del self._animation_mode - canvas.pack_start(self._animation, True, True, 0) + canvas.pack_start(self._animation, True, True, 0) def _current_frame_updated_cb(self, widget, index): if widget.frames_reverse: index = len(widget.frames) - 1 - index self._frames_list.select_frame(index) + return index def _view_fullscreen(self, widget): self._frames_list.hide() diff --git a/animation.py b/animation.py index 83d33b1..a0818a8 100644 --- a/animation.py +++ b/animation.py @@ -51,7 +51,7 @@ class Animation(gtk.Image): gobject.PARAM_READWRITE)} __gsignals__ = {"current-frame-updated": (gobject.SIGNAL_RUN_LAST, - gobject.TYPE_NONE, + gobject.TYPE_INT, (gobject.TYPE_INT,))} def __init__(self, width, height, fps=2): @@ -193,7 +193,8 @@ class Animation(gtk.Image): else: self._current_frame = 0 - self.emit("current-frame-updated", self._current_frame) + pos = self.emit("current-frame-updated", self._current_frame) + self.set_current_frame(pos) return True -- cgit v0.9.1