Preferences/Shortcuts.py

changeset 2408
dc3a7c9d8f6e
parent 2302
f29e9405c851
child 2525
8b507a9a2d40
child 3010
befeff46ec0f
equal deleted inserted replaced
2407:b98cc8ee1142 2408:dc3a7c9d8f6e
12 12
13 from E5Gui.E5Application import e5App 13 from E5Gui.E5Application import e5App
14 from E5Gui import E5MessageBox 14 from E5Gui import E5MessageBox
15 15
16 from Preferences import Prefs, syncPreferences 16 from Preferences import Prefs, syncPreferences
17
18 from E5XML.ShortcutsReader import ShortcutsReader
19 from E5XML.ShortcutsWriter import ShortcutsWriter
20 17
21 18
22 def __readShortcut(act, category, prefClass): 19 def __readShortcut(act, category, prefClass):
23 """ 20 """
24 Private function to read a single keyboard shortcut from the settings. 21 Private function to read a single keyboard shortcut from the settings.
194 pm = e5App().getObject("PluginManager") 191 pm = e5App().getObject("PluginManager")
195 pm.initOnDemandPlugins() 192 pm.initOnDemandPlugins()
196 193
197 f = QFile(fn) 194 f = QFile(fn)
198 if f.open(QIODevice.WriteOnly): 195 if f.open(QIODevice.WriteOnly):
196 from E5XML.ShortcutsWriter import ShortcutsWriter
199 ShortcutsWriter(f).writeXML() 197 ShortcutsWriter(f).writeXML()
200 f.close() 198 f.close()
201 else: 199 else:
202 E5MessageBox.critical(None, 200 E5MessageBox.critical(None,
203 QApplication.translate("Shortcuts", "Export Keyboard Shortcuts"), 201 QApplication.translate("Shortcuts", "Export Keyboard Shortcuts"),
216 pm = e5App().getObject("PluginManager") 214 pm = e5App().getObject("PluginManager")
217 pm.initOnDemandPlugins() 215 pm.initOnDemandPlugins()
218 216
219 f = QFile(fn) 217 f = QFile(fn)
220 if f.open(QIODevice.ReadOnly): 218 if f.open(QIODevice.ReadOnly):
219 from E5XML.ShortcutsReader import ShortcutsReader
221 reader = ShortcutsReader(f) 220 reader = ShortcutsReader(f)
222 reader.readXML() 221 reader.readXML()
223 f.close() 222 f.close()
224 if not reader.hasError(): 223 if not reader.hasError():
225 shortcuts = reader.getShortcuts() 224 shortcuts = reader.getShortcuts()

eric ide

mercurial