From 22ca42fc60d34a096e85846eee318ed5c071efdf Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Fri, 17 Feb 2012 05:32:19 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:turtleart/mainline --- diff --git a/NEWS b/NEWS index db61699..6018158 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,22 @@ +136 + +ENHANCEMENTS: +* Add method to retrieve plugin instance (Alan Jhonn Aguiar Schwyn) +* New translations + +BUG FIXES: +* Fixed regression in resistance sensor calibration for XO 1.75 +* Fixed another problem with expanded compare blocks +* Fixed problem with disappearing blocks due to dragging over hidden palettes + +135 + +ENHANCEMENTS: +* Changed mechanism for handling "hidden" blocks (used by some plugins) + +BUG FIX: +* Restore currently selected palette after hide/show palette cycle + 134 ENHANCEMENTS: diff --git a/TurtleArt/sprites.py b/TurtleArt/sprites.py index a4e97e7..fdf0105 100644 --- a/TurtleArt/sprites.py +++ b/TurtleArt/sprites.py @@ -120,6 +120,11 @@ class Sprites: else: self.list.insert(i, spr) + def find_in_list(self, spr): + if spr in self.list: + return True + return False + def remove_from_list(self, spr): ''' Remove a sprite from the list. ''' if spr in self.list: @@ -356,7 +361,7 @@ class Sprite: return False if y > self.rect.y + self.rect.height: return False - return True + return self._sprites.find_in_list(self) def draw_label(self, cr): ''' Draw the label based on its attributes ''' diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index e1de162..77459e5 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -1308,12 +1308,7 @@ class TurtleArtWindow(): self.trash_stack = [] def _in_the_trash(self, x, y): - """ Is x, y over the trash can? """ - """ - if self.selected_palette == palette_names.index('trash') and \ - self.palette_sprs[palette_names.index('trash')][self.orientation].hit((x, y)): - return True - """ + """ Is x, y over a palette? """ if self.selected_palette is not None and \ self.palette_sprs[self.selected_palette][self.orientation].hit( (x, y)): @@ -1791,7 +1786,7 @@ class TurtleArtWindow(): return blk = self.drag_group[0] - # Remove blocks by dragging them onto the trash palette. + # Remove blocks by dragging them onto any palette. if self.block_operation == 'move' and self._in_the_trash(x, y): self._put_in_trash(blk, x, y) self.drag_group = None @@ -2028,7 +2023,8 @@ class TurtleArtWindow(): for gblk in find_group(blk): if gblk not in group: gblk.spr.move_relative((0, dy * blk.scale)) - if blk.name in block_styles['compare-style']: + if blk.name in block_styles['compare-style'] or \ + blk.name in block_styles['compare-porch-style']: for gblk in find_group(blk): gblk.spr.move_relative((0, -dy * blk.scale)) @@ -2065,7 +2061,8 @@ class TurtleArtWindow(): for gblk in find_group(blk): if gblk not in group: gblk.spr.move_relative((0, dy * blk.scale)) - if blk.name in block_styles['compare-style']: + if blk.name in block_styles['compare-style'] or \ + blk.name in block_styles['compare-porch-style']: for gblk in find_group(blk): gblk.spr.move_relative((0, -dy * blk.scale)) else: @@ -2194,12 +2191,6 @@ class TurtleArtWindow(): else: dy = 20 + selected_block.ey - best_destination.ey best_destination.expand_in_y(dy) - if best_destination.name in block_styles[ - 'compare-porch-style']: - offset = -dy * best_destination.scale - best_destination.spr.move_relative((0, offset)) - for blk in self.drag_group: - blk.spr.move_relative((0, offset)) else: if best_destination.ey > 0: dy = best_destination.reset_y() @@ -2232,9 +2223,6 @@ class TurtleArtWindow(): dy = blk2.reset_y() if dy != 0: self._expand_expandable(blk2, blk, dy) - if blk2.name in block_styles[ - 'compare-porch-style']: - blk2.spr.move_relative((0, -dy * blk2.scale)) self._cascade_expandable(blk2) grow_stack_arm(find_sandwich_top(blk2)) diff --git a/activity/activity.info b/activity/activity.info index b241329..74f71eb 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,6 +1,6 @@ [Activity] name = Turtle Art -activity_version = 134 +activity_version = 136 license = MIT bundle_id = org.laptop.TurtleArtActivity exec = sugar-activity TurtleArtActivity.TurtleArtActivity diff --git a/taextras.py b/taextras.py index f05d471..03ca330 100644 --- a/taextras.py +++ b/taextras.py @@ -269,7 +269,7 @@ LEGO_STRINGS = [ _('Please check the connection with the brick.'), _('Please check the port.'), _('The value of power must be between -127 to 127.'), - _('An error has ocurred: check all and try reconect.'), + _('An error has ocurred: check all and try reconnect.'), _('NXT found'), _('NXT not found'), _('refresh NXT'), -- cgit v0.9.1