diff options
author | Samus_ <mail2samus@gmail.com> | 2009-10-15 07:42:24 (GMT) |
---|---|---|
committer | Samus_ <mail2samus@gmail.com> | 2009-10-15 07:42:24 (GMT) |
commit | d216d21aa594a3088df5ad0729a2bdb469b79674 (patch) | |
tree | 5c49d3ed72c6c0a53b30e7f81329e618ed127459 | |
parent | 4024ec5e8d8fcad8874e176a5c28bf18f9a7fc04 (diff) |
integrated Sugar (tested on soas)
-rw-r--r-- | activity/activity.info | 9 | ||||
-rw-r--r-- | activity/batalla-naval-icon.svg | 65 | ||||
-rw-r--r-- | application.py | 24 | ||||
-rw-r--r-- | estados/__init__.py | 0 | ||||
-rw-r--r-- | estados/inicio.py | 3 | ||||
-rw-r--r-- | fracciones_activity.py | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | fracciones_standalone.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | main.py | 0 | ||||
-rwxr-xr-x | setup.py | 5 | ||||
-rw-r--r-- | util.py | 21 |
10 files changed, 107 insertions, 22 deletions
diff --git a/activity/activity.info b/activity/activity.info new file mode 100644 index 0000000..692d81c --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,9 @@ +[Activity] +name = Fracciones +bundle_id = progreen.Fracciones +class = fracciones_activity.FraccionesActivity +icon = batalla-naval-icon +activity_version = 1 +host_version = 1 +show_launcher = no +license = GPLv2+ diff --git a/activity/batalla-naval-icon.svg b/activity/batalla-naval-icon.svg new file mode 100644 index 0000000..3c288f8 --- /dev/null +++ b/activity/batalla-naval-icon.svg @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY stroke_color "#666666"> + <!ENTITY fill_color "#FFFFFF"> +]> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.0" + width="55" + height="55" + id="svg4502" + style="display:inline"> + <defs id="defs4504" /> + + <g + transform="translate(-0.2226721,0.2016908)" + id="fondo" + style="opacity:0.5"> + <g + transform="translate(0,-1.8115502)" + id="barras_horizontales" + fill="&fill_color;"> + <rect + width="51.214573" + height="3.7854252" + x="2.4493928" + y="22.482435" + id="rect2398" /> + <rect + width="51.214573" + height="3.7854252" + x="2.4493928" + y="39.06778" + id="rect2404" /> + </g> + <use + transform="matrix(0,0.9057751,-1.1040268,0,62.122828,5.4432283)" + id="use2426" + x="0" + y="0" + width="55" + height="55" + xlink:href="#barras_horizontales" /> + </g> + <g id="terron"> + <path + id="cuerpo" + d="M 38.822128,44.108722 C 38.822128,44.108722 38.445765,44.108722 38.092819,44.108722 C 38.092819,42.747378 38.097001,38.459638 38.097001,37.325183 C 38.097001,37.325183 38.097001,37.325183 38.097001,37.323527 L 38.097001,24.562988 L 38.089474,16.811436 C 38.086128,15.932855 37.361837,15.224857 36.48031,15.228997 C 36.052928,15.228997 35.648965,15.396267 35.347873,15.696856 C 35.045946,15.999101 34.882019,16.399058 34.883691,16.823857 C 34.883691,16.863604 34.885364,19.358576 34.887873,21.45773 L 22.071438,21.45773 C 20.330965,21.45773 18.920019,22.854682 18.920019,24.575409 L 18.920019,26.300276 L 13.265364,26.303588 C 12.377982,26.309384 11.663728,27.024008 11.667074,27.896793 C 11.668746,28.321592 11.837691,28.719892 12.141291,29.017998 C 12.446565,29.316931 12.850528,29.479232 13.277073,29.477576 C 13.326419,29.477576 16.696965,29.47592 18.919182,29.474263 L 18.919182,37.014658 C 18.919182,37.02625 18.915837,37.036187 18.915837,37.046952 C 18.915837,37.104917 18.919182,42.545329 18.919182,44.107894 C 18.567073,44.107894 18.189873,44.107894 18.189873,44.107894 C 17.285765,44.125284 16.584055,44.849844 16.59911,45.724285 C 16.61751,46.601209 17.351837,47.296787 18.234201,47.279397 L 20.537546,47.277741 C 21.439146,47.26118 22.145037,46.535792 22.126637,45.661352 L 22.123292,40.442034 L 34.887873,40.442034 L 34.882019,45.661352 C 34.865292,46.53662 35.571182,47.262009 36.472783,47.277741 L 38.774455,47.279397 C 39.661,47.296787 40.393656,46.601209 40.411219,45.724285 C 40.428782,44.849844 39.723728,44.126112 38.822128,44.108722 z M 30.604855,25.673428 C 31.197837,25.590621 31.748164,25.999687 31.832637,26.587615 C 31.917946,27.174716 31.50311,27.720413 30.910128,27.804876 C 30.3138,27.887683 29.76431,27.476962 29.680673,26.890689 C 29.595365,26.301932 30.010201,25.756235 30.604855,25.673428 z M 24.950201,26.467545 C 25.542346,26.384739 26.09351,26.793805 26.177147,27.381734 C 26.262455,27.97049 25.847619,28.513703 25.255473,28.598995 C 24.659146,28.683458 24.109656,28.272735 24.026019,27.684807 C 23.941546,27.096049 24.353874,26.552009 24.950201,26.467545 z M 26.384565,35.548148 C 25.364201,34.827728 23.744165,32.814693 24.326273,31.447552 C 24.532019,30.966443 24.984492,31.265376 25.47711,31.509657 C 26.653037,32.10421 28.05311,32.180392 29.308492,31.805277 C 29.946637,31.614821 30.491946,31.305951 31.012165,30.893574 C 31.328309,30.641012 32.191437,29.636565 32.666491,30.090346 C 33.037837,30.445588 33.101401,30.886121 33.101401,30.890261 C 33.634164,34.258844 29.418891,37.688706 26.384565,35.548148 z" + fill="&stroke_color;"/> + <path + id="pelo_oscuro" + d="M 17.233073,11.642631 C 18.971874,8.6971904 24.424965,8.6756607 25.411873,12.233044 C 25.743073,13.428775 25.717147,16.000757 24.39151,16.697991 C 23.925655,16.943099 23.764237,16.42804 23.540092,15.929543 C 23.003146,14.736296 21.969401,13.79975 20.755837,13.307049 C 20.139437,13.055317 19.519691,12.950152 18.853946,12.946839 C 18.446637,12.943527 17.137728,13.184495 17.060783,12.532805 C 17.000564,12.027683 17.233073,11.644287 17.233073,11.642631 z" + fill="&stroke_color;"/> + <g + transform="matrix(0.8363636,0,0,0.8280687,4.3773279,7.643887)" + id="pelo_claro"> + <path + d="M 30.514,13.666 C 25.959,9.955 27.36,0.759 33.675,0.043 C 35.799,-0.198 40.171,0.537 41.006,2.954 C 41.299,3.802 40.382,3.936 39.473,4.18 C 37.299,4.765 35.434,6.261 34.273,8.172 C 33.681,9.144 33.342,10.161 33.16,11.281 C 33.047,11.964 33.108,14.236 31.982,14.194 C 31.107,14.162 30.516,13.668 30.514,13.666 z" + id="path2674" + fill="&stroke_color;"/> + </g> + </g> +</svg> diff --git a/application.py b/application.py index b9c3694..dfea187 100644 --- a/application.py +++ b/application.py @@ -1,30 +1,10 @@ # -*- coding: utf-8 -*- import gtk, pygtk -from os import path +from util import reparent +from estados.inicio import Inicio pygtk.require("2.0") -def reparent(manager, template, container): - # construye en nuevo contenido a partir del template de Glade - builder = gtk.Builder() - builder.add_from_file(path.join("templates", template)) - # conecta señales a la clase controladora - builder.connect_signals(manager) - - # elimina contenido previo si existe - for child in container.get_children(): - container.remove(child) - - # inserta el nuevo contenido en el viejo contenedor - window = builder.get_object("window") - for child in window.get_children(): - child.reparent(container) - - return builder - -class Inicio(object): - template = "inicio.glade" - class ApplicationManager(object): """ Maquina de estados principal diff --git a/estados/__init__.py b/estados/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/estados/__init__.py diff --git a/estados/inicio.py b/estados/inicio.py new file mode 100644 index 0000000..b802181 --- /dev/null +++ b/estados/inicio.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +class Inicio(object): + template = "inicio.glade" diff --git a/fracciones_activity.py b/fracciones_activity.py index 2aadabc..7685384 100644 --- a/fracciones_activity.py +++ b/fracciones_activity.py @@ -7,6 +7,8 @@ class FraccionesActivity(Activity): def __init__(self, handle): super(FraccionesActivity, self).__init__(handle) + self.gamename = "Fracciones" + # barra de herramientas de Sugar toolbox = ActivityToolbox(self) self.set_toolbox(toolbox) diff --git a/fracciones_standalone.py b/fracciones_standalone.py index d91373e..d91373e 100755..100644 --- a/fracciones_standalone.py +++ b/fracciones_standalone.py diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..e5847b0 --- /dev/null +++ b/setup.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from sugar.activity import bundlebuilder + +bundlebuilder.start() @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +import gtk +from os import path + +def reparent(manager, template, container): + # construye en nuevo contenido a partir del template de Glade + builder = gtk.Builder() + builder.add_from_file(path.join("templates", template)) + # conecta señales a la clase controladora + builder.connect_signals(manager) + + # elimina contenido previo si existe + for child in container.get_children(): + container.remove(child) + + # inserta el nuevo contenido en el viejo contenedor + window = builder.get_object("window") + for child in window.get_children(): + child.reparent(container) + + return builder |