eric7/Preferences/Shortcuts.py

branch
eric7
changeset 8351
7d13e08ddb3f
parent 8318
962bce857696
child 8356
68ec9c3d4de5
diff -r 74a3b2a6a944 -r 7d13e08ddb3f eric7/Preferences/Shortcuts.py
--- a/eric7/Preferences/Shortcuts.py	Fri May 21 20:14:48 2021 +0200
+++ b/eric7/Preferences/Shortcuts.py	Sat May 22 11:14:43 2021 +0200
@@ -208,28 +208,9 @@
     pm = e5App().getObject("PluginManager")
     pm.initOnDemandPlugins()
     
-    if fn.endswith(".ekj"):
-        # new JSON based file
-        from .ShortcutsFile import ShortcutsFile
-        shortcutsFile = ShortcutsFile()
-        shortcutsFile.writeFile(fn, helpViewer)
-    else:
-        # old XML based file
-        f = QFile(fn)
-        if f.open(QIODevice.OpenModeFlag.WriteOnly):
-            from E5XML.ShortcutsWriter import ShortcutsWriter
-            ShortcutsWriter(f).writeXML(helpViewer=helpViewer)
-            f.close()
-        else:
-            E5MessageBox.critical(
-                None,
-                QCoreApplication.translate(
-                    "Shortcuts", "Export Keyboard Shortcuts"),
-                QCoreApplication.translate(
-                    "Shortcuts",
-                    "<p>The keyboard shortcuts file <b>{0}</b> could not"
-                    " be written.</p>")
-                .format(fn))
+    from .ShortcutsFile import ShortcutsFile
+    shortcutsFile = ShortcutsFile()
+    shortcutsFile.writeFile(fn, helpViewer)
 
 
 def importShortcuts(fn, helpViewer=None):
@@ -258,7 +239,7 @@
         # old XML based file
         f = QFile(fn)
         if f.open(QIODevice.OpenModeFlag.ReadOnly):
-            from E5XML.ShortcutsReader import ShortcutsReader
+            from EricXML.ShortcutsReader import ShortcutsReader
             reader = ShortcutsReader(f)
             reader.readXML()
             f.close()

eric ide

mercurial