Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPootle daemon <pootle@pootle.sugarlabs.org>2013-07-01 04:31:22 (GMT)
committer Pootle daemon <pootle@pootle.sugarlabs.org>2013-07-01 04:31:22 (GMT)
commit115ceebbe5d341e0ecbda89325a98312fc88482e (patch)
tree40e90d77d60b36c29ef06ea1993f2a6e00c539f4
parenta2d8611d6e8da2d9de3617adf106bb4db3f60607 (diff)
parent65f36c17aabe036651e309c1277b986066bc667d (diff)
Merge branch 'master' of git.sugarlabs.org:measure/mainline
-rw-r--r--NEWS15
-rwxr-xr-xactivity/activity.info2
-rw-r--r--icons/timer-1.svg123
-rw-r--r--icons/timer-10.svg123
-rw-r--r--icons/timer-18000.svg124
-rw-r--r--icons/timer-300.svg123
-rw-r--r--icons/timer-3000.svg111
-rw-r--r--icons/trigger-fall.svg36
-rw-r--r--icons/trigger-none.svg32
-rw-r--r--icons/trigger-rise.svg39
-rw-r--r--measure.py246
-rw-r--r--sensor_toolbar.py190
-rw-r--r--tuning_toolbar.py30
13 files changed, 960 insertions, 234 deletions
diff --git a/NEWS b/NEWS
index 06a4de1..2c2c80a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,21 @@
-45
+47
ENHANCEMENTS:
-* OLPC XO 4 support
+* Ensure toolbars fit on narrow displays
+* Use button palette, radio buttons instead of combo boxes
+
+46
+
+ENHANCEMENT:
+* New translation
BUG FIX:
+* Fix problem with sensor toolbars on XO4
+45
+
+ENHANCEMENTS:
+* OLPC XO 4 support
44
diff --git a/activity/activity.info b/activity/activity.info
index ac1f9cc..033b6b4 100755
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -3,7 +3,7 @@ name = Measure
bundle_id = org.laptop.MeasureActivity
exec = sugar-activity measure.MeasureActivity
icon = activity-measure
-activity_version = 45
+activity_version = 47
show_launcher = yes
license = GPLv2+
update_url = http://wiki.laptop.org/go/Activities/G1G1
diff --git a/icons/timer-1.svg b/icons/timer-1.svg
new file mode 100644
index 0000000..47057de
--- /dev/null
+++ b/icons/timer-1.svg
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55"
+ height="55"
+ id="svg2">
+ <metadata
+ id="metadata23">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs21" />
+ <g
+ id="layer2"
+ style="display:inline">
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.678664)"
+ id="path3791"
+ style="fill:#ffffff;fill-opacity:1;stroke:none" />
+ </g>
+ <g
+ id="layer1"
+ style="display:inline">
+ <path
+ d="M 27.665302,29.407631 27.334698,15.749391"
+ id="path3897"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer3"
+ style="display:none">
+ <path
+ d="m 36.539789,13.013087 c 9.161862,4.992537 12.541772,16.466949 7.549234,25.628815 L 27.5,29.602112 z"
+ id="path4311"
+ style="fill:#808080;fill-opacity:1;stroke:none" />
+ <path
+ d="M 27.571522,30.159444 39.546676,36.73611"
+ id="path4283"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer4"
+ style="display:inline">
+ <g
+ id="g4315"
+ style="display:inline">
+ <path
+ d="m 27.5,15.555556 0,3.888889"
+ id="path3811"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 41.444444,29.5 -3.888889,0"
+ id="path3823"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 13.555556,29.5 3.888889,0"
+ id="path3829"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 27.5,43.444444 0,-3.888889"
+ id="path3854"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 22.873381,5.940543 9.622594,0"
+ id="path4076"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 38.96491,8.681773 5.209549,3.91786"
+ id="path4080"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 16.03509,8.681773 -5.209549,3.91786"
+ id="path4107"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.6786635)"
+ id="path4380"
+ style="fill:none;stroke:#000000;stroke-width:3.89102697;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+ </g>
+ <g
+ id="layer5"
+ style="display:inline">
+ <g
+ transform="matrix(0.88661828,0,0,0.88661828,43.331119,7.0338455)"
+ id="g4198"
+ style="stroke-width:1.69182169;stroke-miterlimit:4;stroke-dasharray:none;display:inline">
+ <path
+ d="m 3.6632464,51.336754 0,-12.532159"
+ id="path4190"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 9.9293259,45.070674 -12.532159,0"
+ id="path4192"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="M 8.0940337,49.501461 -0.76754091,40.639887"
+ id="path4194"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 8.0940334,40.639887 -8.86157401,8.861574"
+ id="path4196"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/icons/timer-10.svg b/icons/timer-10.svg
new file mode 100644
index 0000000..8526a78
--- /dev/null
+++ b/icons/timer-10.svg
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55"
+ height="55"
+ id="svg2">
+ <metadata
+ id="metadata23">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs21" />
+ <g
+ id="layer2"
+ style="display:inline">
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.678664)"
+ id="path3791"
+ style="fill:#ffffff;fill-opacity:1;stroke:none" />
+ </g>
+ <g
+ id="layer1"
+ style="display:inline">
+ <path
+ d="M 27.611054,29.619307 35.167119,18.012589"
+ id="path3897"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer3"
+ style="display:none">
+ <path
+ d="m 36.539789,13.013087 c 9.161862,4.992537 12.541772,16.466949 7.549234,25.628815 L 27.5,29.602112 z"
+ id="path4311"
+ style="fill:#808080;fill-opacity:1;stroke:none" />
+ <path
+ d="M 27.571522,30.159444 39.546676,36.73611"
+ id="path4283"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer4"
+ style="display:inline">
+ <g
+ id="g4315"
+ style="display:inline">
+ <path
+ d="m 27.5,15.555556 0,3.888889"
+ id="path3811"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 41.444444,29.5 -3.888889,0"
+ id="path3823"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 13.555556,29.5 3.888889,0"
+ id="path3829"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 27.5,43.444444 0,-3.888889"
+ id="path3854"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 22.873381,5.940543 9.622594,0"
+ id="path4076"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 38.96491,8.681773 5.209549,3.91786"
+ id="path4080"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 16.03509,8.681773 -5.209549,3.91786"
+ id="path4107"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.6786635)"
+ id="path4380"
+ style="fill:none;stroke:#000000;stroke-width:3.89102697;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+ </g>
+ <g
+ id="layer5"
+ style="display:inline">
+ <g
+ transform="matrix(0.88661828,0,0,0.88661828,43.331119,7.0338455)"
+ id="g4198"
+ style="stroke-width:1.69182169;stroke-miterlimit:4;stroke-dasharray:none;display:inline">
+ <path
+ d="m 3.6632464,51.336754 0,-12.532159"
+ id="path4190"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 9.9293259,45.070674 -12.532159,0"
+ id="path4192"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="M 8.0940337,49.501461 -0.76754091,40.639887"
+ id="path4194"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 8.0940334,40.639887 -8.86157401,8.861574"
+ id="path4196"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/icons/timer-18000.svg b/icons/timer-18000.svg
new file mode 100644
index 0000000..1221806
--- /dev/null
+++ b/icons/timer-18000.svg
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55"
+ height="55"
+ id="svg2">
+ <metadata
+ id="metadata23">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs21" />
+ <g
+ id="layer2"
+ style="display:inline">
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.678664)"
+ id="path3791"
+ style="fill:#ffffff;fill-opacity:1;stroke:none" />
+ </g>
+ <g
+ id="layer3"
+ style="display:none">
+ <path
+ d="m 36.539789,13.013087 c 9.161862,4.992537 12.541772,16.466949 7.549234,25.628815 L 27.5,29.602112 z"
+ id="path4311"
+ style="fill:#808080;fill-opacity:1;stroke:none" />
+ <path
+ d="M 27.571522,30.159444 39.546676,36.73611"
+ id="path4283"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer4"
+ style="display:inline">
+ <g
+ id="g4315"
+ style="display:inline">
+ <path
+ d="m 27.5,15.555556 0,3.888889"
+ id="path3811"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 41.444444,29.5 -3.888889,0"
+ id="path3823"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 13.555556,29.5 3.888889,0"
+ id="path3829"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 27.5,43.444444 0,-3.888889"
+ id="path3854"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 22.873381,5.940543 9.622594,0"
+ id="path4076"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 38.96491,8.681773 5.209549,3.91786"
+ id="path4080"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 16.03509,8.681773 -5.209549,3.91786"
+ id="path4107"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.6786635)"
+ id="path4380"
+ style="fill:none;stroke:#000000;stroke-width:3.89102697;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+ </g>
+ <g
+ id="layer5"
+ style="display:inline">
+ <g
+ transform="matrix(0.88661828,0,0,0.88661828,43.331119,7.0338455)"
+ id="g4198"
+ style="stroke-width:1.69182169;stroke-miterlimit:4;stroke-dasharray:none;display:inline">
+ <path
+ d="m 3.6632464,51.336754 0,-12.532159"
+ id="path4190"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 9.9293259,45.070674 -12.532159,0"
+ id="path4192"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="M 8.0940337,49.501461 -0.76754091,40.639887"
+ id="path4194"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 8.0940334,40.639887 -8.86157401,8.861574"
+ id="path4196"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+ <g
+ transform="matrix(1.184947,0,0,0.83445704,-39.86448,7.0853267)"
+ id="layer1-0"
+ style="fill:#000000;fill-opacity:1;display:inline">
+ <path
+ d="M 56.839201,25.435699 56.702942,10.997854 c 0,0 11.740462,-0.06098 11.91551,15.454617 C 68.7935,41.968068 56.944099,42.69277 56.944099,42.69277 z"
+ id="path3897-2"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+</svg>
diff --git a/icons/timer-300.svg b/icons/timer-300.svg
new file mode 100644
index 0000000..714802f
--- /dev/null
+++ b/icons/timer-300.svg
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55"
+ height="55"
+ id="svg2">
+ <metadata
+ id="metadata23">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs21" />
+ <g
+ id="layer2"
+ style="display:inline">
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.678664)"
+ id="path3791"
+ style="fill:#ffffff;fill-opacity:1;stroke:none" />
+ </g>
+ <g
+ id="layer1"
+ style="display:inline">
+ <path
+ d="M 27.611054,29.619307 40.116867,23.139113"
+ id="path3897"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer3"
+ style="display:none">
+ <path
+ d="m 36.539789,13.013087 c 9.161862,4.992537 12.541772,16.466949 7.549234,25.628815 L 27.5,29.602112 z"
+ id="path4311"
+ style="fill:#808080;fill-opacity:1;stroke:none" />
+ <path
+ d="M 27.571522,30.159444 39.546676,36.73611"
+ id="path4283"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer4"
+ style="display:inline">
+ <g
+ id="g4315"
+ style="display:inline">
+ <path
+ d="m 27.5,15.555556 0,3.888889"
+ id="path3811"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 41.444444,29.5 -3.888889,0"
+ id="path3823"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 13.555556,29.5 3.888889,0"
+ id="path3829"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 27.5,43.444444 0,-3.888889"
+ id="path3854"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 22.873381,5.940543 9.622594,0"
+ id="path4076"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 38.96491,8.681773 5.209549,3.91786"
+ id="path4080"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 16.03509,8.681773 -5.209549,3.91786"
+ id="path4107"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.6786635)"
+ id="path4380"
+ style="fill:none;stroke:#000000;stroke-width:3.89102697;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+ </g>
+ <g
+ id="layer5"
+ style="display:inline">
+ <g
+ transform="matrix(0.88661828,0,0,0.88661828,43.331119,7.0338455)"
+ id="g4198"
+ style="stroke-width:1.69182169;stroke-miterlimit:4;stroke-dasharray:none;display:inline">
+ <path
+ d="m 3.6632464,51.336754 0,-12.532159"
+ id="path4190"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 9.9293259,45.070674 -12.532159,0"
+ id="path4192"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="M 8.0940337,49.501461 -0.76754091,40.639887"
+ id="path4194"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 8.0940334,40.639887 -8.86157401,8.861574"
+ id="path4196"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/icons/timer-3000.svg b/icons/timer-3000.svg
new file mode 100644
index 0000000..50f5e99
--- /dev/null
+++ b/icons/timer-3000.svg
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55"
+ height="55"
+ id="svg2">
+ <metadata
+ id="metadata23">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs21" />
+ <g
+ id="layer2"
+ style="display:inline">
+ <path
+ d="m 45.925926,24.25926 a 21.296297,21.296297 0 1 1 -42.5925939,0 21.296297,21.296297 0 1 1 42.5925939,0 z"
+ transform="matrix(0.89950544,0,0,0.89950544,5.3455146,7.678664)"
+ id="path3791"
+ style="fill:#ffffff;fill-opacity:1;stroke:none" />
+ </g>
+ <g
+ transform="translate(-30.762712,4.4279661)"
+ id="layer1"
+ style="fill:#000000;fill-opacity:1;display:inline">
+ <path
+ d="M 58.703608,24.969597 58.567349,10.531752 c 0,0 3.387006,0.405121 7.254493,2.638703 3.867487,2.233582 5.338359,5.518077 5.338359,5.518077 z"
+ id="path3897"
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <g
+ id="layer3"
+ style="display:none">
+ <path
+ d="m 36.539789,13.013087 c 9.161862,4.992537 12.541772,16.466949 7.549234,25.628815 L 27.5,29.602112 z"
+ id="path4311"
+ style="fill:#808080;fill-opacity:1;stroke:none" />
+ <path
+ d="M 27.571522,30.159444 39.546676,36.73611"
+ id="path4283"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <path
+ d="m 41.444444,29.5 -3.888889,0"
+ id="path3823"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 13.555556,29.5 3.888889,0"
+ id="path3829"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 27.5,43.444444 0,-3.888889"
+ id="path3854"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 22.873381,5.940543 9.622594,0"
+ id="path4076"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 38.96491,8.681773 5.209549,3.91786"
+ id="path4080"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 16.03509,8.681773 -5.209549,3.91786"
+ id="path4107"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 46.656135,29.5 a 19.156135,19.156135 0 1 1 -38.31227,0 19.156135,19.156135 0 1 1 38.31227,0 z"
+ id="path4380"
+ style="fill:none;stroke:#000000;stroke-width:3.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
+ <g
+ id="layer5"
+ style="display:inline">
+ <g
+ transform="matrix(0.88661828,0,0,0.88661828,43.331119,7.0338455)"
+ id="g4198"
+ style="stroke-width:1.69182169;stroke-miterlimit:4;stroke-dasharray:none;display:inline">
+ <path
+ d="m 3.6632464,51.336754 0,-12.532159"
+ id="path4190"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 9.9293259,45.070674 -12.532159,0"
+ id="path4192"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="M 8.0940337,49.501461 -0.76754091,40.639887"
+ id="path4194"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="m 8.0940334,40.639887 -8.86157401,8.861574"
+ id="path4196"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:1.69182169;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/icons/trigger-fall.svg b/icons/trigger-fall.svg
new file mode 100644
index 0000000..b15c156
--- /dev/null
+++ b/icons/trigger-fall.svg
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55.125"
+ height="55"
+ viewBox="0 0 55.125 55"
+ id="svg2"
+ xml:space="preserve"><metadata
+ id="metadata11"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs9" /><g
+ id="freq-low"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:block"><path
+ d="m 11.527,27.5 c 2.006,-5.98 4.035,-11.961 8.003,-11.961 7.937,0 7.937,23.922 15.874,23.922 3.969,0 6.041,-5.98 8.068,-11.961"
+ id="path5"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g><g
+ transform="translate(-19.291051,15.813559)"
+ id="g3778"
+ style="stroke:#ffffff;stroke-opacity:1"><path
+ d="m 31.641687,21.5 13,0"
+ id="path2990"
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /><path
+ d="m 37.929842,17.714941 0.423689,0"
+ id="path2990-5"
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g><path
+ d="m 21.934746,25.767797 6.8,5.2 2,-8.8"
+ id="path3865"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></svg> \ No newline at end of file
diff --git a/icons/trigger-none.svg b/icons/trigger-none.svg
new file mode 100644
index 0000000..4e2569f
--- /dev/null
+++ b/icons/trigger-none.svg
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55.125"
+ height="55"
+ viewBox="0 0 55.125 55"
+ id="svg2"
+ xml:space="preserve"><metadata
+ id="metadata11"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs9" /><g
+ transform="translate(-3.4330127,0)"
+ id="g3778"><g
+ id="freq-low"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:block"><path
+ d="m 11.527,27.5 c 2.006,-5.98 4.035,-11.961 8.003,-11.961 7.937,0 7.937,23.922 15.874,23.922 3.969,0 6.041,-5.98 8.068,-11.961"
+ id="path5"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g><g
+ transform="translate(6.9920255,0)"
+ id="freq-low-5"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:block"><path
+ d="m 11.527,27.5 c 2.006,-5.98 4.035,-11.961 8.003,-11.961 7.937,0 7.937,23.922 15.874,23.922 3.969,0 6.041,-5.98 8.068,-11.961"
+ id="path5-0"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g></g></svg> \ No newline at end of file
diff --git a/icons/trigger-rise.svg b/icons/trigger-rise.svg
new file mode 100644
index 0000000..03af3e6
--- /dev/null
+++ b/icons/trigger-rise.svg
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ 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"
+ version="1.1"
+ width="55.125"
+ height="55"
+ viewBox="0 0 55.125 55"
+ id="svg2"
+ xml:space="preserve"><metadata
+ id="metadata11"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs9" /><g
+ transform="matrix(-1,0,0,1,54.999,0)"
+ id="g3839"
+ style="fill:none"><g
+ id="freq-low"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:block"><path
+ d="m 11.527,27.5 c 2.006,-5.98 4.035,-11.961 8.003,-11.961 7.937,0 7.937,23.922 15.874,23.922 3.969,0 6.041,-5.98 8.068,-11.961"
+ id="path5"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g><g
+ transform="translate(-1.579187,-0.5)"
+ id="g3778"
+ style="fill:none;stroke:#ffffff;stroke-opacity:1"><path
+ d="m 31.641687,21.5 13,0"
+ id="path2990"
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /><path
+ d="m 37.929842,17.714941 0.423689,0"
+ id="path2990-5"
+ style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></g></g><path
+ d="m 22.2,28 6.8,-5.2 2,8.8"
+ id="path3865"
+ style="fill:none;stroke:#ffffff;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></svg> \ No newline at end of file
diff --git a/measure.py b/measure.py
index 15417a4..b8fb7ec 100644
--- a/measure.py
+++ b/measure.py
@@ -3,7 +3,7 @@
#
# Written by Arjun Sarwal <arjun@laptop.org>
# Copyright (C) 2007, Arjun Sarwal
-# Copyright (C) 2009-11 Walter Bender
+# Copyright (C) 2009-13 Walter Bender
# Copyright (C) 2009, Benjamin Berg, Sebastian Berg
#
# This program is free software; you can redistribute it and/or modify
@@ -27,31 +27,15 @@ import csv
from gettext import gettext as _
from sugar.activity import activity
-try: # 0.86+ toolbar widgets
- from sugar.graphics.toolbarbox import ToolbarBox
- _has_toolbarbox = True
-except ImportError:
- _has_toolbarbox = False
-
-if _has_toolbarbox:
- from sugar.activity.widgets import ActivityToolbarButton
- from sugar.activity.widgets import StopButton
- from sugar.graphics.toolbarbox import ToolbarButton
-else:
- from sugar.activity.activity import ActivityToolbox
+from sugar.activity.widgets import ActivityToolbarButton
+from sugar.activity.widgets import StopButton
+from sugar.graphics.toolbarbox import ToolbarBox
+from sugar.graphics.toolbarbox import ToolbarButton
+from sugar.graphics.toolbutton import ToolButton
from sugar.graphics import style
from sugar.datastore import datastore
-from sugar.graphics.toolbutton import ToolButton
-try:
- from sugar import profile
- _using_gconf = False
-except ImportError:
- _using_gconf = True
-try:
- import gconf
-except ImportError:
- _using_gconf = False
+from sugar import profile
from journal import DataLogger
from audiograb import AudioGrab_XO175, AudioGrab_XO15, AudioGrab_XO1, \
@@ -68,7 +52,6 @@ log = logging.getLogger('measure-activity')
log.setLevel(logging.DEBUG)
logging.basicConfig()
-
PREFIX = '♬'
@@ -124,7 +107,6 @@ class MeasureActivity(activity.Activity):
self.mode_images['voltage'] = gtk.gdk.pixbuf_new_from_file_at_size(
os.path.join(ICONS_DIR, 'voltage.svg'), 45, 45)
- self._using_gconf = _using_gconf
self.icon_colors = self.get_icon_colors_from_sugar()
self.stroke_color, self.fill_color = self.icon_colors.split(',')
self.nick = self.get_nick_from_sugar()
@@ -145,7 +127,9 @@ class MeasureActivity(activity.Activity):
self.hw = _get_hardware()
log.debug('running on %s hardware' % (self.hw))
+
self.wave = DrawWaveform(self)
+
if self.hw == XO15:
self.audiograb = AudioGrab_XO15(self.wave.new_buffer, self)
elif self.hw == XO175:
@@ -160,8 +144,6 @@ class MeasureActivity(activity.Activity):
# no sharing
self.max_participants = 1
- self.has_toolbarbox = _has_toolbarbox
-
box3 = gtk.HBox(False, 0)
box3.pack_start(self.wave, True, True, 0)
@@ -192,114 +174,88 @@ class MeasureActivity(activity.Activity):
self.set_canvas(box1)
- if self.has_toolbarbox:
- toolbox = ToolbarBox()
+ toolbox = ToolbarBox()
- activity_button = ActivityToolbarButton(self)
- toolbox.toolbar.insert(activity_button, 0)
- activity_button.show()
- else:
- toolbox = ActivityToolbox(self)
-
- # no sharing
- if hasattr(toolbox, 'share'):
- toolbox.share.hide()
- elif hasattr(toolbox, 'props'):
- toolbox.props.visible = False
- self.set_toolbox(toolbox)
+ activity_button = ActivityToolbarButton(self)
+ toolbox.toolbar.insert(activity_button, 0)
+ activity_button.show()
self.sensor_toolbar = SensorToolbar(self, self.audiograb.channels)
self.tuning_toolbar = TuningToolbar(self)
self.new_instrument_toolbar = InstrumentToolbar(self)
+ self._extras_toolbar = gtk.Toolbar()
self.control_toolbar = gtk.Toolbar()
- if self.has_toolbarbox:
- sensor_button = ToolbarButton(
- label=_('Sensors'),
- page=self.sensor_toolbar,
- icon_name='sensor-tools')
- toolbox.toolbar.insert(sensor_button, -1)
- sensor_button.show()
- tuning_button = ToolbarButton(
- # TRANS: Tuning insruments
- label=_('Tuning'),
- page=self.tuning_toolbar,
- icon_name='tuning-tools')
- toolbox.toolbar.insert(tuning_button, -1)
- tuning_button.show()
- new_instrument_button = ToolbarButton(
- label=_('Add instrument'),
- page=self.new_instrument_toolbar,
- icon_name='view-source')
- toolbox.toolbar.insert(new_instrument_button, -1)
- new_instrument_button.show()
- else:
- toolbox.add_toolbar(_('Sensors'), self.sensor_toolbar)
+
+ sensor_button = ToolbarButton(
+ label=_('Sensors'),
+ page=self.sensor_toolbar,
+ icon_name='sensor-tools')
+ toolbox.toolbar.insert(sensor_button, -1)
+ sensor_button.show()
+ tuning_button = ToolbarButton(
# TRANS: Tuning insruments
- toolbox.add_toolbar(_('Tuning'), self.tuning_toolbar)
- toolbox.add_toolbar(_('Add instrument'),
- self.new_instrument_toolbar)
- toolbox.add_toolbar(_('Controls'), self.control_toolbar)
+ label=_('Tuning'),
+ page=self.tuning_toolbar,
+ icon_name='tuning-tools')
+ toolbox.toolbar.insert(tuning_button, -1)
+ tuning_button.show()
+ new_instrument_button = ToolbarButton(
+ label=_('Add instrument'),
+ page=self.new_instrument_toolbar,
+ icon_name='view-source')
+ toolbox.toolbar.insert(new_instrument_button, -1)
+ new_instrument_button.show()
+ self._extras_button = ToolbarButton(
+ page=self._extras_toolbar,
+ icon_name='domain-time')
+ toolbox.toolbar.insert(self._extras_button, -1)
+ self._extras_toolbar_item = gtk.ToolItem()
+ self._extras_toolbar.insert(self._extras_toolbar_item, -1)
+ self._extras_button.hide()
self.sensor_toolbar.show()
- if self.has_toolbarbox:
- # Set up Frequency-domain Button
- self.freq = ToolButton('domain-time')
- toolbox.toolbar.insert(self.freq, -1)
- self.freq.show()
- self.freq.set_tooltip(_('Time Base'))
- self.freq.connect('clicked', self.timefreq_control)
-
- self.sensor_toolbar.add_frequency_slider(toolbox.toolbar)
-
- self._pause = ToolButton('media-playback-pause')
- toolbox.toolbar.insert(self._pause, -1)
- self._pause.set_tooltip(_('Freeze the display'))
- self._pause.connect('clicked', self._pause_play_cb)
-
- self._capture = ToolButton('image-saveoff')
- toolbox.toolbar.insert(self._capture, -1)
- self._capture.set_tooltip(_('Capture sample now'))
- self._capture.connect('clicked', self._capture_cb)
-
- separator = gtk.SeparatorToolItem()
- separator.props.draw = False
- separator.set_expand(True)
- toolbox.toolbar.insert(separator, -1)
- separator.show()
-
- stop_button = StopButton(self)
- stop_button.props.accelerator = _('<Ctrl>Q')
- toolbox.toolbar.insert(stop_button, -1)
- stop_button.show()
-
- self.set_toolbox(toolbox)
- sensor_button.set_expanded(True)
- else:
- # Set up Frequency-domain Button
- self.freq = ToolButton('domain-time')
- self.control_toolbar.insert(self.freq, -1)
- self.freq.show()
- self.freq.set_tooltip(_('Time Base'))
- self.freq.connect('clicked', self.timefreq_control)
-
- self.sensor_toolbar.add_frequency_slider(self.control_toolbar)
-
- separator = gtk.SeparatorToolItem()
- separator.props.draw = True
- self.control_toolbar.insert(separator, -1)
- separator.show()
-
- self._pause = ToolButton('media-playback-pause')
- self.control_toolbar.insert(self._pause, -1)
- self._pause.set_tooltip(_('Freeze the display'))
- self._pause.connect('clicked', self._pause_play_cb)
-
- self._capture = ToolButton('image-saveoff')
- self.control_toolbar.insert(self._capture, -1)
- self._capture.set_tooltip(_('Capture sample now'))
- self._capture.connect('clicked', self._capture_cb)
-
- toolbox.set_current_toolbar(1)
+ self._extra_tools = gtk.HBox()
+
+ # Set up Frequency-domain Button
+ self.freq = ToolButton('domain-time')
+ self.freq.set_tooltip(_('Time Base'))
+ self.freq.connect('clicked', self.timefreq_control)
+ self.freq.show()
+ self._extra_tools.add(self.freq)
+
+ self.sensor_toolbar.add_frequency_slider(self._extra_tools)
+
+ self._extra_item = gtk.ToolItem()
+ self._extra_item.add(self._extra_tools)
+ self._extra_tools.show()
+ toolbox.toolbar.insert(self._extra_item, -1)
+ self._extra_item.show()
+
+ self._pause = ToolButton('media-playback-pause')
+ self._pause.set_tooltip(_('Freeze the display'))
+ self._pause.connect('clicked', self._pause_play_cb)
+ self._pause.show()
+ toolbox.toolbar.insert(self._pause, -1)
+
+ self._capture = ToolButton('image-saveoff')
+ self._capture.set_tooltip(_('Capture sample now'))
+ self._capture.connect('clicked', self._capture_cb)
+ self._capture.show()
+ toolbox.toolbar.insert(self._capture, -1)
+
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = False
+ separator.set_expand(True)
+ toolbox.toolbar.insert(separator, -1)
+ separator.show()
+
+ stop_button = StopButton(self)
+ stop_button.props.accelerator = _('<Ctrl>Q')
+ toolbox.toolbar.insert(stop_button, -1)
+ stop_button.show()
+
+ self.set_toolbox(toolbox)
+ sensor_button.set_expanded(True)
toolbox.show()
self.sensor_toolbar.update_page_size()
@@ -315,6 +271,32 @@ class MeasureActivity(activity.Activity):
self.wave.set_active(True)
self.wave.set_context_on()
+ gtk.gdk.screen_get_default().connect('size-changed',
+ self._configure_cb)
+ self._configure_cb(None)
+
+ def _configure_cb(self, event):
+ ''' Screen size has changed, so check to see if the toolbar
+ elements still fit.'''
+ self.width = gtk.gdk.screen_width()
+ if self.width < style.GRID_CELL_SIZE * 14:
+ self._extras_button.show()
+ if self._extra_tools in self._extra_item:
+ self._extra_item.remove(self._extra_tools)
+ if not self._extra_tools in self._extras_toolbar_item:
+ self._extras_toolbar_item.add(self._extra_tools)
+ self._extras_toolbar_item.show()
+ else:
+ self._extras_button.hide()
+ if self._extra_tools in self._extras_toolbar_item:
+ self._extras_toolbar_item.remove(self._extra_tools)
+ if not self._extra_tools in self._extra_item:
+ self._extra_item.add(self._extra_tools)
+ if self._extras_button.is_expanded():
+ self._extras_button.set_expanded(False)
+ self._extras_toolbar_item.hide()
+ self._extra_tools.show()
+
def on_quit(self, data=None):
'''Clean up, close journal on quit'''
self.audiograb.on_activity_quit()
@@ -462,18 +444,10 @@ class MeasureActivity(activity.Activity):
def get_icon_colors_from_sugar(self):
''' Returns the icon colors from the Sugar profile '''
- if self._using_gconf:
- client = gconf.client_get_default()
- return client.get_string('/desktop/sugar/user/color')
- else:
- return profile.get_color().to_string()
+ return profile.get_color().to_string()
def get_nick_from_sugar(self):
''' Returns nick from Sugar '''
- if self._using_gconf:
- client = gconf.client_get_default()
- return client.get_string('/desktop/sugar/user/nick')
- else:
- return profile.get_nick_name()
+ return profile.get_nick_name()
gtk.gdk.threads_init()
diff --git a/sensor_toolbar.py b/sensor_toolbar.py
index 75d6464..5338e38 100644
--- a/sensor_toolbar.py
+++ b/sensor_toolbar.py
@@ -3,7 +3,7 @@
#
# Author: Arjun Sarwal arjun@laptop.org
# Copyright (C) 2007, Arjun Sarwal
-# Copyright (C) 2009-11 Walter Bender
+# Copyright (C) 2009-13 Walter Bender
# Copyright (C) 2009, Benjamin Berg, Sebastian Berg
#
# This program is free software; you can redistribute it and/or modify
@@ -20,10 +20,12 @@ import gtk
import gobject
import os
from gettext import gettext as _
+from gettext import ngettext
-from config import ICONS_DIR, CAPTURE_GAIN, MIC_BOOST, XO1, XO15, XO175, XO30
+from config import ICONS_DIR, CAPTURE_GAIN, MIC_BOOST, XO1, XO15, XO175, XO4
from sugar.graphics.toolbutton import ToolButton
+from sugar.graphics.menuitem import MenuItem
from sugar.graphics.combobox import ComboBox
from sugar.graphics.toolcombobox import ToolComboBox
from sugar.graphics.radiotoolbutton import RadioToolButton
@@ -31,10 +33,11 @@ import logging
log = logging.getLogger('measure-activity')
log.setLevel(logging.DEBUG)
+LOG_TIMER_VALUES = [1, 10, 300, 3000, 18000] # In 10th second intervals
def _is_xo(hw):
''' Return True if this is xo hardware '''
- return hw in [XO1, XO15, XO175, XO30]
+ return hw in [XO1, XO15, XO175, XO4]
class SensorToolbar(gtk.Toolbar):
@@ -116,24 +119,12 @@ of XO)") + ' '
separator.props.draw = True
self.insert(separator, -1)
- self._log_interval_combo = ComboBox()
- self.interval = [_('1/10 second'), _('1 second'), _('30 seconds'),
- _('5 minutes'), _('30 minutes')]
-
- if hasattr(self._log_interval_combo, 'set_tooltip_text'):
- self._log_interval_combo.set_tooltip_text(_('Sampling interval'))
-
- self._interval_changed_id = self._log_interval_combo.connect('changed',
- self.log_interval_cb)
-
- for i, s in enumerate(self.interval):
- self._log_interval_combo.append_item(i, s, None)
- if s == _('1 second'):
- self._log_interval_combo.set_active(i)
-
- self._log_interval_tool = ToolComboBox(self._log_interval_combo)
- self.insert(self._log_interval_tool, -1)
- self.logging_interval_status = '1 second'
+ self._log_value = LOG_TIMER_VALUES[1]
+ self._log_button = ToolButton('timer-10')
+ self._log_button.set_tooltip(_('Select log'))
+ self._log_button.connect('clicked', self._log_selection_cb)
+ self.insert(self._log_button, -1)
+ self._setup_log_palette()
# Set up Logging/Stop Logging Button
self._record = ToolButton('media-record')
@@ -141,65 +132,129 @@ of XO)") + ' '
self._record.set_tooltip(_('Start Recording'))
self._record.connect('clicked', self.record_control_cb)
- if self.activity.has_toolbarbox:
- separator = gtk.SeparatorToolItem()
- separator.props.draw = True
- self.insert(separator, -1)
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = True
+ self.insert(separator, -1)
# Set up Trigger Combo box
- self.trigger_combo = ComboBox()
- self.trigger = [_('None'), _('Rising Edge'), _('Falling Edge')]
- self.trigger_conf = [self.activity.wave.TRIGGER_NONE,
- self.activity.wave.TRIGGER_POS,
- self.activity.wave.TRIGGER_NEG]
- self._trigger_changed_id = self.trigger_combo.connect('changed',
- self.update_trigger_control)
- for i, s in enumerate(self.trigger):
- self.trigger_combo.append_item(i, s, None)
- self.trigger_combo.set_active(0)
- if hasattr(self.trigger_combo, 'set_tooltip_text'):
- self.trigger_combo.set_tooltip_text(_('Create a trigger'))
- self._trigger_tool = ToolComboBox(self.trigger_combo)
- self.insert(self._trigger_tool, -1)
+ self.trigger_none = RadioToolButton()
+ self.trigger_none.set_named_icon('trigger-none')
+ self.insert(self.trigger_none, -1)
+ self.trigger_none.set_tooltip(_('None'))
+ self.trigger_none.connect('clicked',
+ self.update_trigger_control_cb,
+ self.activity.wave.TRIGGER_NONE)
+
+ self.trigger_rise = RadioToolButton(group=self.trigger_none)
+ self.trigger_rise.set_named_icon('trigger-rise')
+ self.insert(self.trigger_rise, -1)
+ self.trigger_rise.set_tooltip(_('Rising Edge'))
+ self.trigger_rise.connect('clicked',
+ self.update_trigger_control_cb,
+ self.activity.wave.TRIGGER_POS)
+
+ self.trigger_fall = RadioToolButton(group=self.trigger_none)
+ self.trigger_fall.set_named_icon('trigger-fall')
+ self.insert(self.trigger_fall, -1)
+ self.trigger_fall.set_tooltip(_('Falling Edge'))
+ self.trigger_fall.connect('clicked',
+ self.update_trigger_control_cb,
+ self.activity.wave.TRIGGER_NEG)
self.show_all()
- def add_frequency_slider(self, toolbar):
+ def get_log(self):
+ return self._log_value
+
+ def get_log_idx(self):
+ if self._log_value in LOG_TIMER_VALUES:
+ return LOG_TIMER_VALUES.index(self._log_value)
+ else:
+ return LOG_TIMER_VALUES[0]
+
+ def set_log_idx(self, idx):
+ self._log_value = LOG_TIMER_VALUES[idx]
+ if hasattr(self, '_log_button'):
+ self._log_button.set_icon('timer-%d' % (self._log_value))
+
+ def _log_selection_cb(self, widget):
+ if self._log_palette:
+ if not self._log_palette.is_up():
+ self._log_palette.popup(immediate=True,
+ state=self._log_palette.SECONDARY)
+ else:
+ self._log_palette.popdown(immediate=True)
+ return
+
+ def _log_to_seconds(self, tenth_seconds):
+ return tenth_seconds / 10.
+
+ def _log_to_string(self, seconds):
+ tenth_seconds = seconds / 10
+ if seconds == 1:
+ return _('1/10 second')
+ else:
+ return ngettext('%d second', '%d seconds', tenth_seconds) % \
+ tenth_seconds
+
+ def _setup_log_palette(self):
+ self._log_palette = self._log_button.get_palette()
+
+ for seconds in LOG_TIMER_VALUES:
+ tenth_seconds = seconds / 10
+ if seconds == 1:
+ text = _('1/10 second')
+ else:
+ text = ngettext('%d second', '%d seconds', tenth_seconds) % \
+ tenth_seconds
+ menu_item = MenuItem(icon_name='timer-%d' % (seconds),
+ text_label=text)
+ menu_item.connect('activate', self._log_selected_cb, seconds)
+ self._log_palette.menu.append(menu_item)
+ menu_item.show()
+
+ def _log_selected_cb(self, button, seconds):
+ self.set_log_idx(LOG_TIMER_VALUES.index(seconds))
+
+ def add_frequency_slider(self, toolbox):
''' Either on the Sound toolbar or the Main toolbar '''
self._freq_stepper_up = ToolButton('freq-high')
self._freq_stepper_up.set_tooltip(_('Zoom out'))
self._freq_stepper_up.connect('clicked', self._freq_stepper_up_cb)
+ self._freq_stepper_up.show()
+
self.activity.adjustmentf = gtk.Adjustment(
0.5, self.LOWER, self.UPPER, 0.01, 0.1, 0)
self.activity.adjustmentf.connect('value_changed', self.cb_page_sizef)
+
self._freq_range = gtk.HScale(self.activity.adjustmentf)
self._freq_range.set_inverted(True)
self._freq_range.set_draw_value(False)
self._freq_range.set_update_policy(gtk.UPDATE_CONTINUOUS)
self._freq_range.set_size_request(120, 15)
+ self._freq_range.show()
self._freq_stepper_down = ToolButton('freq-low')
self._freq_stepper_down.set_tooltip(_('Zoom in'))
self._freq_stepper_down.connect('clicked', self._freq_stepper_down_cb)
+ self._freq_stepper_down.show()
self._freq_range_tool = gtk.ToolItem()
self._freq_range_tool.add(self._freq_range)
+ self._freq_range_tool.show()
- toolbar.insert(self._freq_stepper_up, -1)
- toolbar.insert(self._freq_range_tool, -1)
- toolbar.insert(self._freq_stepper_down, -1)
+ toolbox.add(self._freq_stepper_up)
+ toolbox.add(self._freq_range_tool)
+ toolbox.add(self._freq_stepper_down)
return
- def update_trigger_control(self, *args):
- ''' Callback for trigger control '''
+ def update_trigger_control_cb(self, button, value):
+ if button is None:
+ value = self.activity.wave.TRIGGER_NONE
if self.activity.wave.get_fft_mode():
self.trigger_combo.set_active(self.activity.wave.TRIGGER_NONE)
- active = self.trigger_combo.get_active()
- if active == -1:
- return
-
- self.activity.wave.set_trigger(self.trigger_conf[active])
- return
+ else:
+ self.activity.wave.set_trigger(value)
def analog_resistance_voltage_mode_cb(self, button=None,
mode_to_set='sound'):
@@ -345,7 +400,7 @@ of XO)") + ' '
''' Called when an analog sensor is selected '''
self.activity.wave.set_mag_params(self.gain, self.y_mag)
self.update_string_for_textbox()
- self.update_trigger_control()
+ self.update_trigger_control_cb(None)
self.activity.audiograb.start_grabbing()
return False
@@ -368,15 +423,17 @@ of XO)") + ' '
else:
Xscale = (1.00 / self.activity.audiograb.get_sampling_rate())
Yscale = 0.0
- interval = self.interval_convert()
+ interval = self._log_value / 10. # self.interval_convert()
username = self.activity.nick
if self.activity.wave.get_fft_mode():
self.activity.data_logger.start_new_session(
- username, Xscale, Yscale, _(self.logging_interval_status),
+ username, Xscale, Yscale,
+ self._log_to_string(self._log_value),
channels=self._channels, mode='frequency')
else:
self.activity.data_logger.start_new_session(
- username, Xscale, Yscale, _(self.logging_interval_status),
+ username, Xscale, Yscale,
+ self._log_to_string(self._log_value),
channels=self._channels, mode=self.mode)
self.activity.audiograb.set_logging_params(
start_stop=True, interval=interval, screenshot=False)
@@ -385,29 +442,6 @@ of XO)") + ' '
self._record.set_tooltip(_('Stop Recording'))
self.activity.new_recording = True
- def interval_convert(self):
- ''' Converts interval string to an integer that denotes the
- number of times the audiograb buffer must be called before a
- value is written. When set to 0, the whole of current buffer
- will be written. '''
- interval_dictionary = {'1/10 second': 0.1, '1 second': 1,
- '30 seconds': 30,
- '5 minutes': 300, '30 minutes': 1800}
- try:
- return interval_dictionary[self.logging_interval_status]
- except ValueError:
- logging.error('logging interval status = %s' %\
- (str(self.logging_interval_status)))
- return 0
-
- def log_interval_cb(self, combobox):
- ''' Callback from the Logging Interval Combo box: sets status '''
- if self._log_interval_combo.get_active() != -1:
- intervals = ['1/10 second', '1 second', '30 seconds',
- '5 minutes', '30 minutes']
- self.logging_interval_status = \
- intervals[self._log_interval_combo.get_active()]
-
def update_string_for_textbox(self):
''' Update the status field at the bottom of the canvas. '''
if self.mode == 'resistance':
diff --git a/tuning_toolbar.py b/tuning_toolbar.py
index 0891dbf..a38f396 100644
--- a/tuning_toolbar.py
+++ b/tuning_toolbar.py
@@ -68,10 +68,9 @@ class TuningToolbar(gtk.Toolbar):
self._instrument_tool = ToolComboBox(self.instrument_combo)
self.insert(self._instrument_tool, -1)
- if self.activity.has_toolbarbox:
- separator = gtk.SeparatorToolItem()
- separator.props.draw = True
- self.insert(separator, -1)
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = True
+ self.insert(separator, -1)
self._notes_combo = ComboBox()
n = 0
@@ -111,10 +110,9 @@ class TuningToolbar(gtk.Toolbar):
self._new_tuning_line.set_tooltip(_('Show tuning line.'))
self._new_tuning_line.connect('clicked', self.tuning_line_cb)
- if self.activity.has_toolbarbox:
- separator = gtk.SeparatorToolItem()
- separator.props.draw = True
- self.insert(separator, -1)
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = True
+ self.insert(separator, -1)
self._harmonic = ToolButton('harmonics')
self._harmonic.show()
@@ -122,10 +120,9 @@ class TuningToolbar(gtk.Toolbar):
self._harmonic.set_tooltip(_('Show harmonics.'))
self._harmonic.connect('clicked', self.harmonic_cb)
- if self.activity.has_toolbarbox:
- separator = gtk.SeparatorToolItem()
- separator.props.draw = True
- self.insert(separator, -1)
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = True
+ self.insert(separator, -1)
self._play_tone = ToolButton('media-playback-start')
self._play_tone.show()
@@ -133,11 +130,10 @@ class TuningToolbar(gtk.Toolbar):
self._play_tone.set_tooltip(_('Play a note.'))
self._play_tone.connect('clicked', self.play_cb)
- if self.activity.has_toolbarbox:
- separator = gtk.SeparatorToolItem()
- separator.props.draw = False
- separator.set_expand(True)
- self.insert(separator, -1)
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = False
+ separator.set_expand(True)
+ self.insert(separator, -1)
self.label = gtk.Label('')
self.label.set_use_markup(True)