Ticket #1669: 0001-accessibility.patch
File 0001-accessibility.patch, 22.4 KB (added by earias, 14 years ago) |
---|
-
bin/sugar-session
From 72923927c222d8cd09deb593e8969ca6032a5f5e Mon Sep 17 00:00:00 2001 From: Esteban <earias@localhost.localdomain> Date: Wed, 20 Jan 2010 10:54:11 -0200 Subject: [PATCH] accessibility --- bin/sugar-session | 38 ++++ data/icons/Makefile.am | 4 +- data/icons/module-accessibility.svg | 279 ++++++++++++++++++++++++ extensions/cpsection/Makefile.am | 2 +- extensions/cpsection/accessibility/Makefile.am | 6 + extensions/cpsection/accessibility/__init__.py | 22 ++ extensions/cpsection/accessibility/model.py | 68 ++++++ extensions/cpsection/accessibility/view.py | 100 +++++++++ 8 files changed, 517 insertions(+), 2 deletions(-) create mode 100755 data/icons/module-accessibility.svg create mode 100644 extensions/cpsection/accessibility/Makefile.am create mode 100644 extensions/cpsection/accessibility/__init__.py create mode 100644 extensions/cpsection/accessibility/model.py create mode 100644 extensions/cpsection/accessibility/view.py diff --git a/bin/sugar-session b/bin/sugar-session index 471d878..ee2fcdb 100644
a b def set_fonts(): 213 213 settings = gtk.settings_get_default() 214 214 settings.set_property("gtk-font-name", "%s %f" % (face, size)) 215 215 216 def set_accessibility(): 217 client = gconf.client_get_default() 218 is_accessibility = client.dir_exists("/desktop/sugar/accessibility") 219 if is_accessibility: 220 set_accessibility_keyboard() 221 222 def get_mouseKeys(): 223 client = gconf.client_get_default() 224 return client.get_bool("/desktop/sugar/accessibility/mouse_keys") 225 226 def get_stickyKeys(): 227 client = gconf.client_get_default() 228 return client.get_bool("/desktop/sugar/accessibility/sticky_keys") 229 230 def get_bounceKeys(): 231 client = gconf.client_get_default() 232 return client.get_bool("/desktop/sugar/accessibility/bounce_keys") 233 234 def set_accessibility_keyboard(): 235 is_stickyKeys = get_stickyKeys() 236 is_bounceKeys = get_bounceKeys() 237 is_mouseKeys = get_mouseKeys() 238 if is_mouseKeys or is_bounceKeys or is_mouseKeys: 239 if is_stickyKeys: 240 cmd_stiky = '+stickykeys' 241 else: 242 cmd_stiky = '-stickykeys' 243 if is_bounceKeys: 244 cmd_bounce = '+bouncekeys' 245 else: 246 cmd_bounce = '-bouncekeys' 247 if is_mouseKeys: 248 subprocess.call(['ax', cmd_bounce, cmd_stiky, '+mousekeys', 'mousemaxspeed','3000', 'mousetimetomax', '1000', '-timeout', '-repeatkeys']) 249 else: 250 subprocess.call(['ax', cmd_bounce, cmd_stiky, '-mousekeys', 'mousemaxspeed', '3000', 'mousetimetomax', '1000', '+timeout', '+repeatkeys']) 251 216 252 def main(): 217 253 cleanup_logs() 218 254 logger.start('shell') … … def main(): 250 286 screen = wnck.screen_get_default() 251 287 screen.connect('window-manager-changed', __window_manager_changed_cb) 252 288 289 set_accessibility() 290 253 291 try: 254 292 gtk.main() 255 293 except KeyboardInterrupt: -
data/icons/Makefile.am
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index d2f4ede..eebc909 100644
a b sugardir = $(pkgdatadir)/data/icons 3 3 sugar_DATA = \ 4 4 module-about_me.svg \ 5 5 module-about_my_computer.svg \ 6 module-accessibility.svg \ 6 7 module-date_and_time.svg \ 7 8 module-frame.svg \ 8 9 module-keyboard.svg \ 9 10 module-language.svg \ 10 11 module-network.svg \ 11 12 module-power.svg \ 12 module-updater.svg 13 module-updater.svg 14 13 15 14 16 EXTRA_DIST = $(sugar_DATA) -
new file data/icons/module-accessibility.svg
diff --git a/data/icons/module-accessibility.svg b/data/icons/module-accessibility.svg new file mode 100755 index 0000000..3397ab2
- + 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 2 <!-- Created with Inkscape (http://www.inkscape.org/) --> 3 4 <svg 5 xmlns:dc="http://purl.org/dc/elements/1.1/" 6 xmlns:cc="http://creativecommons.org/ns#" 7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 8 xmlns:svg="http://www.w3.org/2000/svg" 9 xmlns="http://www.w3.org/2000/svg" 10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" 11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" 12 width="55" 13 height="55" 14 id="svg795" 15 sodipodi:version="0.32" 16 inkscape:version="0.46+devel" 17 version="1.0" 18 sodipodi:docname="acc79.svg" 19 inkscape:output_extension="org.inkscape.output.svg.inkscape"> 20 <defs 21 id="defs797"> 22 <inkscape:perspective 23 sodipodi:type="inkscape:persp3d" 24 inkscape:vp_x="0 : 526.18109 : 1" 25 inkscape:vp_y="0 : 1000 : 0" 26 inkscape:vp_z="744.09448 : 526.18109 : 1" 27 inkscape:persp3d-origin="372.04724 : 350.78739 : 1" 28 id="perspective803" /> 29 <inkscape:perspective 30 id="perspective813" 31 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 32 inkscape:vp_z="1 : 0.5 : 1" 33 inkscape:vp_y="0 : 1000 : 0" 34 inkscape:vp_x="0 : 0.5 : 1" 35 sodipodi:type="inkscape:persp3d" /> 36 <inkscape:perspective 37 id="perspective813-2" 38 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 39 inkscape:vp_z="1 : 0.5 : 1" 40 inkscape:vp_y="0 : 1000 : 0" 41 inkscape:vp_x="0 : 0.5 : 1" 42 sodipodi:type="inkscape:persp3d" /> 43 <inkscape:perspective 44 id="perspective1380" 45 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 46 inkscape:vp_z="1 : 0.5 : 1" 47 inkscape:vp_y="0 : 1000 : 0" 48 inkscape:vp_x="0 : 0.5 : 1" 49 sodipodi:type="inkscape:persp3d" /> 50 <inkscape:perspective 51 id="perspective1380-3" 52 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 53 inkscape:vp_z="1 : 0.5 : 1" 54 inkscape:vp_y="0 : 1000 : 0" 55 inkscape:vp_x="0 : 0.5 : 1" 56 sodipodi:type="inkscape:persp3d" /> 57 <inkscape:perspective 58 id="perspective1448" 59 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 60 inkscape:vp_z="1 : 0.5 : 1" 61 inkscape:vp_y="0 : 1000 : 0" 62 inkscape:vp_x="0 : 0.5 : 1" 63 sodipodi:type="inkscape:persp3d" /> 64 <inkscape:perspective 65 id="perspective1448-2" 66 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 67 inkscape:vp_z="1 : 0.5 : 1" 68 inkscape:vp_y="0 : 1000 : 0" 69 inkscape:vp_x="0 : 0.5 : 1" 70 sodipodi:type="inkscape:persp3d" /> 71 <inkscape:perspective 72 id="perspective1479" 73 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 74 inkscape:vp_z="1 : 0.5 : 1" 75 inkscape:vp_y="0 : 1000 : 0" 76 inkscape:vp_x="0 : 0.5 : 1" 77 sodipodi:type="inkscape:persp3d" /> 78 <inkscape:perspective 79 id="perspective1501" 80 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 81 inkscape:vp_z="1 : 0.5 : 1" 82 inkscape:vp_y="0 : 1000 : 0" 83 inkscape:vp_x="0 : 0.5 : 1" 84 sodipodi:type="inkscape:persp3d" /> 85 <inkscape:perspective 86 id="perspective1523" 87 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 88 inkscape:vp_z="1 : 0.5 : 1" 89 inkscape:vp_y="0 : 1000 : 0" 90 inkscape:vp_x="0 : 0.5 : 1" 91 sodipodi:type="inkscape:persp3d" /> 92 <inkscape:perspective 93 id="perspective1545" 94 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 95 inkscape:vp_z="1 : 0.5 : 1" 96 inkscape:vp_y="0 : 1000 : 0" 97 inkscape:vp_x="0 : 0.5 : 1" 98 sodipodi:type="inkscape:persp3d" /> 99 <inkscape:perspective 100 id="perspective1567" 101 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 102 inkscape:vp_z="1 : 0.5 : 1" 103 inkscape:vp_y="0 : 1000 : 0" 104 inkscape:vp_x="0 : 0.5 : 1" 105 sodipodi:type="inkscape:persp3d" /> 106 <inkscape:perspective 107 id="perspective1589" 108 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 109 inkscape:vp_z="1 : 0.5 : 1" 110 inkscape:vp_y="0 : 1000 : 0" 111 inkscape:vp_x="0 : 0.5 : 1" 112 sodipodi:type="inkscape:persp3d" /> 113 <inkscape:perspective 114 id="perspective1617" 115 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 116 inkscape:vp_z="1 : 0.5 : 1" 117 inkscape:vp_y="0 : 1000 : 0" 118 inkscape:vp_x="0 : 0.5 : 1" 119 sodipodi:type="inkscape:persp3d" /> 120 <inkscape:perspective 121 id="perspective51" 122 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 123 inkscape:vp_z="1 : 0.5 : 1" 124 inkscape:vp_y="0 : 1000 : 0" 125 inkscape:vp_x="0 : 0.5 : 1" 126 sodipodi:type="inkscape:persp3d" /> 127 <inkscape:perspective 128 id="perspective97" 129 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 130 inkscape:vp_z="1 : 0.5 : 1" 131 inkscape:vp_y="0 : 1000 : 0" 132 inkscape:vp_x="0 : 0.5 : 1" 133 sodipodi:type="inkscape:persp3d" /> 134 <inkscape:perspective 135 id="perspective53" 136 inkscape:persp3d-origin="0.5 : 0.33333333 : 1" 137 inkscape:vp_z="1 : 0.5 : 1" 138 inkscape:vp_y="0 : 1000 : 0" 139 inkscape:vp_x="0 : 0.5 : 1" 140 sodipodi:type="inkscape:persp3d" /> 141 </defs> 142 <sodipodi:namedview 143 id="base" 144 pagecolor="#ffffff" 145 bordercolor="#666666" 146 borderopacity="1.0" 147 inkscape:pageopacity="0.0" 148 inkscape:pageshadow="2" 149 inkscape:zoom="7.9195959" 150 inkscape:cx="39.65323" 151 inkscape:cy="29.255214" 152 inkscape:document-units="px" 153 inkscape:current-layer="layer1" 154 showgrid="false" 155 inkscape:object-paths="true" 156 inkscape:snap-nodes="true" 157 inkscape:object-nodes="false" 158 inkscape:snap-bbox="true" 159 inkscape:snap-global="false" 160 showguides="true" 161 inkscape:guide-bbox="true" 162 inkscape:window-width="1440" 163 inkscape:window-height="829" 164 inkscape:window-x="0" 165 inkscape:window-y="25"> 166 <sodipodi:guide 167 orientation="0,1" 168 position="27.021581,50.002551" 169 id="guide1605" /> 170 <sodipodi:guide 171 orientation="0,1" 172 position="27.021581,6.0609153" 173 id="guide1607" /> 174 </sodipodi:namedview> 175 <metadata 176 id="metadata800"> 177 <rdf:RDF> 178 <cc:Work 179 rdf:about=""> 180 <dc:format>image/svg+xml</dc:format> 181 <dc:type 182 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> 183 <dc:title></dc:title> 184 </cc:Work> 185 </rdf:RDF> 186 </metadata> 187 <g 188 inkscape:label="Capa 1" 189 inkscape:groupmode="layer" 190 id="layer1"> 191 <path 192 sodipodi:type="arc" 193 style="fill:none;stroke:#ffffff" 194 id="path12" 195 sodipodi:cx="-32.640553" 196 sodipodi:cy="30.440666" 197 sodipodi:rx="8.901969" 198 sodipodi:ry="11.301082" 199 d="m -23.738584,30.440666 a 8.901969,11.301082 0 1 1 -17.803937,0 8.901969,11.301082 0 1 1 17.803937,0 z" 200 transform="matrix(1.2765958,0,0,1.0558659,19.192898,-13.127946)" /> 201 <path 202 style="fill:none;stroke:#ffffff;stroke-width:1.44962609;stroke-opacity:1" 203 d="m 30.145644,37.823484 c -0.583589,6.659344 -6.7511,11.52268 -13.775517,10.862567 C 9.3457054,48.02594 4.1243814,42.092348 4.7079694,35.433004 5.2915594,28.773661 20.67887,20.597949 14.885997,24.011638 -12.777062,40.313232 24.43362,62.068174 30.145644,37.823484 z" 204 id="path1405-0" 205 sodipodi:nodetypes="csssc" /> 206 <rect 207 style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.50547338;stroke-opacity:1" 208 id="rect1438-8" 209 width="2.916333" 210 height="21.188446" 211 x="18.332197" 212 y="13.76814" 213 ry="1.3939767" /> 214 <rect 215 style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.41987956;stroke-opacity:1" 216 id="rect1438-1-87" 217 width="2.8716421" 218 height="19.140917" 219 x="-35.091366" 220 y="-38.207035" 221 ry="1.259271" 222 transform="matrix(0,-1,-1,0,0,0)" /> 223 <rect 224 style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.21988189;stroke-opacity:1" 225 id="rect1438-0-4" 226 width="2.5733202" 227 height="15.766372" 228 x="-5.4068875" 229 y="-65.997124" 230 ry="1.0372615" 231 transform="matrix(-0.55477829,0.83199823,-0.68762037,-0.72607041,0,0)" /> 232 <rect 233 style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.98759735;stroke-opacity:1" 234 id="rect1438-0-1-8" 235 width="2.0588" 236 height="12.916228" 237 x="6.7647386" 238 y="-38.278324" 239 ry="0.84975183" 240 transform="matrix(-0.21998034,0.97550431,-0.88967727,-0.45658992,0,0)" /> 241 <rect 242 style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.69142139;stroke-opacity:1" 243 id="rect1438-1-8-5" 244 width="0.98179615" 245 height="13.275604" 246 x="-30.243309" 247 y="-41.495876" 248 ry="0.87339497" 249 transform="matrix(0,-1,-1,0,0,0)" /> 250 <rect 251 style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.64177793;stroke-opacity:1" 252 id="rect1438-1-8-0-0" 253 width="0.97070193" 254 height="11.568416" 255 x="50.822704" 256 y="-8.6089849" 257 ry="0.76108003" 258 transform="matrix(0.89791652,0.44016579,0.56230073,-0.82693282,0,0)" /> 259 <rect 260 style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.68172067;stroke-opacity:1" 261 id="rect1438-0-1-7-7" 262 width="1.6299056" 263 height="7.7739253" 264 x="72.759727" 265 y="35.364716" 266 ry="0.51144254" 267 transform="matrix(0.9888174,0.14913131,-0.60877492,0.79334299,0,0)" /> 268 <path 269 sodipodi:type="arc" 270 style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-opacity:1" 271 id="path1603-2" 272 sodipodi:cx="76.392784" 273 sodipodi:cy="18.634508" 274 sodipodi:rx="3.2829957" 275 sodipodi:ry="3.0304577" 276 d="m 79.67578,18.634508 a 3.2829957,3.0304577 0 1 1 -6.565992,0 3.2829957,3.0304577 0 1 1 6.565992,0 z" 277 transform="matrix(1.5397454,0,0,1.4719643,-97.932275,-17.750188)" /> 278 </g> 279 </svg> -
extensions/cpsection/Makefile.am
diff --git a/extensions/cpsection/Makefile.am b/extensions/cpsection/Makefile.am index dd0a6b8..33691f7 100644
a b 1 SUBDIRS = aboutme aboutcomputer datetime frame keyboard language network power updater1 SUBDIRS = aboutme aboutcomputer accessibility datetime frame keyboard language network power updater 2 2 3 3 sugardir = $(pkgdatadir)/extensions/cpsection 4 4 sugar_PYTHON = __init__.py -
new file extensions/cpsection/accessibility/Makefile.am
diff --git a/extensions/cpsection/accessibility/Makefile.am b/extensions/cpsection/accessibility/Makefile.am new file mode 100644 index 0000000..70d26f4
- + 1 sugardir = $(pkgdatadir)/extensions/cpsection/accessibility 2 3 sugar_PYTHON = \ 4 __init__.py \ 5 model.py \ 6 view.py -
new file extensions/cpsection/accessibility/__init__.py
diff --git a/extensions/cpsection/accessibility/__init__.py b/extensions/cpsection/accessibility/__init__.py new file mode 100644 index 0000000..988d8bf
- + 1 # Copyright (C) 2008, OLPC 2 # 3 # This program is free software; you can redistribute it and/or modify 4 # it under the terms of the GNU General Public License as published by 5 # the Free Software Foundation; either version 2 of the License, or 6 # (at your option) any later version. 7 # 8 # This program is distributed in the hope that it will be useful, 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 # GNU General Public License for more details. 12 # 13 # You should have received a copy of the GNU General Public License 14 # along with this program; if not, write to the Free Software 15 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 17 from gettext import gettext as _ 18 19 CLASS = 'accessibility' 20 ICON = 'module-accessibility' 21 TITLE = 'Accesibilidad' 22 -
new file extensions/cpsection/accessibility/model.py
diff --git a/extensions/cpsection/accessibility/model.py b/extensions/cpsection/accessibility/model.py new file mode 100644 index 0000000..07e01a4
- + 1 import subprocess 2 import os 3 import dbus 4 import ConfigParser 5 import gconf 6 7 from gettext import gettext as _ 8 from sugar import profile 9 10 KEYWORDS = ['mouseKeys', 'stickyKeys', 'bounceKeys'] 11 12 ###################################################### 13 14 def get_mouseKeys(): 15 client = gconf.client_get_default() 16 return client.get_bool("/desktop/sugar/accessibility/mouse_keys") 17 18 def set_mouseKeys(activar): 19 client = gconf.client_get_default() 20 client.set_bool("/desktop/sugar/accessibility/mouse_keys", activar) 21 ejecutar_config() 22 23 def print_mouseKeys(): 24 print str(get_mouseKeys()) 25 26 ###################################################### 27 28 def get_stickyKeys(): 29 client = gconf.client_get_default() 30 return client.get_bool("/desktop/sugar/accessibility/sticky_keys") 31 32 def set_stickyKeys(activar): 33 client = gconf.client_get_default() 34 client.set_bool("/desktop/sugar/accessibility/sticky_keys", activar) 35 ejecutar_config() 36 37 def print_stickyKeys(): 38 print str(get_stickyKeys()) 39 40 ###################################################### 41 42 def get_bounceKeys(): 43 client = gconf.client_get_default() 44 return client.get_bool("/desktop/sugar/accessibility/bounce_keys") 45 46 def set_bounceKeys(activar): 47 client = gconf.client_get_default() 48 client.set_bool("/desktop/sugar/accessibility/bounce_keys", activar) 49 ejecutar_config() 50 51 def print_bounceKeys(): 52 print str(get_bounceKeys()) 53 54 ###################################################### 55 56 def ejecutar_config(): 57 if get_stickyKeys(): 58 cmd_stiky = '+stickykeys' 59 else: 60 cmd_stiky = '-stickykeys' 61 if get_bounceKeys(): 62 cmd_bounce = '+bouncekeys' 63 else: 64 cmd_bounce = '-bouncekeys' 65 if get_mouseKeys(): 66 subprocess.call(['ax', cmd_bounce, cmd_stiky, '+mousekeys', 'mousemaxspeed','3000', 'mousetimetomax', '1000', '-timeout', '-repeatkeys']) 67 else: 68 subprocess.call(['ax', cmd_bounce, cmd_stiky, '-mousekeys', 'mousemaxspeed', '3000', 'mousetimetomax', '1000', '+timeout', '+repeatkeys']) -
new file extensions/cpsection/accessibility/view.py
diff --git a/extensions/cpsection/accessibility/view.py b/extensions/cpsection/accessibility/view.py new file mode 100644 index 0000000..ac6d83e
- + 1 # Este archivo usa el encoding: utf-8 2 3 import gtk 4 from gettext import gettext as _ 5 6 from sugar.graphics import style 7 8 from jarabe import config 9 from jarabe.controlpanel.sectionview import SectionView 10 from jarabe.controlpanel.inlinealert import InlineAlert 11 12 class accessibility(SectionView): 13 def __init__(self, model, alerts=None): 14 SectionView.__init__(self) 15 16 self._model = model 17 self.set_border_width(style.DEFAULT_SPACING * 2) 18 self.set_spacing(style.DEFAULT_SPACING) 19 group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) 20 21 separator_pm = gtk.HSeparator() 22 self.pack_start(separator_pm, expand=False) 23 separator_pm.show() 24 25 label_pm_teclado = gtk.Label(_('Teclado')) 26 label_pm_teclado.set_alignment(0, 0) 27 self.pack_start(label_pm_teclado, expand=False) 28 label_pm_teclado.show() 29 30 box_pm = gtk.VBox() 31 box_pm.set_border_width(style.DEFAULT_SPACING * 2) 32 box_pm.set_spacing(style.DEFAULT_SPACING) 33 ############################################################# 34 self.btn_mousekeys = gtk.CheckButton(" Teclas del ratón") 35 self._mouse_pm_change_handler = self.btn_mousekeys.connect("toggled", self.set_mouseKeys) 36 self.estado_inicial_mouseKeys = self._model.get_mouseKeys() 37 if self.estado_inicial_mouseKeys: 38 self.btn_mousekeys.set_active(True) 39 else: 40 self.btn_mousekeys.set_active(False) 41 box_pm.pack_start(self.btn_mousekeys, True, True, 2) 42 self.btn_mousekeys.show() 43 44 lbl_mouse = gtk.Label(' Permite mover el puntero del ratón utilizando un teclado numérico \n o las teclas de juego.') 45 lbl_mouse.set_alignment(0, 0) 46 box_pm.pack_start(lbl_mouse, True, True, 2) 47 lbl_mouse.show() 48 49 ############################################################# 50 self.btn_stickykeys = gtk.CheckButton(" Teclas pegajosas") 51 self._sticky_pm_change_handler = self.btn_stickykeys.connect("toggled", self.set_stickyKeys) 52 self.estado_inicial_stickyKeys = self._model.get_stickyKeys() 53 if self.estado_inicial_stickyKeys: 54 self.btn_stickykeys.set_active(True) 55 else: 56 self.btn_stickykeys.set_active(False) 57 box_pm.pack_start(self.btn_stickykeys, True, True, 2) 58 self.btn_stickykeys.show() 59 60 lbl_sticky = gtk.Label(' Permite realizar las combinaciones de teclas que requieren pulsaciones simultáneas, \n presionando las teclas de una en una. Ej: ctrl + Q') 61 lbl_sticky.set_alignment(0, 0) 62 box_pm.pack_start(lbl_sticky, True, True, 2) 63 lbl_sticky.show() 64 ############################################################# 65 self.btn_bouncekeys = gtk.CheckButton(" Teclas de rebote") 66 self._bounce_pm_change_handler = self.btn_bouncekeys.connect("toggled", self.set_bounceKeys) 67 self.estado_inicial_bounceKeys = self._model.get_bounceKeys() 68 if self.estado_inicial_bounceKeys: 69 self.btn_bouncekeys.set_active(True) 70 else: 71 self.btn_bouncekeys.set_active(False) 72 box_pm.pack_start(self.btn_bouncekeys, True, True, 2) 73 self.btn_bouncekeys.show() 74 75 lbl_bounce = gtk.Label(' Ignora la presión rápida y repetida de una tecla,\n el sistema la tomará como una única pulsación.') 76 lbl_bounce.set_alignment(0, 0) 77 box_pm.pack_start(lbl_bounce, True, True, 2) 78 lbl_bounce.show() 79 80 ############################################################# 81 82 self.pack_start(box_pm, expand=False) 83 box_pm.show() 84 85 def set_mouseKeys(self, widget): 86 state = widget.get_active() 87 self._model.set_mouseKeys(state) 88 89 def set_stickyKeys(self, widget): 90 state = widget.get_active() 91 self._model.set_stickyKeys(state) 92 93 def set_bounceKeys(self, widget): 94 state = widget.get_active() 95 self._model.set_bounceKeys(state) 96 97 def undo(self): 98 self._model.set_mouseKeys(self.estado_inicial_mouseKeys) 99 self._model.set_stickyKeys(self.estado_inicial_stickyKeys) 100 self._model.set_bounceKeys(self.estado_inicial_bounceKeys)