Preferences/Shortcuts.py

branch
5_4_x
changeset 3643
a60d2ee42402
parent 3160
209a07d7e401
equal deleted inserted replaced
3641:8cfe4af1af36 3643:a60d2ee42402
30 if accel is not None: 30 if accel is not None:
31 act.setShortcut(QKeySequence(accel)) 31 act.setShortcut(QKeySequence(accel))
32 accel = prefClass.settings.value( 32 accel = prefClass.settings.value(
33 "Shortcuts/{0}/{1}/AltAccel".format(category, act.objectName())) 33 "Shortcuts/{0}/{1}/AltAccel".format(category, act.objectName()))
34 if accel is not None: 34 if accel is not None:
35 act.setAlternateShortcut(QKeySequence(accel)) 35 act.setAlternateShortcut(QKeySequence(accel), removeEmpty=True)
36 36
37 37
38 def readShortcuts(prefClass=Prefs, helpViewer=None, pluginName=None): 38 def readShortcuts(prefClass=Prefs, helpViewer=None, pluginName=None):
39 """ 39 """
40 Module function to read the keyboard shortcuts for the defined QActions. 40 Module function to read the keyboard shortcuts for the defined QActions.
251 for act in actions: 251 for act in actions:
252 if act.objectName(): 252 if act.objectName():
253 try: 253 try:
254 accel, altAccel = sdict[act.objectName()] 254 accel, altAccel = sdict[act.objectName()]
255 act.setShortcut(QKeySequence(accel)) 255 act.setShortcut(QKeySequence(accel))
256 act.setAlternateShortcut(QKeySequence(altAccel)) 256 act.setAlternateShortcut(QKeySequence(altAccel),
257 removeEmpty=True)
257 except KeyError: 258 except KeyError:
258 pass 259 pass
259 260
260 261
261 def setActions(shortcuts): 262 def setActions(shortcuts):

eric ide

mercurial