eric6/UI/UserInterface.py

branch
jsonfiles
changeset 8019
5fb467ac4233
parent 8011
630a173cb137
child 8047
b5594178c7fa
diff -r 641c7c312f26 -r 5fb467ac4233 eric6/UI/UserInterface.py
--- a/eric6/UI/UserInterface.py	Thu Jan 28 13:19:22 2021 +0100
+++ b/eric6/UI/UserInterface.py	Thu Jan 28 16:35:28 2021 +0100
@@ -6296,7 +6296,8 @@
             None,
             self.tr("Export Keyboard Shortcuts"),
             "",
-            self.tr("Keyboard shortcut file (*.e4k)"),
+            self.tr("Keyboard Shortcuts File (*.ekj);;"
+                    "XML Keyboard Shortcuts File (*.e4k)"),
             "",
             E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
         
@@ -6309,8 +6310,18 @@
             if ex:
                 fn += ex
         
-        from Preferences import Shortcuts
-        Shortcuts.exportShortcuts(fn)
+        if os.path.exists(fn):
+            ok = E5MessageBox.yesNo(
+                self,
+                self.tr("Export Keyboard Shortcuts"),
+                self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists"""
+                        """ already. Overwrite it?</p>""").format(fn))
+        else:
+            ok = True
+        
+        if ok:
+            from Preferences import Shortcuts
+            Shortcuts.exportShortcuts(fn)
 
     def __importShortcuts(self):
         """
@@ -6320,7 +6331,8 @@
             None,
             self.tr("Import Keyboard Shortcuts"),
             "",
-            self.tr("Keyboard shortcut file (*.e4k)"))
+            self.tr("Keyboard Shortcuts File (*.ekj);;"
+                    "XML Keyboard shortcut file (*.e4k)"))
         
         if fn:
             from Preferences import Shortcuts

eric ide

mercurial