diff options
author | Sebastian Dziallas <sebastian@when.com> | 2010-06-22 15:02:18 (GMT) |
---|---|---|
committer | Sebastian Dziallas <sebastian@when.com> | 2010-06-22 15:02:18 (GMT) |
commit | 1258a0c1db3b60f4c4f1ad23f77eb70072a1e337 (patch) | |
tree | 07f3688cee3d65836c77d50187fa51dee59bbc47 | |
parent | 6b92d375b90427adf405c292529f23df953f6447 (diff) |
initial commit to add sugar-smolt control panel entry
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | data/icons/Makefile.am | 1 | ||||
-rw-r--r-- | data/icons/module-smolt.svg | 682 | ||||
-rw-r--r-- | extensions/cpsection/Makefile.am | 2 | ||||
-rw-r--r-- | extensions/cpsection/smolt/Makefile.am | 6 | ||||
-rw-r--r-- | extensions/cpsection/smolt/__init__.py | 24 | ||||
-rw-r--r-- | extensions/cpsection/smolt/model.py | 73 | ||||
-rw-r--r-- | extensions/cpsection/smolt/view.py | 148 |
8 files changed, 936 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 13a2f09..04a8e3f 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,7 @@ extensions/cpsection/modemconfiguration/Makefile extensions/cpsection/Makefile extensions/cpsection/network/Makefile extensions/cpsection/power/Makefile +extensions/cpsection/smolt/Makefile extensions/cpsection/updater/backends/Makefile extensions/cpsection/updater/Makefile extensions/deviceicon/Makefile diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index a35643a..cb2d013 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -10,6 +10,7 @@ sugar_DATA = \ module-modemconfiguration.svg \ module-network.svg \ module-power.svg \ + module-smolt.svg \ module-updater.svg EXTRA_DIST = $(sugar_DATA) diff --git a/data/icons/module-smolt.svg b/data/icons/module-smolt.svg new file mode 100644 index 0000000..8f6c5ee --- /dev/null +++ b/data/icons/module-smolt.svg @@ -0,0 +1,682 @@ +<?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://web.resource.org/cc/" + 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:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48" + height="48" + id="svg2160" + sodipodi:version="0.32" + inkscape:version="0.45" + version="1.0" + sodipodi:docbase="/home/duffy/Projects/fedora" + sodipodi:docname="smolt.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + <defs + id="defs2162"> + <linearGradient + id="linearGradient9276"> + <stop + id="stop9278" + offset="0" + style="stop-color:#babdb6;stop-opacity:1;" /> + <stop + id="stop9280" + offset="1" + style="stop-color:#949488;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient9148"> + <stop + style="stop-color:#2e3436;stop-opacity:1;" + offset="0" + id="stop9150" /> + <stop + style="stop-color:#77868b;stop-opacity:1;" + offset="1" + id="stop9152" /> + </linearGradient> + <linearGradient + id="linearGradient9111"> + <stop + style="stop-color:#babdb6;stop-opacity:1;" + offset="0" + id="stop9113" /> + <stop + style="stop-color:#eeeeec;stop-opacity:1;" + offset="1" + id="stop9115" /> + </linearGradient> + <linearGradient + id="linearGradient9079"> + <stop + id="stop9081" + offset="0" + style="stop-color:#435064;stop-opacity:1;" /> + <stop + id="stop9083" + offset="1" + style="stop-color:#88a0b9;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient9061"> + <stop + style="stop-color:#204a87;stop-opacity:1;" + offset="0" + id="stop9063" /> + <stop + style="stop-color:#729fcf;stop-opacity:1;" + offset="1" + id="stop9065" /> + </linearGradient> + <linearGradient + id="linearGradient9021"> + <stop + style="stop-color:#babdb6;stop-opacity:1;" + offset="0" + id="stop9023" /> + <stop + style="stop-color:#eeeeec;stop-opacity:1;" + offset="1" + id="stop9025" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9027" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0,-2)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9031" + gradientUnits="userSpaceOnUse" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" + gradientTransform="matrix(1,0,0,-1,34,48)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9035" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(23,-2)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9039" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(11,-2)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9061" + id="linearGradient9067" + x1="24.5" + y1="36.125" + x2="24.5" + y2="19.492483" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0,-2)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9079" + id="linearGradient9077" + x1="16.001097" + y1="27.875" + x2="8.875" + y2="27.875" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0335571,0,0,1,-0.2516782,-2)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9079" + id="linearGradient9091" + x1="31.25" + y1="27.999998" + x2="43.545452" + y2="27.999998" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0,-2)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9117" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9132" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient9144" + x1="23.420858" + y1="9.2033243" + x2="23.420858" + y2="7.7566919" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient9146" + x1="25.594772" + y1="9.2033243" + x2="25.594772" + y2="7.7566919" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9154" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9181" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient9183" + gradientUnits="userSpaceOnUse" + x1="23.420858" + y1="9.2033243" + x2="23.420858" + y2="7.7566919" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient9185" + gradientUnits="userSpaceOnUse" + x1="25.594772" + y1="9.2033243" + x2="25.594772" + y2="7.7566919" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9199" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient9201" + gradientUnits="userSpaceOnUse" + x1="23.420858" + y1="9.2033243" + x2="23.420858" + y2="7.7566919" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient9203" + gradientUnits="userSpaceOnUse" + x1="25.594772" + y1="9.2033243" + x2="25.594772" + y2="7.7566919" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9079" + id="linearGradient9215" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.8120806,0,0,0.8966667,7.1686231,0.6683318)" + x1="31.25" + y1="27.999998" + x2="43.545452" + y2="27.999998" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9222" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9226" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" + gradientTransform="matrix(0.611548,0,0,0.611548,22.109104,8.3051267)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9233" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9111" + id="linearGradient9237" + gradientUnits="userSpaceOnUse" + x1="24.0625" + y1="16.125" + x2="23.6875" + y2="12.677898" + gradientTransform="matrix(0.611548,0,0,0.611548,-1.015896,8.1801267)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9276" + id="linearGradient9243" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(34,-2)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9247" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(34,-8)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9255" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(34,-6)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9261" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(34,-6.9999999)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9268" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,-1,34,42)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9021" + id="linearGradient9274" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,-1,34,42)" + x1="7.181818" + y1="45.094505" + x2="7.181818" + y2="38.178188" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient2254" + gradientUnits="userSpaceOnUse" + x1="25.594772" + y1="9.2033243" + x2="25.594772" + y2="7.7566919" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient9148" + id="linearGradient2256" + gradientUnits="userSpaceOnUse" + x1="23.420858" + y1="9.2033243" + x2="23.420858" + y2="7.7566919" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1" + inkscape:cx="27.822255" + inkscape:cy="25.539569" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:document-units="px" + inkscape:grid-bbox="true" + width="48px" + height="48px" + showguides="true" + inkscape:guide-bbox="true" + inkscape:window-width="1012" + inkscape:window-height="692" + inkscape:window-x="6" + inkscape:window-y="45"> + <sodipodi:guide + orientation="vertical" + position="-251" + id="guide5089" /> + </sodipodi:namedview> + <metadata + id="metadata2165"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + style="opacity:1;fill:url(#linearGradient9077);fill-opacity:1;stroke:#223146;stroke-width:0.99999994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 11.591912,16.499999 C 9.3197406,16.499999 7.5,18.235922 7.5,20.403436 L 7.5,22.07283 L 7.5,27.596561 L 7.5,31.499999 L 11.591912,31.499999 L 17.408088,31.499999 L 21.5,31.499999 L 21.5,27.596561 L 21.5,22.07283 L 21.5,20.403436 C 21.5,18.235922 19.68026,16.499999 17.408088,16.499999 L 11.591912,16.499999 z " + id="path5094" /> + <path + id="path9209" + d="M 11.715073,17.499999 C 9.9297954,17.499999 8.4999992,19.004466 8.4999992,20.882979 L 8.4999992,22.329785 L 8.4999992,27.117019 L 8.4999992,30.5 L 11.715073,30.5 L 16.284925,30.5 L 19.5,30.5 L 19.5,27.117019 L 19.5,22.329785 L 19.5,20.882979 C 19.5,19.004466 18.070203,17.499999 16.284925,17.499999 L 11.715073,17.499999 z " + style="opacity:1;fill:none;fill-opacity:1;stroke:#a0b5d2;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + sodipodi:type="arc" + style="opacity:0.98999999;fill:#f2d6aa;fill-opacity:1;stroke:#755b34;stroke-width:0.97435892;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path4114" + sodipodi:cx="22.09091" + sodipodi:cy="14.272727" + sodipodi:rx="5.181818" + sodipodi:ry="5.181818" + d="M 27.272728 14.272727 A 5.181818 5.181818 0 1 1 16.909092,14.272727 A 5.181818 5.181818 0 1 1 27.272728 14.272727 z" + transform="matrix(1.0263158,0,0,1.0263158,-8.990432,0.5334937)" /> + <path + id="path5092" + d="M 33.459057,18.499999 C 31.260658,18.499999 29.5,20.235922 29.5,22.403436 L 29.5,24.07283 L 29.5,29.596561 L 29.5,33.499999 L 33.459057,33.499999 L 39.086396,33.499999 L 43.045454,33.499999 L 43.045454,29.596561 L 43.045454,24.07283 L 43.045454,22.403436 C 43.045454,20.235922 41.284796,18.499999 39.086396,18.499999 L 33.459057,18.499999 z " + style="opacity:1;fill:url(#linearGradient9091);fill-opacity:1;stroke:#223146;stroke-width:0.99999994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="opacity:1;fill:url(#linearGradient9215);fill-opacity:1;stroke:#a8bbd5;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 34.340074,19.049999 C 32.554797,19.049999 31.125001,20.606543 31.125001,22.550081 L 31.125001,24.046971 L 31.125001,28.999916 L 31.125001,32.5 L 34.340074,32.5 L 38.909927,32.5 L 42.125001,32.5 L 42.125001,28.999916 L 42.125001,24.046971 L 42.125001,22.550081 C 42.125001,20.606543 40.695205,19.049999 38.909927,19.049999 L 34.340074,19.049999 z " + id="path9213" /> + <path + transform="matrix(1.1140351,0,0,1.1140351,12.162678,0.3724091)" + d="M 27.272728 14.272727 A 5.181818 5.181818 0 1 1 16.909092,14.272727 A 5.181818 5.181818 0 1 1 27.272728 14.272727 z" + sodipodi:ry="5.181818" + sodipodi:rx="5.181818" + sodipodi:cy="14.272727" + sodipodi:cx="22.09091" + id="path4112" + style="opacity:0.98999999;fill:#f2d6aa;fill-opacity:1;stroke:#755b34;stroke-width:0.89763778;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + <path + style="opacity:1;fill:url(#linearGradient9067);fill-opacity:1;stroke:#223146;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 20.46875,16.40625 C 17.709685,16.40625 15.5,18.615935 15.5,21.375 L 15.5,23.5 L 15.5,30.53125 L 15.5,35.5 L 20.46875,35.5 L 27.53125,35.5 L 32.5,35.5 L 32.5,30.53125 L 32.5,23.5 L 32.5,21.375 C 32.5,18.615935 30.290315,16.40625 27.53125,16.40625 L 20.46875,16.40625 z " + id="rect4116" /> + <path + id="path9205" + d="M 20.884191,17.5 C 18.449722,17.5 16.5,19.467379 16.5,21.923895 L 16.5,23.815876 L 16.5,30.076105 L 16.5,34.500001 L 20.884191,34.500001 L 27.115809,34.500001 L 31.5,34.500001 L 31.5,30.076105 L 31.5,23.815876 L 31.5,21.923895 C 31.5,19.467379 29.550278,17.5 27.115809,17.5 L 20.884191,17.5 z " + style="opacity:1;fill:none;fill-opacity:1;stroke:#91a8ca;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="30.5" + x="13.5" + height="13" + width="9" + id="rect9037" + style="opacity:1;fill:url(#linearGradient9039);fill-opacity:1;stroke:#787b75;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:url(#linearGradient9035);fill-opacity:1;stroke:#787b75;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect9033" + width="9" + height="13" + x="25.5" + y="30.5" /> + <rect + style="opacity:1;fill:url(#linearGradient9027);fill-opacity:1;stroke:#787b75;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect5096" + width="9" + height="13" + x="2.5" + y="30.5" /> + <rect + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect7047" + width="7" + height="11.000001" + x="3.5" + y="31.5" /> + <rect + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect8020" + width="7" + height="11.000001" + x="14.5" + y="31.5" /> + <rect + y="31.5" + x="26.5" + height="11.000001" + width="7" + id="rect8022" + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <text + id="text9045" + y="38.897964" + x="27.517981" + style="font-size:7.20568085px;font-style:normal;font-weight:normal;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + xml:space="preserve"><tspan + y="38.897964" + x="27.517981" + id="tspan9047" + sodipodi:role="line" + style="font-weight:bold;fill:#2e3436">3</tspan></text> + <text + xml:space="preserve" + style="font-size:6.93571424px;font-style:normal;font-weight:normal;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="15.668116" + y="38.901794" + id="text9053"><tspan + style="font-weight:bold;fill:#2e3436" + sodipodi:role="line" + id="tspan9055" + x="15.668116" + y="38.901794">0</tspan></text> + <text + id="text9057" + y="38.901794" + x="4.6410227" + style="font-size:6.93571424px;font-style:normal;font-weight:normal;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + xml:space="preserve"><tspan + y="38.901794" + x="4.6410227" + id="tspan9059" + sodipodi:role="line" + style="font-weight:bold;fill:#2e3436">9</tspan></text> + <path + sodipodi:type="arc" + style="opacity:0.98999999;fill:#f2d6aa;fill-opacity:1;stroke:#a48049;stroke-width:0.74025971;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path2168" + sodipodi:cx="22.09091" + sodipodi:cy="14.272727" + sodipodi:rx="5.181818" + sodipodi:ry="5.181818" + d="M 27.272728 14.272727 A 5.181818 5.181818 0 1 1 16.909092,14.272727 A 5.181818 5.181818 0 1 1 27.272728 14.272727 z" + transform="matrix(1.3508772,0,0,1.3508772,-5.8421066,-7.780701)" /> + <g + id="g9122"> + <path + id="path9095" + d="M 19.6875,12.5 C 19.963717,14.684336 21.803584,16.375 24.0625,16.375 C 26.321415,16.375 28.161283,14.684336 28.4375,12.5 L 19.6875,12.5 z " + style="opacity:0.98999999;fill:url(#linearGradient9154);fill-opacity:1;stroke:#9f9f9f;stroke-width:0.99999994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + id="path9105" + d="M 20.875,13.5 C 21.462929,14.6869 22.680267,15.5 24.09375,15.5 C 25.5054,15.5 26.723687,14.684401 27.3125,13.5 L 20.875,13.5 z " + style="opacity:0.98999999;fill:#eeeeec;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> + <path + sodipodi:type="arc" + style="opacity:0.98999999;fill:url(#linearGradient2256);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path9134" + sodipodi:cx="25.721008" + sodipodi:cy="8.5346031" + sodipodi:rx="0.53033006" + sodipodi:ry="1.1048543" + d="M 26.251338 8.5346031 A 0.53033006 1.1048543 0 1 1 25.190678,8.5346031 A 0.53033006 1.1048543 0 1 1 26.251338 8.5346031 z" + transform="matrix(1.8856182,0,0,1.8101934,-22.500001,-7.449282)" /> + <path + transform="matrix(1.8856182,0,0,1.8101934,-26.500001,-7.449282)" + d="M 26.251338 8.5346031 A 0.53033006 1.1048543 0 1 1 25.190678,8.5346031 A 0.53033006 1.1048543 0 1 1 26.251338 8.5346031 z" + sodipodi:ry="1.1048543" + sodipodi:rx="0.53033006" + sodipodi:cy="8.5346031" + sodipodi:cx="25.721008" + id="path9136" + style="opacity:0.98999999;fill:url(#linearGradient2254);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + <path + id="path9173" + d="M 34.148955,15.949477 C 34.317875,17.285303 35.443042,18.319225 36.824478,18.319225 C 38.205913,18.319225 39.33108,17.285303 39.5,15.949477 L 34.148955,15.949477 z " + style="opacity:0.98999999;fill:url(#linearGradient9226);fill-opacity:1;stroke:#6e6e6e;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + id="path9175" + d="M 34.875169,16.561025 C 35.234715,17.286871 35.979176,17.784121 36.843589,17.784121 C 37.70688,17.784121 38.451921,17.285343 38.812009,16.561025 L 34.875169,16.561025 z " + style="opacity:0.98999999;fill:#eeeeec;fill-opacity:1;stroke:#ffffff;stroke-width:0.99999994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + transform="matrix(0.9428091,0,0,0.9050967,13.249999,5.2753587)" + d="M 26.251338 8.5346031 A 0.53033006 1.1048543 0 1 1 25.190678,8.5346031 A 0.53033006 1.1048543 0 1 1 26.251338 8.5346031 z" + sodipodi:ry="1.1048543" + sodipodi:rx="0.53033006" + sodipodi:cy="8.5346031" + sodipodi:cx="25.721008" + id="path9177" + style="opacity:0.98999999;fill:url(#linearGradient9183);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + <path + sodipodi:type="arc" + style="opacity:0.98999999;fill:url(#linearGradient9185);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path9179" + sodipodi:cx="25.721008" + sodipodi:cy="8.5346031" + sodipodi:rx="0.53033006" + sodipodi:ry="1.1048543" + d="M 26.251338 8.5346031 A 0.53033006 1.1048543 0 1 1 25.190678,8.5346031 A 0.53033006 1.1048543 0 1 1 26.251338 8.5346031 z" + transform="matrix(0.9428091,0,0,0.9050967,11.249999,5.2753589)" /> + <path + style="opacity:0.98999999;fill:url(#linearGradient9237);fill-opacity:1;stroke:#646464;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 11.023955,15.824477 C 11.192875,17.160303 12.318042,18.194225 13.699478,18.194225 C 15.080913,18.194225 16.20608,17.160303 16.375,15.824477 L 11.023955,15.824477 z " + id="path9191" /> + <path + style="opacity:0.98999999;fill:#eeeeec;fill-opacity:1;stroke:#ffffff;stroke-width:0.99999994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 11.750168,16.436025 C 12.109715,17.161871 12.854176,17.659121 13.718589,17.659121 C 14.58188,17.659121 15.326921,17.160343 15.687009,16.436025 L 11.750168,16.436025 z " + id="path9193" /> + <path + sodipodi:type="arc" + style="opacity:0.98999999;fill:url(#linearGradient9201);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path9195" + sodipodi:cx="25.721008" + sodipodi:cy="8.5346031" + sodipodi:rx="0.53033006" + sodipodi:ry="1.1048543" + d="M 26.251338 8.5346031 A 0.53033006 1.1048543 0 1 1 25.190678,8.5346031 A 0.53033006 1.1048543 0 1 1 26.251338 8.5346031 z" + transform="matrix(0.9428091,0,0,0.9050967,-9.7500007,5.2753589)" /> + <path + transform="matrix(0.9428091,0,0,0.9050967,-11.75,5.2753591)" + d="M 26.251338 8.5346031 A 0.53033006 1.1048543 0 1 1 25.190678,8.5346031 A 0.53033006 1.1048543 0 1 1 26.251338 8.5346031 z" + sodipodi:ry="1.1048543" + sodipodi:rx="0.53033006" + sodipodi:cy="8.5346031" + sodipodi:cx="25.721008" + id="path9197" + style="opacity:0.98999999;fill:url(#linearGradient9203);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + <rect + style="opacity:1;fill:url(#linearGradient9243);fill-opacity:1;stroke:#787b75;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect9239" + width="9" + height="13" + x="36.5" + y="30.5" /> + <text + xml:space="preserve" + style="font-size:6.93571424px;font-style:normal;font-weight:normal;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="38.141022" + y="38.901794" + id="text9282"><tspan + style="font-weight:bold;fill:#2e3436" + sodipodi:role="line" + id="tspan9284" + x="38.141022" + y="38.901794">9</tspan></text> + <rect + style="opacity:1;fill:none;fill-opacity:1;stroke:#dbdbdb;stroke-width:0.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect9241" + width="7" + height="11.000001" + x="37.5" + y="31.5" /> + <g + id="g9270" + transform="matrix(1,0,-0.2824822,0.8821489,9.1580468,2.6533852)"> + <path + style="opacity:1;fill:url(#linearGradient9274);fill-opacity:1;stroke:#787b75;stroke-width:1.0647043;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 36.5,31.5 L 36.5,39.5 L 45.5,39.5 L 45.5,31.5 L 36.5,31.5 z " + id="path9264" /> + <path + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.0647043;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 37.5,32.5 L 37.5,38.5 L 44.5,38.5 L 44.5,32.5 L 37.5,32.5 z " + id="path9266" /> + </g> + </g> +</svg> diff --git a/extensions/cpsection/Makefile.am b/extensions/cpsection/Makefile.am index a92b5dd..443a5e1 100644 --- a/extensions/cpsection/Makefile.am +++ b/extensions/cpsection/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS = aboutme aboutcomputer datetime frame keyboard language \ - modemconfiguration network power updater + modemconfiguration network power smolt updater sugardir = $(pkgdatadir)/extensions/cpsection sugar_PYTHON = __init__.py diff --git a/extensions/cpsection/smolt/Makefile.am b/extensions/cpsection/smolt/Makefile.am new file mode 100644 index 0000000..7e88609 --- /dev/null +++ b/extensions/cpsection/smolt/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/extensions/cpsection/smolt + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/extensions/cpsection/smolt/__init__.py b/extensions/cpsection/smolt/__init__.py new file mode 100644 index 0000000..d1c0327 --- /dev/null +++ b/extensions/cpsection/smolt/__init__.py @@ -0,0 +1,24 @@ +# Copyright (C) 2010 Sebastian Dziallas + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ + +CLASS = 'smolt' +ICON = 'module-smolt' +TITLE = _('Hardware Profile') + + + diff --git a/extensions/cpsection/smolt/model.py b/extensions/cpsection/smolt/model.py new file mode 100644 index 0000000..a08a502 --- /dev/null +++ b/extensions/cpsection/smolt/model.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010 Sebastian Dziallas +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +import os +import logging +import re +import subprocess +from gettext import gettext as _ +import errno + +from jarabe import config + +_not_available = _('Not available') + +def submit_profile(): + subprocess.call(['smoltSendProfile', '-a']) + +def delete_profile(): + subprocess.call(['smoltDeleteProfile']) + os.remove(os.getenv("HOME") + '/.smolt/uuiddb.cfg') + +def get_profile_url(): + profile_url = _read_file(os.getenv("HOME") + '/.smolt/uuiddb.cfg') + if profile_url is None: + profile_url = _not_available + return profile_url + +def print_profile_url(): + profile_url = get_profile_url() + if profile_url is None: + profile_url = _not_available + print profile_url + +def _read_file(path): + if os.access(path, os.R_OK) == 0: + return None + + fd = open(path, 'r') + value = fd.read() + fd.close() + if value: + value = value.strip('\n') + return value + else: + _logger.debug('No information in file or directory: %s', path) + return None + +def get_policy(): + + policy_file = os.path.join('/usr/share/smolt/doc/', 'PrivacyPolicy') + + try: + fd = open(policy_file) + # remove 0x0c page breaks which can't be rendered in text views + policy_text = fd.read().replace('\x0c', '') + fd.close() + except IOError: + policy_text = _not_available + return policy_text diff --git a/extensions/cpsection/smolt/view.py b/extensions/cpsection/smolt/view.py new file mode 100644 index 0000000..8efdc7d --- /dev/null +++ b/extensions/cpsection/smolt/view.py @@ -0,0 +1,148 @@ +# Copyright (C) 2010 Sebastian Dziallas +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import gtk +from gettext import gettext as _ + +from sugar.graphics import style +from jarabe.controlpanel.sectionview import SectionView + +CLASS = 'smolt' +ICON = 'module-smolt' +TITLE = _('Hardware Profile') + +class smolt(SectionView): + def __init__(self, model, alerts=None): + SectionView.__init__(self) + + self._model = model + + self.set_border_width(style.DEFAULT_SPACING * 2) + self.set_spacing(style.DEFAULT_SPACING) + self._group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) + + scrollwindow = gtk.ScrolledWindow() + scrollwindow.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) + self.pack_start(scrollwindow, expand=True) + scrollwindow.show() + + self._vbox = gtk.VBox() + scrollwindow.add_with_viewport(self._vbox) + self._vbox.show() + self.add(scrollwindow) + + self._smolt_submit_profile_handler = None + self._smolt_delete_profile_handler = None + + label_smolt = gtk.Label(_('Hardware Profile')) + label_smolt.set_alignment(0, 0) + self._vbox.pack_start(label_smolt, expand=False) + label_smolt.show() + box_smolt = gtk.VBox() + box_smolt.set_border_width(style.DEFAULT_SPACING * 2) + box_smolt.set_spacing(style.DEFAULT_SPACING) + + smolt_info = gtk.Label(_("We invite you to create a hardware profile for your computer. " + "Doing so helps software developers to diagnose possible problems. " + "You can submit and then delete your profile by pressing the buttons below. ")) + smolt_info.set_alignment(0, 0) + smolt_info.set_line_wrap(True) + smolt_info.show() + box_smolt.pack_start(smolt_info, expand=False) + + box_submit_profile = gtk.HBox(spacing=style.DEFAULT_SPACING) + self._submit_profile_button = gtk.Button() + self._submit_profile_button.set_label(_('Submit Profile')) + box_submit_profile.pack_start(self._submit_profile_button, expand=False) + self._submit_profile_button.show() + box_smolt.pack_start(box_submit_profile, expand=False) + box_submit_profile.show() + + box_delete_profile = gtk.HBox(spacing=style.DEFAULT_SPACING) + self._delete_profile_button = gtk.Button() + self._delete_profile_button.set_label(_('Delete Profile')) + box_delete_profile.pack_start(self._delete_profile_button, expand=False) + self._delete_profile_button.show() + box_smolt.pack_start(box_delete_profile, expand=False) + box_delete_profile.show() + + box_profile = gtk.HBox(spacing=style.DEFAULT_SPACING) + label_profile = gtk.Label(_('Profile:')) + label_profile.set_alignment(1, 0) + label_profile.modify_fg(gtk.STATE_NORMAL, + style.COLOR_SELECTION_GREY.get_gdk_color()) + box_profile.pack_start(label_profile, expand=False) + self._group.add_widget(label_profile) + label_profile.show() + label_profile_url = gtk.Label(self._model.get_profile_url()) + label_profile_url.set_alignment(0, 0) + box_profile.pack_start(label_profile_url, expand=False) + label_profile_url.show() + box_smolt.pack_start(box_profile, expand=False) + box_profile.show() + + self._vbox.pack_start(box_smolt, expand=False) + box_smolt.show() + + self._setup_submit() + self._setup_delete() + self._setup_policy() + + def _setup_submit(self): + self._smolt_submit_profile_handler = \ + self._submit_profile_button.connect( \ + 'clicked', self.smolt_submit_profile_cb) + + def smolt_submit_profile_cb(self, widget): + self._model.submit_profile() + + def _setup_delete(self): + self._smolt_delete_profile_handler = \ + self._delete_profile_button.connect( \ + 'clicked', self.smolt_delete_profile_cb) + + def smolt_delete_profile_cb(self, widget): + self._model.delete_profile() + + def _setup_policy(self): + separator_policy = gtk.HSeparator() + self._vbox.pack_start(separator_policy, expand=False) + separator_policy.show() + + vbox_policy = gtk.VBox() + vbox_policy.set_border_width(style.DEFAULT_SPACING * 2) + vbox_policy.set_spacing(style.DEFAULT_SPACING) + + expander = gtk.Expander(_("Privacy Policy")) + expander.connect("notify::expanded", self.policy_expander_cb) + expander.show() + vbox_policy.pack_start(expander, expand=True) + + self._vbox.pack_start(vbox_policy, expand=True) + vbox_policy.show() + + def policy_expander_cb(self, expander, param_spec): + # load/destroy the license viewer on-demand, to avoid storing the + # GPL in memory at all times + if expander.get_expanded(): + view_policy = gtk.TextView() + view_policy.set_editable(False) + view_policy.get_buffer().set_text(self._model.get_policy()) + view_policy.show() + expander.add(view_policy) + else: + expander.get_child().destroy() |