diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-10-07 01:48:23 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-10-07 01:48:23 (GMT) |
commit | 28048b1afaf1e7738cd27eddec0db5f8ca29507c (patch) | |
tree | 392c07c450229eaf28d0f9edc06cc0eccddcb57a | |
parent | 5cfa5baea45aa9b1339047dde65630f569c39822 (diff) |
Setup content for SettingsItem
-rw-r--r-- | desktop/icons/alert-icon.svg | 71 | ||||
-rw-r--r-- | icons/alert-icon.svg | 71 | ||||
-rw-r--r-- | icons/notify-alert-icon.svg | 105 | ||||
-rw-r--r-- | options.py | 29 |
4 files changed, 273 insertions, 3 deletions
diff --git a/desktop/icons/alert-icon.svg b/desktop/icons/alert-icon.svg new file mode 100644 index 0000000..a3d8294 --- /dev/null +++ b/desktop/icons/alert-icon.svg @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<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" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="55px" + height="55px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="dialog-icon.svg"> + <metadata + id="metadata14"> + <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="defs12" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="744" + id="namedview10" + showgrid="false" + inkscape:zoom="4.0014917" + inkscape:cx="30.944886" + inkscape:cy="25.607541" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + showguides="true" + inkscape:guide-bbox="true" + fit-margin-top="5" + fit-margin-left="5" + fit-margin-bottom="5" + fit-margin-right="5" /> + <path + style="fill:#FFFFFF;stroke:#000000;stroke-width:3.05415082;stroke-linejoin:round;stroke-opacity:1" + d="m 48.06953,27.769832 a 21.079598,19.666916 0 0 1 -42.1591911,0 21.079598,19.666916 0 1 1 42.1591911,0 z" + id="path4" + inkscape:connector-curvature="0" /> + <path + style="fill:#FFFFFF;stroke:#000000;stroke-width:5.14514017;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 27.161618,15.154553 0.209126,17.372124 z" + id="path3801" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + style="fill:#000000;stroke:#000000;stroke-width:0.89009589;stroke-opacity:1" + d="m 24.746663,39.080393 a 2.9093511,2.4508687 0 1 1 5.818701,0 2.9093511,2.4508687 0 0 1 -5.818701,0 z" + id="path3863" /> +</svg> diff --git a/icons/alert-icon.svg b/icons/alert-icon.svg new file mode 100644 index 0000000..75fac6a --- /dev/null +++ b/icons/alert-icon.svg @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<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" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="55px" + height="55px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="dialog-icon.svg"> + <metadata + id="metadata14"> + <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="defs12" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="744" + id="namedview10" + showgrid="false" + inkscape:zoom="4.0014917" + inkscape:cx="30.944886" + inkscape:cy="25.607541" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + showguides="true" + inkscape:guide-bbox="true" + fit-margin-top="5" + fit-margin-left="5" + fit-margin-bottom="5" + fit-margin-right="5" /> + <path + style="fill:none;stroke:#ffffff;stroke-width:3.05415082;stroke-linejoin:round;stroke-opacity:1" + d="m 48.06953,27.769832 a 21.079598,19.666916 0 0 1 -42.1591911,0 21.079598,19.666916 0 1 1 42.1591911,0 z" + id="path4" + inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#ffffff;stroke-width:5.14514017;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 27.161618,15.154553 0.209126,17.372124 z" + id="path3801" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + style="fill:#ffffff;stroke:#ffffff;stroke-width:0.89009589;stroke-opacity:1" + d="m 24.746663,39.080393 a 2.9093511,2.4508687 0 1 1 5.818701,0 2.9093511,2.4508687 0 0 1 -5.818701,0 z" + id="path3863" /> +</svg> diff --git a/icons/notify-alert-icon.svg b/icons/notify-alert-icon.svg new file mode 100644 index 0000000..4f5d52b --- /dev/null +++ b/icons/notify-alert-icon.svg @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<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" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="55px" + height="55px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="notify-alert-icon.svg"> + <metadata + id="metadata14"> + <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="defs12" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1280" + inkscape:window-height="744" + id="namedview10" + showgrid="false" + inkscape:zoom="4.0014917" + inkscape:cx="30.944886" + inkscape:cy="25.607541" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + showguides="true" + inkscape:guide-bbox="true" + fit-margin-top="5" + fit-margin-left="5" + fit-margin-bottom="5" + fit-margin-right="5" /> + <path + style="fill:none;stroke:#ffffff;stroke-width:2.48807835999999982;stroke-linejoin:round;stroke-opacity:1" + d="m 39.855769,23.894545 a 17.114252,16.076363 0 0 1 -34.2285005,0 17.114252,16.076363 0 1 1 34.2285005,0 z" + id="path4" + inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#ffffff;stroke-width:4.19151258000000038;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 22.880906,13.582415 0.169787,14.200527 z" + id="path3801" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + style="fill:#ffffff;stroke:#ffffff;stroke-width:0.72512078000000002;stroke-opacity:1;fill-opacity:1" + d="m 20.920236,33.140158 a 2.3620644,2.0034181 0 1 1 4.724128,0 2.3620644,2.0034181 0 0 1 -4.724128,0 z" + id="path3863" /> + <path + sodipodi:type="arc" + style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:3.02743053;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + id="path2186" + sodipodi:cx="21.976866" + sodipodi:cy="21.815269" + sodipodi:rx="19.606812" + sodipodi:ry="19.768406" + d="m 41.583677,21.815269 a 19.606812,19.768406 0 1 1 -39.2136228,0 19.606812,19.768406 0 1 1 39.2136228,0 z" + transform="matrix(0.62306881,0,0,0.56656002,26.791801,24.600376)" /> + <path + inkscape:connector-curvature="0" + style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.19915104;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 30.927163,27.079711 -1.835494,1.883218" + id="path2188" + sodipodi:nodetypes="cc" /> + <path + inkscape:connector-curvature="0" + style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.19915104;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 40.349406,37.269799 8.729064,5.3932" + id="path4130" + sodipodi:nodetypes="cc" /> + <path + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" + id="path2211" + d="m 50.50573,27.415881 1.83549,1.88322" + style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.19915104;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + <path + inkscape:connector-curvature="0" + style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1.19915104;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 37.598624,24.054168 6.235642,6.87e-4" + id="path2213" + sodipodi:nodetypes="cc" /> +</svg> @@ -15,6 +15,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. +import os from gettext import gettext as _ import gobject import gtk @@ -36,9 +37,31 @@ class Options(ItemBox): self.basic = BasicOptions(activity, self, None) self.canvas_ghost = GhostGroup(self, _('_Canvas')) - stock.register('illustrate-alerts', _('Alerts'), '<Ctrl>T', None) - self.alerts = SettingsItem(self.activity, 'illustrate-alerts') + stock.register('illustrate-alerts', _('Alerts'), '<Ctrl>T', 'alert-icon') + self.alerts = SettingsItem(self.activity, 'illustrate-alerts', True) + if os.environ['PROGRAMRUNNING'] == 'SUGAR': + content = gtk.HBox() + from sugar.graphics.toolbutton import ToolButton + simple_alert = ToolButton('alert-icon') + content.pack_start(simple_alert, False, True, 0) + simple_alert.show() + + notify_alert = ToolButton('notify-alert-icon') + content.pack_end(notify_alert, False, True, 0) + notify_alert.show() + else: + content = gtk.VBox() + simple_alert = gtk.Button('Simple') + simple_alert.show() + content.pack_start(simple_alert, True, True) + + notify_alert = gtk.Button('Notify') + notify_alert.show() + content.pack_start(notify_alert, True, True) + content.show() + self.alerts.content = content self.canvas_ghost.append_item(self.alerts) + self.canvas_ghost.append_separator(True) stock.register('illustrate-circle', _('_Circle'), '<Ctrl>I', 'sugar-integration') self.circle_item = RadioItem(None, stock_id='illustrate-circle', important=True) self.canvas_ghost.append_item(self.circle_item) @@ -56,7 +79,7 @@ class Options(ItemBox): self.fill.tooltip = _('Fill color') self.settings_group.append_item(self.fill) self.stroke = ColorItem(activity) - stock.register('illustrate-stroke', _('_Stroke'), '<Ctrl>T', + stock.register('illustrate-stroke', _('_Stroke'), '<Ctrl>K', gtk.STOCK_SELECT_COLOR) self.stroke.tooltip = _('Stroke color') self.stroke._stock_id = 'illustrate-stroke' |