MicroPythonWidget: added the capability to have menu separators in the downloads sub-menu.

Sat, 20 Feb 2021 14:25:06 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 20 Feb 2021 14:25:06 +0100
changeset 8121
9a2aa5353a32
parent 8120
84928e9f446f
child 8122
eb85ced7844c

MicroPythonWidget: added the capability to have menu separators in the downloads sub-menu.

eric6/MicroPython/MicroPythonWidget.py file | annotate | diff | comparison | revisions
--- a/eric6/MicroPython/MicroPythonWidget.py	Sat Feb 20 14:24:03 2021 +0100
+++ b/eric6/MicroPython/MicroPythonWidget.py	Sat Feb 20 14:25:06 2021 +0100
@@ -1254,10 +1254,13 @@
             if menuEntries:
                 downloadMenu = QMenu(self.tr("Downloads"), self.__superMenu)
                 for text, url in menuEntries:
-                    downloadMenu.addAction(
-                        text,
-                        functools.partial(self.__downloadFromUrl, url)
-                    )
+                    if text == "<separator>":
+                        downloadMenu.addSeparator()
+                    else:
+                        downloadMenu.addAction(
+                            text,
+                            functools.partial(self.__downloadFromUrl, url)
+                        )
             else:
                 downloadMenu = None
         

eric ide

mercurial