diff options
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/activity.py b/activity.py index 7b9bec3..21f836e 100644 --- a/activity.py +++ b/activity.py @@ -49,17 +49,17 @@ class AnimateActivity(activity.Activity): self.max_participants = 1 - toolbarbox = AnimateToolbarBox(self) + self._toolbarbox = AnimateToolbarBox(self) - self.set_toolbar_box(toolbarbox) - toolbarbox.show_all() + self.set_toolbar_box(self._toolbarbox) + self._toolbarbox.show_all() canvas = gtk.HBox() self._animation = None self._animation_frames = [] self.animation_mode = animation.MODE_RETURN - self.modes_buttons = toolbarbox.modes_buttons + self.modes_buttons = self._toolbarbox.modes_buttons self._frames_list = FramesList() self._frames_list.connect("current-frame-changed", @@ -73,6 +73,8 @@ class AnimateActivity(activity.Activity): vbox.pack_start(self._frames_list, True, True, 0) frames_toolbar = FramesToolbar() + frames_toolbar.connect('go-up', self._frames_list.move_up) + frames_toolbar.connect('go-down', self._frames_list.move_down) vbox.pack_end(frames_toolbar, False, True, 0) canvas.pack_end(vbox, False, True, 0) @@ -83,7 +85,7 @@ class AnimateActivity(activity.Activity): self.show() - def _move_cb(self, index, new_index): + def _move_cb(self, widget, index, new_index): self._animation.move(index, new_index) def _current_frame_changed_cb(self, index): @@ -95,7 +97,7 @@ class AnimateActivity(activity.Activity): temp_file_path = tempfile.mktemp() temp_file = open(temp_file_path, "w") temp_file_content = {"mode": self._animation.get_mode(), - "framerate": self._fpsbutton.get_value()} + "framerate": self._toolbarbox.get_fps()} try: json.dump(temp_file_content, temp_file) finally: @@ -134,7 +136,7 @@ class AnimateActivity(activity.Activity): mode = options['mode'] self._animation_mode = mode self.modes_buttons[mode].set_active(True) - self._fpsbutton.set_value(options['framerate']) + self._toolbarbox.set_fps(options['framerate']) def _remove_frame(self, widget): self._frames_list.remove_selected_frame() @@ -200,7 +202,7 @@ class AnimateActivity(activity.Activity): for pixbuf in self._animation_frames: self._animation.add_frame(pixbuf) self._frames_list.add_frame(pixbuf) - self._animation.set_fps(self._fpsbutton.get_value()) + self._animation.set_fps(self._toolbarbox.get_fps()) self._animation.connect("current-frame-updated", self._current_frame_updated_cb) self._animation.show_all() |