From 2152dc0f11ac085e9aecbe574774c7253612a7d3 Mon Sep 17 00:00:00 2001 From: Agustin Zubiaga Date: Sun, 27 May 2012 03:58:14 +0000 Subject: Return checkbutton added --- diff --git a/TODO b/TODO index e1ca68f..2ef1ce3 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,9 @@ New functions: - Save data in journal + - Select time between frames + - Check button for set return (In progress) Fixes: - - Select the frame in the list when the animation is running - - Use the treeselection in the place of row-selected event in treeview (In progress) + - Select the frame in the list when the animation is running [DONE] + - Use the treeselection in the place of row-selected event in treeview [DONE] Bugs: - Show correctly indexed the selected image from the FramesList in the Animation. diff --git a/activity.py b/activity.py index 81c421b..0a71fba 100644 --- a/activity.py +++ b/activity.py @@ -25,6 +25,7 @@ import gtk from sugar.activity import activity from sugar.activity.widgets import StopButton +from sugar.activity.widgets import ToolbarButton from sugar.activity.widgets import ActivityToolbarButton from sugar.graphics.objectchooser import ObjectChooser from sugar.graphics.toolbarbox import ToolbarBox @@ -80,6 +81,26 @@ class AnimateActivity(activity.Activity): toolbarbox.toolbar.insert(next_btn, -1) separator = gtk.SeparatorToolItem() + separator.set_expand(False) + separator.set_draw(True) + toolbarbox.toolbar.insert(separator, -1) + + options_button = ToolbarButton(icon_name='preferences-system') + options_toolbar = gtk.Toolbar() + + checkbutton = gtk.CheckButton("Return ") + checkbutton.set_active(True) + checkbutton.connect("toggled", self._set_return) + toolitem = gtk.ToolItem() + toolitem.add(checkbutton) + options_toolbar.insert(toolitem, -1) + + options_button.props.page = options_toolbar + options_toolbar.show_all() + + toolbarbox.toolbar.insert(options_button, -1) + + separator = gtk.SeparatorToolItem() separator.set_expand(True) separator.set_draw(False) toolbarbox.toolbar.insert(separator, -1) @@ -117,6 +138,9 @@ class AnimateActivity(activity.Activity): else: return + def _set_return(self, widget): + self._animation.set_return(widget.get_active()) + def _previous_frame(self, widget): self._animation.back() -- cgit v0.9.1