From 68cb5b448753040aa49889e1fae9a09239a6acf2 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 11 Dec 2013 15:16:15 +0000 Subject: set default to journal when loading heap in Sugar --- (limited to 'plugins/turtle_blocks_extras') diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py index 2bb07dd..ec4558f 100644 --- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py +++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py @@ -541,17 +541,35 @@ make "tmp first :taheap\nmake "taheap butfirst :taheap\noutput :tmp\nend\n') prim_name='saveheap', help_string=_('saves FILO (first-in \ last-out heap) to a file')) + self.tw.lc.def_prim('saveheap', 1, Primitive(self.tw.lc.save_heap, arg_descs=[ArgSlot(TYPE_OBJECT)])) - palette.add_block('loadheap', - style='basic-style-1arg', - label=_('load heap from file'), - default=_('filename'), - prim_name='loadheap', - help_string=_('loads FILO (first-in \ + if self.tw.running_sugar: + palette.add_block('loadheap', + style='basic-style-1arg', + hidden=True, + label=_('load heap from file'), + default=_('filename'), + prim_name='loadheap', + help_string=_('loads FILO (first-in \ last-out heap) from a file')) + # macro + palette.add_block('loadheapfromjournal', + style='basic-style-1arg', + label=_('load heap from file'), + help_string=_('loads FILO (first-in \ +last-out heap) from a file')) + else: + palette.add_block('loadheap', + style='basic-style-1arg', + label=_('load heap from file'), + default=_('filename'), + prim_name='loadheap', + help_string=_('loads FILO (first-in \ +last-out heap) from a file')) + self.tw.lc.def_prim('loadheap', 1, Primitive(self.tw.lc.load_heap, arg_descs=[ArgSlot(TYPE_OBJECT)], -- cgit v0.9.1