Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2012-07-05 09:31:24 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2012-07-05 09:31:24 (GMT)
commit206ca048f6509844e440927275d2549eca9a555d (patch)
treec44f1843fc2b70439c5ad7f6f4a78e3dd0a073f3
parent786ad6abfa92dd9858e834d2488cbbe18c38a824 (diff)
renplase el icono de la actividad y raduci a ingles las unidades que me faltaban
-rw-r--r--activity.py39
-rw-r--r--activity/activity.info2
-rw-r--r--activity/activity.info~8
-rw-r--r--activity/icon.svg152
-rw-r--r--convert.py75
5 files changed, 176 insertions, 100 deletions
diff --git a/activity.py b/activity.py
index 9264e74..d6d9bc3 100644
--- a/activity.py
+++ b/activity.py
@@ -27,7 +27,7 @@ from sugar.activity.widgets import ActivityToolbarButton
from sugar.graphics.toolbarbox import ToolbarBox
from sugar.graphics.radiotoolbutton import RadioToolButton
-class Activity(activity.Activity):
+class ConvertActivity(activity.Activity):
def __init__(self, handle):
activity.Activity.__init__(self, handle, True)
@@ -44,14 +44,14 @@ class Activity(activity.Activity):
# RadioToolButton
self._long_btn = RadioToolButton()
- self._long_btn.connect("clicked", self.update_combo, "long")
- self._long_btn.set_tooltip("long")
- self._long_btn.props.icon_name = "long"
+ self._long_btn.connect("clicked", self.update_combo, "lenght")
+ self._long_btn.set_tooltip("lenght")
+ self._long_btn.props.icon_name = "lenght"
self._vol_btn = RadioToolButton()
- self._vol_btn.connect("clicked", self.update_combo, "vol")
- self._vel_btn.set_tooltip("vol")
- self._vol_btn.props.icon_name = "vol"
+ self._vol_btn.connect("clicked", self.update_combo, "volume")
+ self._vol_btn.set_tooltip("volume")
+ self._vol_btn.props.icon_name = "volume"
self._vol_btn.props.group = self._long_btn
self._area_btn = RadioToolButton()
@@ -67,9 +67,9 @@ class Activity(activity.Activity):
self._peso_btn.props.group = self._long_btn
self._vel_btn = RadioToolButton()
- self._vel_btn.connect("clicked", self.update_combo, "vel")
- self._vel_btn.set_tooltip("vel")
- self._vel_btn.props.icon_name = "vel"
+ self._vel_btn.connect("clicked", self.update_combo, "speed")
+ self._vel_btn.set_tooltip("speed")
+ self._vel_btn.props.icon_name = "speed"
self._vel_btn.props.group = self._long_btn
self._time_btn = RadioToolButton()
@@ -110,6 +110,11 @@ class Activity(activity.Activity):
self.show_all()
+ def update_combo(self, widget, data):
+ self.combo1.set_popdown_strings(convert.return_list(data))
+ self.combo2.set_popdown_strings(convert.return_list(data))
+
+
class Canvas(gtk.VBox):
def __init__(self):
gtk.VBox.__init__(self)
@@ -123,15 +128,11 @@ class Canvas(gtk.VBox):
self.combo2 = gtk.ComboBox()
self.table.attach(self.combo2, 3, 4, 0, 1)
- adjustment = gtk.Adjustment(value=1.0, lower=0.0, upper=0.0,
- step_incr=0.5, page_incr=1.0,
- page_size=0.0)
- self.spin_btn1 = gtk.SpinButton(adjustment, 1.0, 0)
+ adjustment = gtk.Adjustment(1.0, 0.1, 1000, 0.1, 0.1, 0.1)
+ self.spin_btn1 = gtk.SpinButton(adjustment, 1.0, 1)
self.table.attach(self.spin_btn1, 1, 2, 1, 2)
- self.spin_btn2 = gtk.SpinButton(adjustment, 1.0, 0)
- self.table.attach(self.spin_btn2, 3, 4, 1, 2)
+ adjustment = gtk.Adjustment(1.0, 0.1, 1000, 0.1, 0.1, 0.1)
- def update_combo(self, widget, data):
- self.combo1.set_popdown_strings(convert.return_list(data))
- self.combo2.set_popdown_strings(convert.return_list(data))
+ self.spin_btn2 = gtk.SpinButton(adjustment, 1.0, 1)
+ self.table.attach(self.spin_btn2, 3, 4, 1, 2)
diff --git a/activity/activity.info b/activity/activity.info
index 7c54ee4..e91d21f 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -3,6 +3,6 @@ name = Convert
activity_version = 1
show_launcher = 1
bundle_id = org.ceibaljam.Convert
-exec = sugar-activity Activity.Activity -s
+exec = sugar-activity activity.ConvertActivity -s
icon = icon
license = GPLv3+
diff --git a/activity/activity.info~ b/activity/activity.info~
deleted file mode 100644
index cad9111..0000000
--- a/activity/activity.info~
+++ /dev/null
@@ -1,8 +0,0 @@
-[Activity]
-name = Converter
-activity_version = 1
-show_launcher = 1
-bundle_id = org.ceibaljam.Converter
-exec = sugar-activity Activity.Activity -s
-icon = icon
-license = GPLv3+
diff --git a/activity/icon.svg b/activity/icon.svg
index 9c8942f..77d6a99 100644
--- a/activity/icon.svg
+++ b/activity/icon.svg
@@ -7,12 +7,84 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="55"
+ height="55"
+ id="svg2"
version="1.1"
- width="210mm"
- height="297mm"
- id="svg2">
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="convert.svg">
<defs
- id="defs4" />
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3636"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3658"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3658-9"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3697"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3725"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3749"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.77"
+ inkscape:cx="100.93097"
+ inkscape:cy="24.216625"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1200"
+ inkscape:window-height="806"
+ inkscape:window-x="0"
+ inkscape:window-y="31"
+ inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
@@ -21,53 +93,45 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
- id="layer1">
- <rect
- width="119.1106"
- height="214.39906"
- x="73.45153"
- y="303.95062"
- id="rect3023"
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:20.20000076;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-997.36218)">
<path
- d="m 121.09578,641.43063 490.33861,0"
- id="path3811"
- style="fill:none;stroke:#000000;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3715"
+ sodipodi:cx="11.936339"
+ sodipodi:cy="32.453583"
+ sodipodi:rx="6.8965516"
+ sodipodi:ry="7.4270558"
+ d="m 18.832891,32.453583 c 0,4.101849 -3.087691,7.427056 -6.896552,7.427056 -3.8088599,0 -6.8965512,-3.325207 -6.8965512,-7.427056 0,-4.10185 3.0876913,-7.427056 6.8965512,-7.427056 3.808861,0 6.896552,3.325206 6.896552,7.427056 z"
+ transform="translate(-2.6525199,997.09693)" />
<path
- d="m 365.27249,639.44545 0,301.74684"
- id="path3831"
- style="fill:none;stroke:#000000;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ transform="translate(33.822215,995.95722)"
+ sodipodi:type="arc"
+ style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path3715-1"
+ sodipodi:cx="11.936339"
+ sodipodi:cy="32.453583"
+ sodipodi:rx="6.8965516"
+ sodipodi:ry="7.4270558"
+ d="m 18.832891,32.453583 c 0,4.101849 -3.087691,7.427056 -6.896552,7.427056 -3.8088599,0 -6.8965512,-3.325207 -6.8965512,-7.427056 0,-4.10185 3.0876913,-7.427056 6.8965512,-7.427056 3.808861,0 6.896552,3.325206 6.896552,7.427056 z" />
<path
- d="m 269.98401,941.19229 194.54731,0"
- id="path3833"
- style="fill:none;stroke:#000000;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ style="fill:#ffffff;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+ d="M 9.5490721,18.129974 C 18.742165,16.843962 28.832408,11.371249 36.07427,19.190982 l -3.448275,3.713527 9.283819,10e-7 3.183024,-9.814324 -5.039787,3.713528 C 29.885058,8.2785342 19.717065,13.624849 9.5490721,18.129974 z"
+ id="path3739"
+ transform="translate(0,997.36218)"
+ sodipodi:nodetypes="ccccccc" />
<path
- d="m 19.851766,516.36451 228.295304,0"
- id="path3835"
- style="fill:none;stroke:#000000;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
- <path
- d="m 121.09577,636.05419 0,-109.7638"
- id="path3837"
- style="fill:none;stroke:#000000;stroke-width:19.36127663;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
- <rect
- width="119.1106"
- height="182.12485"
- x="564.78271"
- y="331.18204"
- id="rect3023-5"
- style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:18.61763763;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
- <path
- d="m 511.18297,511.32171 228.2953,0"
- id="path3835-9"
- style="fill:none;stroke:#000000;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
- <path
- d="m 612.42697,631.01139 0,-109.7638"
- id="path3837-9"
- style="fill:none;stroke:#000000;stroke-width:19.36127663;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ style="fill:#000000;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+ d="m 46.023806,1045.3826 c -9.193093,1.286 -19.283336,6.7587 -26.525198,-1.061 l 3.448275,-3.7135 -9.283819,0 -3.183024,9.8143 5.039787,-3.7135 c 10.167993,8.5251 20.335986,3.1788 30.503979,-1.3263 z"
+ id="path3739-9"
+ sodipodi:nodetypes="ccccccc" />
</g>
</svg>
diff --git a/convert.py b/convert.py
index 84efda4..dba63d5 100644
--- a/convert.py
+++ b/convert.py
@@ -15,47 +15,66 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# adic_long with this program; if not, write to the Free Software
+# alenght with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
dic = {}
-dic_long = {"Metro": 1, "Yarda": 1.09361, "Pie": 3.28084, "Brazas": 0.5468}
-vol = {}
+lenght = {"Metro": 1, "Yarda": 1.09361, "Pie": 3.28084, "Brazas": 0.5468}
+speed = {}
area = {}
-peso = {}
-vel = {}
+weight = {}
+volume = {}
time = {}
-def convert(number, uni1, uni2, type_u):
- if type_u == "dic_long":
- dic = dic_long
- elif type_u == "vol":
- dic = vol
- elif type_u == "area":
- dic = area
- elif type_u == "peso":
- dic = peso
- elif type_u == "vel":
- dic = vel
- elif type_u == "time":
- dic = time
- unidad = number * dic[uni1]
+def conver_lenght(number, unit, to_unit):
+
+ _unit = number * lenght[unit]
+ return _unit * lenght[unit]
+
+
+def conver_time(number, unit, to_unit):
+
+ _unit = number * time[unit]
+ return _unit * time[unit]
+
+
+def conver_volume(number, unit, to_unit):
+
+ _unit = number * volume[unit]
+ return _unit * volume[unit]
+
+
+def conver_area(number, unit, to_unit):
+
+ _unit = number * area[unit]
+ return _unit * area[unit]
+
+
+def conver_weight(number, unit, to_unit):
+
+ _unit = number * weight[unit]
+ return _unit * weight[unit]
+
+
+def conver_speed(number, unit, to_unit):
+
+ _unit = number * speed[unit]
+ return _unit * speed[unit]
- return unidad * dic[uni2]
def return_list(type_u):
- if type_u == "dic_long":
- dic = dic_long
- elif type_u == "vol":
- dic = vol
+ if type_u == "lenght":
+ dic = lenght
+ elif type_u == "volume":
+ dic = volume
elif type_u == "area":
dic = area
- elif type_u == "peso":
- dic = peso
- elif type_u == "vel":
- dic = vel
+ elif type_u == "weight":
+ dic = weight
+ elif type_u == "speed":
+ dic = speed
elif type_u == "time":
dic = time