1 / 23

OLPC & Sugarlabs

OLPC & Sugarlabs. The NZ Volunteers. Sugar is written in Python. Hacking Sugar. XO-1 /usr/share/sugar/shell/view/home/favoritesview.py XO-1.5 /usr/lib/python2.6/site-packages/jarabe/desktop/favoritesview.py

thimba
Download Presentation

OLPC & Sugarlabs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OLPC & Sugarlabs The NZ Volunteers

  2. Sugar is written in Python

  3. Hacking Sugar XO-1/usr/share/sugar/shell/view/home/favoritesview.pyXO-1.5/usr/lib/python2.6/site-packages/jarabe/desktop/favoritesview.py _LAYOUT_MAP = {RING_LAYOUT: favoriteslayout.RingLayout,#BOX_LAYOUT: favoriteslayout.BoxLayout,#TRIANGLE_LAYOUT: favoriteslayout.TriangleLayout,#SUNFLOWER_LAYOUT: favoriteslayout.SunflowerLayout,RANDOM_LAYOUT: favoriteslayout.RandomLayout}

  4. Spiral View - favoriteslayout.py  class MyLayout(RingLayout):     __gtype_name__ = 'MyLayout'     icon_name = 'view-mylayout'     profile_key = 'my-layout'    def __init__(self):        RingLayout.__init__(self)    def _calculate_radius_and_icon_size(self, children_count):        return None, style.STANDARD_ICON_SIZE    def _calculate_position(self, radius, icon_size, index, children_count):        width, height = self.box.get_allocation()        # angle decreases as the radius increases        angle = index * (2 * math.pi / (12.0 + index / 6.0)) - math.pi / 2        # radius is proportional to index/children_count        myminimum = _MINIMUM_RADIUS * .67        newradius = ((_MAXIMUM_RADIUS - myminimum)*(index*1.1)/children_count)+myminimum        x = newradius * math.cos(angle) + (width - icon_size) / 2        y = newradius * math.sin(angle) + (height - icon_size - style.GRID_CELL_SIZE) / 2        return x, y

  5. Sprial View (part 2) - favoritesview.py RING_LAYOUT, BOX_LAYOUT, TRIANGLE_LAYOUT, SUNFLOWER_LAYOUT, MY_LAYOUT, RANDOM_LAYOUT = \xrange(6)_LAYOUT_MAP = {RING_LAYOUT: favoriteslayout.RingLayout,BOX_LAYOUT: favoriteslayout.BoxLayout,TRIANGLE_LAYOUT: favoriteslayout.TriangleLayout,SUNFLOWER_LAYOUT: favoriteslayout.SunflowerLayout,MY_LAYOUT: favoriteslayout.MyLayout,RANDOM_LAYOUT: favoriteslayout.RandomLayout}

  6. New Zealand Volunteer Group

  7. In Bhutan: Learning by themselves

  8. Where are all the XOs?

  9. Picture courtesy of Myna IT Consulting

  10. Hardware doesn't matter

  11. How can you help? • Join a volunteer group • Download Sugar and try it out - tell your friends • Tweet about OLPC and Sugar • Make a donation

  12. More Information • wiki.laptop.org - OLPC wiki • wiki.sugarlabs.org - Sugarlabs Wiki • www.laptop.org.nz - NZ OLPC Volunteers

More Related