From 3bfd76424394ad8e151cc9d11e82fd0b3da79b7c Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Tue, 13 Nov 2012 19:30:37 +0000 Subject: clean up; fix custom food bug --- diff --git a/NEWS b/NEWS index 8ed7921..1b7f37c 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,14 @@ NEWS +9 + +ENHACEMENT: +* New translations +* Add summary string + +BUG_FIX: +* Fix regression in add custom food code + 7 ENHACEMENT: diff --git a/NutritionActivity.py b/NutritionActivity.py index b412ed1..2755d48 100644 --- a/NutritionActivity.py +++ b/NutritionActivity.py @@ -144,7 +144,7 @@ class NutritionActivity(activity.Activity): group=name_game_button) separator_factory(toolbox.toolbar, False, True) - self._label = label_factory(toolbox.toolbar, LABELS[0]) + self._label = label_factory(toolbox.toolbar, LABELS[0], width=150) separator_factory(toolbox.toolbar, True, False) tools_toolbar = Gtk.Toolbar() diff --git a/activity/activity.info b/activity/activity.info index c10b421..ea46647 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,8 +1,9 @@ [Activity] name = Nutrition -activity_version = 7 +activity_version = 9 license = GPLv3 bundle_id = org.sugarlabs.NutritionActivity exec = sugar-activity NutritionActivity.NutritionActivity icon = activity-nutrition show_launcher = yes +summary = a series of game about good habits for eating \ No newline at end of file diff --git a/food.pyc b/food.pyc deleted file mode 100644 index 8705424..0000000 --- a/food.pyc +++ /dev/null Binary files differ diff --git a/game.py b/game.py index a788e7c..1286130 100644 --- a/game.py +++ b/game.py @@ -161,28 +161,38 @@ class Game(): card_list[i].set_margins(10, 0, 10, 0) card_list[i].hide() - def picture_append(self, path, i): - self._picture_cards[i] = Sprite( + def picture_append(self, path, i=-1): + spr = Sprite( self._sprites, int(self._width / 2.), int(self._height / 4.), GdkPixbuf.Pixbuf.new_from_file_at_size( path, int(self._width / 3.), int(9 * self._width / 12.))) + if i == -1: + self._picture_cards.append(spr) + else: + self._picture_cards[i] = spr self._picture_cards[i].type = 'picture' self._picture_cards[i].hide() - def small_picture_append(self, path, i): + def small_picture_append(self, path, i=-1): x = int(self._width / 3.) y = int(self._height / 6.) + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( + path, + int(self._width / 6.), + int(3 * self._width / 8.)) for j in range(6): # up to 6 of each card - self._small_picture_cards[i * 6 + j] = Sprite( - self._sprites, x, y, - GdkPixbuf.Pixbuf.new_from_file_at_size( - path, - int(self._width / 6.), - int(3 * self._width / 8.))) - self._small_picture_cards[i * 6 + j].type = 'picture' - self._small_picture_cards[i * 6 + j].hide() + if i == -1: + self._small_picture_cards.append(Sprite( + self._sprites, x, y, pixbuf)) + self._small_picture_cards[-1].type = 'picture' + self._small_picture_cards[-1].hide() + else: + self._small_picture_cards[i * 6 + j] = Sprite( + self._sprites, x, y, pixbuf) + self._small_picture_cards[i * 6 + j].type = 'picture' + self._small_picture_cards[i * 6 + j].hide() x += int(self._width / 6.) if j == 2: x = int(self._width / 3.) diff --git a/sprites.pyc b/sprites.pyc deleted file mode 100644 index dde1dd9..0000000 --- a/sprites.pyc +++ /dev/null Binary files differ -- cgit v0.9.1