Preferences/Shortcuts.py

changeset 3642
1a6f8d9b63a5
parent 3178
f25fc1364c88
child 3656
441956d8fce5
equal deleted inserted replaced
3640:2bf828881e86 3642:1a6f8d9b63a5
32 if accel is not None: 32 if accel is not None:
33 act.setShortcut(QKeySequence(accel)) 33 act.setShortcut(QKeySequence(accel))
34 accel = prefClass.settings.value( 34 accel = prefClass.settings.value(
35 "Shortcuts/{0}/{1}/AltAccel".format(category, act.objectName())) 35 "Shortcuts/{0}/{1}/AltAccel".format(category, act.objectName()))
36 if accel is not None: 36 if accel is not None:
37 act.setAlternateShortcut(QKeySequence(accel)) 37 act.setAlternateShortcut(QKeySequence(accel), removeEmpty=True)
38 38
39 39
40 def readShortcuts(prefClass=Prefs, helpViewer=None, pluginName=None): 40 def readShortcuts(prefClass=Prefs, helpViewer=None, pluginName=None):
41 """ 41 """
42 Module function to read the keyboard shortcuts for the defined QActions. 42 Module function to read the keyboard shortcuts for the defined QActions.
253 for act in actions: 253 for act in actions:
254 if act.objectName(): 254 if act.objectName():
255 try: 255 try:
256 accel, altAccel = sdict[act.objectName()] 256 accel, altAccel = sdict[act.objectName()]
257 act.setShortcut(QKeySequence(accel)) 257 act.setShortcut(QKeySequence(accel))
258 act.setAlternateShortcut(QKeySequence(altAccel)) 258 act.setAlternateShortcut(QKeySequence(altAccel),
259 removeEmpty=True)
259 except KeyError: 260 except KeyError:
260 pass 261 pass
261 262
262 263
263 def setActions(shortcuts): 264 def setActions(shortcuts):

eric ide

mercurial