From 1d9a51ae2d8372128a37ae64b1d90ab23f392a8e Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Mon, 14 Oct 2013 03:04:25 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:turtleart/mainline --- diff --git a/NEWS b/NEWS index b59d9cc..af4df0e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ +192 + +ENHANCEMENTS: +* New sample program (Snake game) +* New translations +* Moved save snapshot button to Load/Save palette (Users were confusing it + for the save image button.) + +BUG FIXES: +* Fixed regression in Sugar 84 support +* Fixed problem with GNOME due to Sugar button check (Alan Aguiar) + 191 ENHANCEMENTS: @@ -5,7 +17,7 @@ ENHANCEMENTS: * New translations * Add support for querying remote turtle position, heading -BUG FIX: +BUG FIXES: * Fixed collaboration bug (#4631) * Fixed i18n problem with 'select palette' block * Fixed problem with load block 'turtle' diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 73ce930..4388779 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -498,14 +498,15 @@ class TurtleArtWindow(): if not self.activity._unfullscreen_button.props.visible: self.activity._unfullscreen_button.show() # Reset the timer - if self.activity._unfullscreen_button_timeout_id is not None: - gobject.source_remove( - self.activity._unfullscreen_button_timeout_id) - self.activity._unfullscreen_button_timeout_id = None + if hasattr(self.activity, '_unfullscreen_button_timeout_id'): + if self.activity._unfullscreen_button_timeout_id is not None: + gobject.source_remove( + self.activity._unfullscreen_button_timeout_id) + self.activity._unfullscreen_button_timeout_id = None - self.activity._unfullscreen_button_timeout_id = \ - gobject.timeout_add_seconds(_UNFULLSCREEN_VISIBILITY_TIMEOUT, - self.__unfullscreen_button_timeout_cb) + self.activity._unfullscreen_button_timeout_id = \ + gobject.timeout_add_seconds(_UNFULLSCREEN_VISIBILITY_TIMEOUT, + self.__unfullscreen_button_timeout_cb) def __unfullscreen_button_timeout_cb(self): self.activity._unfullscreen_button.hide() @@ -650,7 +651,8 @@ class TurtleArtWindow(): if event is None: return - self.activity.check_buttons_for_fit() + if self.running_sugar: + self.activity.check_buttons_for_fit() # If there are any constant blocks on the canvas, relabel them for blk in self.just_blocks(): diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 7019a2b..3b83236 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -170,30 +170,23 @@ class TurtleArtActivity(activity.Activity): # scrolling window self._setup_palette_toolbar() - if self.keep_button in self._toolbox.toolbar: + if self.samples_button in self._toolbox.toolbar: self._toolbox.toolbar.remove(self.extras_separator) - self._toolbox.toolbar.remove(self.keep_button) self._toolbox.toolbar.remove(self.samples_button) self._toolbox.toolbar.remove(self.stop_separator) self._toolbox.toolbar.remove(self.stop_button) self._view_toolbar.remove(self._coordinates_toolitem) if gtk.gdk.screen_width() / 14 < style.GRID_CELL_SIZE: - self.keep_button2.show() - self.keep_label2.show() self.samples_button2.show() self.samples_label2.show() self._toolbox.toolbar.insert(self.stop_button, -1) else: - self.keep_button2.hide() - self.keep_label2.hide() self.samples_button2.hide() self.samples_label2.hide() self._toolbox.toolbar.insert(self.extras_separator, -1) self.extras_separator.props.draw = True self.extras_separator.show() - self._toolbox.toolbar.insert(self.keep_button, -1) - self.keep_button.show() self._toolbox.toolbar.insert(self.samples_button, -1) self.samples_button.show() self._toolbox.toolbar.insert(self.stop_separator, -1) @@ -753,10 +746,6 @@ class TurtleArtActivity(activity.Activity): self.extras_separator = self._add_separator( self._toolbox.toolbar, expand=False, visible=True) - self.keep_button = self._add_button( - 'filesaveoff', _('Save snapshot'), self.do_keep_cb, - self._toolbox.toolbar) - self.samples_button = self._add_button( 'ta-open', _('Load example'), self.do_samples_cb, self._toolbox.toolbar) @@ -796,7 +785,6 @@ class TurtleArtActivity(activity.Activity): add_paragraph(help_box, _('Step'), icon='run-slowoff') add_paragraph(help_box, _('Stop turtle'), icon='stopitoff') add_paragraph(help_box, _('Show blocks'), icon='hideshowoff') - add_paragraph(help_box, _('Save snapshot'), icon='filesaveoff') add_paragraph(help_box, _('Load example'), icon='ta-open') add_paragraph(help_box, _('Help'), icon='help-toolbar') add_paragraph(help_box, _('Stop'), icon='activity-stop') @@ -821,6 +809,7 @@ class TurtleArtActivity(activity.Activity): add_section(help_box, _('Save/Load'), icon='turtleoff') add_paragraph(help_box, _('Save as image'), icon='image-saveoff') add_paragraph(help_box, _('Save as Logo'), icon='logo-saveoff') + add_paragraph(help_box, _('Save snapshot'), icon='filesaveoff') add_paragraph(help_box, _('Load project'), icon='load-from-journal') home = os.environ['HOME'] if activity.get_bundle_path()[0:len(home)] == home: @@ -1005,12 +994,12 @@ class TurtleArtActivity(activity.Activity): self.save_as_logo, label = self._add_button_and_label( 'logo-saveoff', _('Save as Logo'), self.do_save_as_logo_cb, None, button_box) - - # When screen is in portrait mode, the buttons don't fit - # on the main toolbar, so put them here. self.keep_button2, self.keep_label2 = self._add_button_and_label( 'filesaveoff', _('Save snapshot'), self.do_keep_cb, None, button_box) + + # When screen is in portrait mode, the buttons don't fit + # on the main toolbar, so put them here. self.samples_button2, self.samples_label2 = \ self._add_button_and_label('ta-open', _('Load example'), diff --git a/samples/games-snake.tb b/samples/games-snake.tb new file mode 100644 index 0000000..397ffc8 --- /dev/null +++ b/samples/games-snake.tb @@ -0,0 +1,53 @@ +[[0, ["start", 2.0], 400, 20, [null, 51]], +[1, "hat", 820, 260, [null, 2, 14]], +[2, ["string", "left"], 879, 272, [1, null]], +[3, "hat", 820, 20, [null, 4, 13]], +[4, ["string", "right"], 879, 32, [3, null]], +[5, "stack", 160, 236, [11, 6, 7]], +[6, ["string", "left"], 219, 236, [5, null]], +[7, "stack", 160, 278, [5, 8, 9]], +[8, ["string", "right"], 219, 278, [7, null]], +[9, "forward", 160, 320, [7, 10, 37]], +[10, ["number", 10], 234, 320, [9, null]], +[11, "kbinput", 160, 194, [47, 5]], +[12, ["forever", 166], 400, 108, [51, 49, null]], +[13, ["vspace", 0], 820, 74, [3, 15]], +[14, ["vspace", 0], 820, 314, [1, 16]], +[15, ["if", 0], 820, 116, [13, 19, 23, null]], +[16, ["if", 0], 820, 356, [14, 20, 25, null]], +[17, ["string", "l"], 942, 322, [20, null]], +[18, ["string", "r"], 942, 82, [19, null]], +[19, ["equal2", 0], 886, 82, [15, 18, 21, null]], +[20, ["equal2", 0], 886, 322, [16, 17, 22, null]], +[21, "keyboard", 942, 124, [19, null]], +[22, "keyboard", 942, 364, [20, null]], +[23, "right", 838, 182, [15, 24, null]], +[24, ["number", 10], 910, 182, [23, null]], +[25, "left", 838, 422, [16, 26, null]], +[26, ["number", 10], 917, 422, [25, null]], +[27, "wait", 418, 474, [39, 28, null]], +[28, ["number", 0.1], 487, 474, [27, null]], +[29, "forward", 160, 404, [37, 30, 33]], +[30, ["number", 8.0], 234, 404, [29, null]], +[31, "back", 160, 488, [33, 32, 38]], +[32, ["number", 8.0], 218, 488, [31, null]], +[33, "readpixel", 160, 446, [29, 31]], +[34, "pop", 594, 192, [45, null]], +[35, "pop", 648, 234, [46, null]], +[36, "pop", 648, 276, [46, null]], +[37, "penup", 160, 362, [9, 29]], +[38, "pendown", 160, 530, [31, null]], +[39, ["if", 21], 418, 306, [42, 40, 44, 27]], +[40, ["equal2", 40], 484, 192, [39, 45, 41, null]], +[41, ["number", 255], 540, 314, [40, null]], +[42, ["vspace", 40], 418, 184, [49, 39]], +[43, "stopstack", 436, 414, [44, null]], +[44, "showblocks", 436, 372, [39, 43]], +[45, ["plus2", 0], 540, 192, [40, 34, 46]], +[46, ["plus2", 0], 594, 234, [45, 35, 36]], +[47, "hat", 160, 140, [null, 48, 11]], +[48, ["string", "acci\u00f3n"], 219, 152, [47, null]], +[49, "stack", 418, 142, [12, 50, 42]], +[50, ["string", "acci\u00f3n"], 477, 142, [49, null]], +[51, "setpensize", 400, 66, [0, 52, 12]], +[52, ["number", 5], 501, 66, [51, null]]] diff --git a/samples/thumbnails/games-snake.png b/samples/thumbnails/games-snake.png new file mode 100644 index 0000000..da57530 --- /dev/null +++ b/samples/thumbnails/games-snake.png Binary files differ -- cgit v0.9.1