Converted enum names to use all uppercase letters (except for E5PathPickerModes to keep plug-ins using this compatible with previous eric releases).

Tue, 27 Apr 2021 17:25:06 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 27 Apr 2021 17:25:06 +0200
changeset 8265
0090cfa83159
parent 8264
f95dde35d0ab
child 8266
560547c2b6ec

Converted enum names to use all uppercase letters (except for E5PathPickerModes to keep plug-ins using this compatible with previous eric releases).

eric6/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugViewer.py file | annotate | diff | comparison | revisions
eric6/E5Gui/E5PathPicker.py file | annotate | diff | comparison | revisions
eric6/HexEdit/HexEditMainWindow.py file | annotate | diff | comparison | revisions
eric6/HexEdit/HexEditUndoStack.py file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsEnums.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationDialog.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/NetworkPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/NotificationsPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/SecurityPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/ShellPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/WebBrowserAppearancePage.py file | annotate | diff | comparison | revisions
eric6/Preferences/__init__.py file | annotate | diff | comparison | revisions
eric6/Project/Project.py file | annotate | diff | comparison | revisions
eric6/Project/ProjectFormsBrowser.py file | annotate | diff | comparison | revisions
eric6/Project/ProjectInterfacesBrowser.py file | annotate | diff | comparison | revisions
eric6/Project/ProjectProtocolsBrowser.py file | annotate | diff | comparison | revisions
eric6/Project/ProjectResourcesBrowser.py file | annotate | diff | comparison | revisions
eric6/Project/ProjectTranslationsBrowser.py file | annotate | diff | comparison | revisions
eric6/QScintilla/Shell.py file | annotate | diff | comparison | revisions
eric6/QScintilla/ShellWindow.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapWidget.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotDefaultGrabber.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotModes.py file | annotate | diff | comparison | revisions
eric6/Snapshot/SnapshotWaylandGrabber.py file | annotate | diff | comparison | revisions
eric6/Tools/TrayStarter.py file | annotate | diff | comparison | revisions
eric6/UI/FindFileDialog.py file | annotate | diff | comparison | revisions
eric6/UI/NotificationWidget.py file | annotate | diff | comparison | revisions
eric6/UI/PythonDisViewer.py file | annotate | diff | comparison | revisions
eric6/UI/UserInterface.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/Feeds/FeedsDialog.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/GreaseMonkey/GreaseMonkeyAddScriptDialog.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/SafeBrowsing/SafeBrowsingManager.py file | annotate | diff | comparison | revisions
eric6/WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
--- a/eric6/Debugger/DebugUI.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Debugger/DebugUI.py	Tue Apr 27 17:25:06 2021 +0200
@@ -170,7 +170,7 @@
         self.passive = Preferences.getDebugger("PassiveDbgEnabled")
     
     def showNotification(self, notification,
-                         kind=NotificationTypes.Information, timeout=None):
+                         kind=NotificationTypes.INFORMATION, timeout=None):
         """
         Public method to show some notification message.
         
@@ -1145,10 +1145,10 @@
                     os.path.basename(program), status, info)
             if status != 0:
                 timeout = 0
-                kind = NotificationTypes.Warning
+                kind = NotificationTypes.WARNING
             else:
                 timeout = None
-                kind = NotificationTypes.Information
+                kind = NotificationTypes.INFORMATION
             self.ui.showNotification(
                 UI.PixmapCache.getPixmap("debug48"),
                 self.tr("Program terminated"), msg, kind=kind,
--- a/eric6/Debugger/DebugViewer.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Debugger/DebugViewer.py	Tue Apr 27 17:25:06 2021 +0200
@@ -284,7 +284,7 @@
         from UI.PythonDisViewer import PythonDisViewer, PythonDisViewerModes
         # add the Python disassembly viewer
         self.disassemblyViewer = PythonDisViewer(
-            None, mode=PythonDisViewerModes.TracebackMode)
+            None, mode=PythonDisViewerModes.TRACEBACK)
         index = self.__tabWidget.addTab(
             self.disassemblyViewer,
             UI.PixmapCache.getIcon("disassembly"), '')
--- a/eric6/E5Gui/E5PathPicker.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/E5Gui/E5PathPicker.py	Tue Apr 27 17:25:06 2021 +0200
@@ -7,10 +7,9 @@
 Module implementing a path picker widget.
 """
 
+import enum
 import os
 
-from enum import Enum
-
 from PyQt5.QtCore import pyqtSignal, Qt, QFileInfo, QCoreApplication, QDir
 from PyQt5.QtWidgets import QWidget, QHBoxLayout, QToolButton, QSizePolicy
 
@@ -22,10 +21,12 @@
 import UI.PixmapCache
 
 
-class E5PathPickerModes(Enum):
+class E5PathPickerModes(enum.Enum):
     """
     Class implementing the path picker modes.
     """
+    # TODO: convert these to all uppercase without "Mode" when doing
+    #       the port to PyQt6 (i.e. eric7)
     OpenFileMode = 0
     OpenFilesMode = 1
     SaveFileMode = 2
--- a/eric6/HexEdit/HexEditMainWindow.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/HexEdit/HexEditMainWindow.py	Tue Apr 27 17:25:06 2021 +0200
@@ -1381,10 +1381,12 @@
         """
         Private slot to set the preferences.
         """
-        from Preferences.ConfigurationDialog import ConfigurationDialog
+        from Preferences.ConfigurationDialog import (
+            ConfigurationDialog, ConfigurationMode
+        )
         dlg = ConfigurationDialog(
             None, 'Configuration', True, fromEric=True,
-            displayMode=ConfigurationDialog.HexEditorMode)
+            displayMode=ConfigurationMode.HEXEDITORMODE)
         dlg.preferencesChanged.connect(
             self.__preferencesChangedByLocalPreferencesDialog)
         dlg.show()
--- a/eric6/HexEdit/HexEditUndoStack.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/HexEdit/HexEditUndoStack.py	Tue Apr 27 17:25:06 2021 +0200
@@ -7,18 +7,18 @@
 Module implementing the Undo stack for the hex edit widget.
 """
 
-from enum import Enum
+import enum
 
 from PyQt5.QtWidgets import QUndoStack, QUndoCommand
 
 
-class HexEditCommand(Enum):
+class HexEditCommand(enum.Enum):
     """
-    Class implementing the edit comands.
+    Class implementing the edit commands.
     """
-    Insert = 0
-    RemoveAt = 1
-    Overwrite = 2
+    INSERT = 0
+    REMOVEAT = 1
+    OVERWRITE = 2
 
 
 class HexEditUndoCommand(QUndoCommand):
@@ -54,12 +54,12 @@
         """
         Public method to undo the command.
         """
-        if self._cmd == HexEditCommand.Insert:
+        if self._cmd == HexEditCommand.INSERT:
             self.__chunks.removeAt(self._pos)
-        elif self._cmd == HexEditCommand.Overwrite:
+        elif self._cmd == HexEditCommand.OVERWRITE:
             self.__chunks.overwrite(self._pos, self.__oldByte)
             self.__chunks.setDataChanged(self._pos, self.__wasChanged)
-        elif self._cmd == HexEditCommand.RemoveAt:
+        elif self._cmd == HexEditCommand.REMOVEAT:
             self.__chunks.insert(self._pos, self.__oldByte)
             self.__chunks.setDataChanged(self._pos, self.__wasChanged)
     
@@ -67,13 +67,13 @@
         """
         Public method to redo the command.
         """
-        if self._cmd == HexEditCommand.Insert:
+        if self._cmd == HexEditCommand.INSERT:
             self.__chunks.insert(self._pos, self._newByte)
-        elif self._cmd == HexEditCommand.Overwrite:
+        elif self._cmd == HexEditCommand.OVERWRITE:
             self.__oldByte = self.__chunks[self._pos]
             self.__wasChanged = self.__chunks.dataChanged(self._pos)
             self.__chunks.overwrite(self._pos, self._newByte)
-        elif self._cmd == HexEditCommand.RemoveAt:
+        elif self._cmd == HexEditCommand.REMOVEAT:
             self.__oldByte = self.__chunks[self._pos]
             self.__wasChanged = self.__chunks.dataChanged(self._pos)
             self.__chunks.removeAt(self._pos)
@@ -90,8 +90,8 @@
         result = False
         
         if (
-            self._cmd != HexEditCommand.RemoveAt and
-            command._cmd == HexEditCommand.Overwrite and
+            self._cmd != HexEditCommand.REMOVEAT and
+            command._cmd == HexEditCommand.OVERWRITE and
             command._pos == self._pos
         ):
             self._newByte = command._newByte
@@ -138,7 +138,7 @@
         """
         if pos >= 0 and pos <= self.__chunks.size():
             uc = HexEditUndoCommand(
-                self.__chunks, HexEditCommand.Insert, pos, data)
+                self.__chunks, HexEditCommand.INSERT, pos, data)
             self.push(uc)
     
     def insertByteArray(self, pos, byteArray):
@@ -157,7 +157,7 @@
             self.beginMacro(txt)
             for idx in range(len(ba)):
                 uc = HexEditUndoCommand(
-                    self.__chunks, HexEditCommand.Insert, pos + idx, ba[idx])
+                    self.__chunks, HexEditCommand.INSERT, pos + idx, ba[idx])
                 self.push(uc)
             self.endMacro()
     
@@ -173,14 +173,14 @@
         if pos >= 0 and pos <= self.__chunks.size():
             if length == 1:
                 uc = HexEditUndoCommand(
-                    self.__chunks, HexEditCommand.RemoveAt, pos, 0)
+                    self.__chunks, HexEditCommand.REMOVEAT, pos, 0)
                 self.push(uc)
             else:
                 txt = self.tr("Deleting %n byte(s)", "", length)
                 self.beginMacro(txt)
                 for _cnt in range(length):
                     uc = HexEditUndoCommand(
-                        self.__chunks, HexEditCommand.RemoveAt, pos, 0)
+                        self.__chunks, HexEditCommand.REMOVEAT, pos, 0)
                     self.push(uc)
                 self.endMacro()
     
@@ -195,7 +195,7 @@
         """
         if pos >= 0 and pos <= self.__chunks.size():
             uc = HexEditUndoCommand(
-                self.__chunks, HexEditCommand.Overwrite, pos, data)
+                self.__chunks, HexEditCommand.OVERWRITE, pos, data)
             self.push(uc)
     
     def overwriteByteArray(self, pos, length, byteArray):
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsEnums.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsEnums.py	Tue Apr 27 17:25:06 2021 +0200
@@ -11,34 +11,33 @@
 # adapted from flake8-annotations v2.6.2
 #
 
-from enum import Enum, auto
+import enum
 
-
-class FunctionType(Enum):
+class FunctionType(enum.Enum):
     """
     Class representing the various function types.
     """
-    PUBLIC = auto()
-    PROTECTED = auto()      # Leading single underscore
-    PRIVATE = auto()        # Leading double underscore
-    SPECIAL = auto()        # Leading & trailing double underscore
+    PUBLIC = enum.auto()
+    PROTECTED = enum.auto()      # Leading single underscore
+    PRIVATE = enum.auto()        # Leading double underscore
+    SPECIAL = enum.auto()        # Leading & trailing double underscore
 
 
-class ClassDecoratorType(Enum):
+class ClassDecoratorType(enum.Enum):
     """
     Class representing the various class method decorators.
     """
-    CLASSMETHOD = auto()
-    STATICMETHOD = auto()
+    CLASSMETHOD = enum.auto()
+    STATICMETHOD = enum.auto()
 
 
-class AnnotationType(Enum):
+class AnnotationType(enum.Enum):
     """
     Class representing the kind of missing type annotation.
     """
-    POSONLYARGS = auto()
-    ARGS = auto()
-    VARARG = auto()
-    KWONLYARGS = auto()
-    KWARG = auto()
-    RETURN = auto()
+    POSONLYARGS = enum.auto()
+    ARGS = enum.auto()
+    VARARG = enum.auto()
+    KWONLYARGS = enum.auto()
+    KWARG = enum.auto()
+    RETURN = enum.auto()
--- a/eric6/Preferences/ConfigurationDialog.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Preferences/ConfigurationDialog.py	Tue Apr 27 17:25:06 2021 +0200
@@ -7,9 +7,10 @@
 Module implementing a dialog for the configuration of eric.
 """
 
+import contextlib
+import enum
 import os
 import types
-import contextlib
 
 from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QMetaObject, QRect
 from PyQt5.QtGui import QPixmap
@@ -61,6 +62,16 @@
         return self.__pageName
 
 
+class ConfigurationMode(enum.Enum):
+    """
+    Class defining the various modes of the configuration widget.
+    """
+    DEFAULTMODE = 0
+    TRAYSTARTERMODE = 1
+    HEXEDITORMODE = 2
+    WEBBROWSERMODE = 3
+
+
 class ConfigurationWidget(QWidget):
     """
     Class implementing a dialog for the configuration of eric.
@@ -76,36 +87,24 @@
     accepted = pyqtSignal()
     rejected = pyqtSignal()
     
-    # TODO: convert this to 'enum'
-    DefaultMode = 0
-    TrayStarterMode = 1
-    HexEditorMode = 2
-    WebBrowserMode = 3
-    
-    def __init__(self, parent=None, fromEric=True, displayMode=DefaultMode,
+    def __init__(self, parent=None, fromEric=True,
+                 displayMode=ConfigurationMode.DEFAULTMODE,
                  expandedEntries=None):
         """
         Constructor
         
-        @param parent The parent widget of this dialog. (QWidget)
+        @param parent reference to the parent widget
+        @type QWidget
         @param fromEric flag indicating a dialog generation from within the
-            eric ide (boolean)
+            eric IDE
+        @type bool
         @param displayMode mode of the configuration dialog
-            (DefaultMode, TrayStarterMode, HexEditorMode, WebBrowserMode)
-        @exception RuntimeError raised to indicate an invalid dialog mode
+        @type ConfigurationMode
         @param expandedEntries list of entries to be shown expanded
-            (list of strings)
+        @type list of str
         """
         super().__init__(parent)
         
-        if displayMode not in (
-            ConfigurationWidget.DefaultMode,
-            ConfigurationWidget.WebBrowserMode,
-            ConfigurationWidget.TrayStarterMode,
-            ConfigurationWidget.HexEditorMode,
-        ):
-            raise RuntimeError("Illegal mode value: {0}".format(displayMode))
-        
         self.fromEric = fromEric
         self.displayMode = displayMode
         self.__webEngine = getWebBrowserSupport() == "QtWebEngine"
@@ -131,7 +130,7 @@
                 e5App().registerObject("VirtualEnvManager",
                                        self.virtualenvManager)
         
-        if displayMode == ConfigurationWidget.DefaultMode:
+        if displayMode == ConfigurationMode.DEFAULTMODE:
             self.configItems = {
                 # key : [display string, pixmap name, dialog module name or
                 #        page creation function, parent key,
@@ -368,7 +367,7 @@
             self.configItems.update(
                 e5App().getObject("PluginManager").getPluginConfigData())
         
-        elif displayMode == ConfigurationWidget.WebBrowserMode:
+        elif displayMode == ConfigurationMode.WEBBROWSERMODE:
             self.configItems = {
                 # key : [display string, pixmap name, dialog module name or
                 #        page creation function, parent key,
@@ -411,7 +410,7 @@
                  "WebBrowserSpellCheckingPage", None, None],
             }
         
-        elif displayMode == ConfigurationWidget.TrayStarterMode:
+        elif displayMode == ConfigurationMode.TRAYSTARTERMODE:
             self.configItems = {
                 # key : [display string, pixmap name, dialog module name or
                 #        page creation function, parent key,
@@ -424,7 +423,7 @@
                  "TrayStarterPage", None, None],
             }
         
-        elif displayMode == ConfigurationWidget.HexEditorMode:
+        elif displayMode == ConfigurationMode.HEXEDITORMODE:
             self.configItems = {
                 # key : [display string, pixmap name, dialog module name or
                 #        page creation function, parent key,
@@ -451,9 +450,11 @@
             self.itmDict[key] = ConfigurationPageItem(pitm, pageData[0], key,
                                                       pageData[1])
             self.itmDict[key].setData(0, Qt.ItemDataRole.UserRole, key)
-            if (not self.fromEric or
-                displayMode != ConfigurationWidget.DefaultMode or
-                    key in expandedEntries):
+            if (
+                not self.fromEric or
+                displayMode != ConfigurationMode.DEFAULTMODE or
+                key in expandedEntries
+            ):
                 self.itmDict[key].setExpanded(True)
         self.configList.sortByColumn(0, Qt.SortOrder.AscendingOrder)
         
@@ -466,13 +467,13 @@
         self.buttonBox.accepted.connect(self.accept)
         self.buttonBox.rejected.connect(self.rejected)
         
-        if displayMode in [ConfigurationWidget.TrayStarterMode,
-                           ConfigurationWidget.HexEditorMode,
-                           ConfigurationWidget.WebBrowserMode]:
+        if displayMode in [ConfigurationMode.TRAYSTARTERMODE,
+                           ConfigurationMode.HEXEDITORMODE,
+                           ConfigurationMode.WEBBROWSERMODE]:
             self.configListSearch.hide()
         
-        if displayMode not in [ConfigurationWidget.TrayStarterMode,
-                               ConfigurationWidget.HexEditorMode]:
+        if displayMode not in [ConfigurationMode.TRAYSTARTERMODE,
+                               ConfigurationMode.HEXEDITORMODE]:
             self.__initLexers()
         
     def accept(self):
@@ -571,7 +572,7 @@
         self.buttonBox.setObjectName("buttonBox")
         if (
             not self.fromEric and
-            self.displayMode == ConfigurationWidget.DefaultMode
+            self.displayMode == ConfigurationMode.DEFAULTMODE
         ):
             self.buttonBox.button(QDialogButtonBox.StandardButton.Apply).hide()
         self.buttonBox.button(
@@ -904,7 +905,7 @@
         """
         return (
             self.__webEngine or
-            self.displayMode == ConfigurationWidget.WebBrowserMode
+            self.displayMode == ConfigurationMode.WEBBROWSERMODE
         )
 
 
@@ -919,26 +920,26 @@
     preferencesChanged = pyqtSignal()
     masterPasswordChanged = pyqtSignal(str, str)
     
-    DefaultMode = ConfigurationWidget.DefaultMode
-    TrayStarterMode = ConfigurationWidget.TrayStarterMode
-    HexEditorMode = ConfigurationWidget.HexEditorMode
-    WebBrowserMode = ConfigurationWidget.WebBrowserMode
-    
     def __init__(self, parent=None, name=None, modal=False,
-                 fromEric=True, displayMode=ConfigurationWidget.DefaultMode,
+                 fromEric=True,
+                 displayMode=ConfigurationMode.DEFAULTMODE,
                  expandedEntries=None):
         """
         Constructor
         
-        @param parent The parent widget of this dialog. (QWidget)
-        @param name The name of this dialog. string
-        @param modal Flag indicating a modal dialog. (boolean)
+        @param parent reference to the parent widget
+        @type QWidget
+        @param name name of the dialog
+        @type str
+        @param modal flag indicating a modal dialog
+        @type bool
         @param fromEric flag indicating a dialog generation from within the
-            eric ide (boolean)
+            eric IDE
+        @type bool
         @param displayMode mode of the configuration dialog
-            (DefaultMode, TrayStarterMode, HexEditorMode, WebBrowserMode)
+        @type ConfigurationMode
         @param expandedEntries list of entries to be shown expanded
-            (list of strings)
+        @type list of str
         """
         super().__init__(parent)
         if name:
--- a/eric6/Preferences/ConfigurationPages/NetworkPage.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Preferences/ConfigurationPages/NetworkPage.py	Tue Apr 27 17:25:06 2021 +0200
@@ -110,13 +110,13 @@
         Public method to perform mode dependent setups.
         
         @param displayMode mode of the configuration dialog
-            (ConfigurationWidget.DefaultMode,
-             ConfigurationWidget.WebBrowserMode)
+            (ConfigurationMode.DEFAULTMODE,
+             ConfigurationMode.WEBBROWSERMODE)
         """
-        from ..ConfigurationDialog import ConfigurationWidget
+        from ..ConfigurationDialog import ConfigurationMode
         if displayMode in (
-            ConfigurationWidget.DefaultMode,
-            ConfigurationWidget.WebBrowserMode
+            ConfigurationMode.DEFAULTMODE,
+            ConfigurationMode.WEBBROWSERMODE
         ):
             self.__displayMode = displayMode
             if not self.__configDlg.isUsingWebEngine():
--- a/eric6/Preferences/ConfigurationPages/NotificationsPage.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Preferences/ConfigurationPages/NotificationsPage.py	Tue Apr 27 17:25:06 2021 +0200
@@ -38,9 +38,9 @@
         self.ySpinBox.setMaximum(geom.height())
         
         self.warningIcon.setPixmap(
-            NotificationFrame.getIcon(NotificationTypes.Warning))
+            NotificationFrame.getIcon(NotificationTypes.WARNING))
         self.criticalIcon.setPixmap(
-            NotificationFrame.getIcon(NotificationTypes.Critical))
+            NotificationFrame.getIcon(NotificationTypes.CRITICAL))
         
         self.__notification = None
         self.__firstTime = True
@@ -100,7 +100,7 @@
             self.__notification = NotificationWidget(
                 parent=self, setPosition=True)
             self.__notification.showNotification(
-                NotificationFrame.getIcon(NotificationTypes.Other),
+                NotificationFrame.getIcon(NotificationTypes.OTHER),
                 self.tr("Visual Selection"),
                 self.tr("Drag the notification window to"
                         " the desired place and release the button."),
--- a/eric6/Preferences/ConfigurationPages/SecurityPage.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Preferences/ConfigurationPages/SecurityPage.py	Tue Apr 27 17:25:06 2021 +0200
@@ -53,18 +53,18 @@
         Public method to perform mode dependent setups.
         
         @param displayMode mode of the configuration dialog
-            (ConfigurationWidget.DefaultMode,
-             ConfigurationWidget.WebBrowserMode)
+            (ConfigurationMode.DEFAULTMODE,
+             ConfigurationMode.WEBBROWSERMODE)
         """
-        from ..ConfigurationDialog import ConfigurationWidget
+        from ..ConfigurationDialog import ConfigurationMode
         if displayMode in (
-            ConfigurationWidget.DefaultMode,
-            ConfigurationWidget.WebBrowserMode
+            ConfigurationMode.DEFAULTMODE,
+            ConfigurationMode.WEBBROWSERMODE
         ):
             self.__displayMode = displayMode
             
             self.certificateErrorsGroup.setVisible(
-                displayMode == ConfigurationWidget.WebBrowserMode
+                displayMode == ConfigurationMode.WEBBROWSERMODE
             )
     
     def save(self):
--- a/eric6/Preferences/ConfigurationPages/ShellPage.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Preferences/ConfigurationPages/ShellPage.py	Tue Apr 27 17:25:06 2021 +0200
@@ -36,11 +36,11 @@
         self.setObjectName("ShellPage")
         
         self.shellHistoryStyleComboBox.addItem(
-            self.tr("Disabled"), ShellHistoryStyle.Disabled.value)
+            self.tr("Disabled"), ShellHistoryStyle.DISABLED.value)
         self.shellHistoryStyleComboBox.addItem(
-            self.tr("Linux Style"), ShellHistoryStyle.LinuxStyle.value)
+            self.tr("Linux Style"), ShellHistoryStyle.LINUXSTYLE.value)
         self.shellHistoryStyleComboBox.addItem(
-            self.tr("Windows Style"), ShellHistoryStyle.WindowsStyle.value)
+            self.tr("Windows Style"), ShellHistoryStyle.WINDOWSSTYLE.value)
         
         # set initial values
         self.shellLinenoCheckBox.setChecked(
--- a/eric6/Preferences/ConfigurationPages/WebBrowserAppearancePage.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Preferences/ConfigurationPages/WebBrowserAppearancePage.py	Tue Apr 27 17:25:06 2021 +0200
@@ -106,13 +106,13 @@
         Public method to perform mode dependent setups.
         
         @param displayMode mode of the configuration dialog
-            (ConfigurationWidget.DefaultMode,
-             ConfigurationWidget.TrayStarterMode)
+            (ConfigurationMode.DEFAULTMODE,
+             ConfigurationMode.WEBBROWSERMODE)
         """
-        from ..ConfigurationDialog import ConfigurationWidget
+        from ..ConfigurationDialog import ConfigurationMode
         if displayMode in (
-            ConfigurationWidget.DefaultMode,
-            ConfigurationWidget.WebBrowserMode,
+            ConfigurationMode.DEFAULTMODE,
+            ConfigurationMode.WEBBROWSERMODE,
         ):
             self.__displayMode = displayMode
     
--- a/eric6/Preferences/__init__.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Preferences/__init__.py	Tue Apr 27 17:25:06 2021 +0200
@@ -1174,7 +1174,7 @@
         "CallTipsEnabled": True,
         "WrapEnabled": True,
         "MaxHistoryEntries": 100,
-        "HistoryStyle": ShellHistoryStyle.LinuxStyle,
+        "HistoryStyle": ShellHistoryStyle.LINUXSTYLE,
         "HistoryWrap": False,
         "HistoryNavigateByCursor": False,
         "SyntaxHighlightingEnabled": True,
--- a/eric6/Project/Project.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Project/Project.py	Tue Apr 27 17:25:06 2021 +0200
@@ -5486,7 +5486,7 @@
                 self.tr("Create Plugin Archive"),
                 self.tr("<p>The eric plugin archive files were "
                         "created with some errors.</p>"),
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
         else:
             self.ui.showNotification(
@@ -5757,7 +5757,7 @@
                     UI.PixmapCache.getPixmap("makefile48"),
                     title,
                     message,
-                    kind=NotificationTypes.Warning,
+                    kind=NotificationTypes.WARNING,
                     timeout=0)
             elif exitCode > 1:
                 E5MessageBox.critical(
--- a/eric6/Project/ProjectFormsBrowser.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Project/ProjectFormsBrowser.py	Tue Apr 27 17:25:06 2021 +0200
@@ -774,14 +774,14 @@
                     self.tr(
                         "<p>The compilation of the form file failed.</p>"
                         "<p>Reason: {0}</p>").format(str(msg)),
-                    kind=NotificationTypes.Critical,
+                    kind=NotificationTypes.CRITICAL,
                     timeout=0)
         else:
             ui.showNotification(
                 UI.PixmapCache.getPixmap("designer48"),
                 self.tr("Form Compilation"),
                 self.tr("The compilation of the form file failed."),
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
         self.compileProc = None
         
--- a/eric6/Project/ProjectInterfacesBrowser.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Project/ProjectInterfacesBrowser.py	Tue Apr 27 17:25:06 2021 +0200
@@ -536,7 +536,7 @@
                 self.tr("Interface Compilation"),
                 self.tr(
                     "The compilation of the interface file failed."),
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
         self.compileProc = None
         
--- a/eric6/Project/ProjectProtocolsBrowser.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Project/ProjectProtocolsBrowser.py	Tue Apr 27 17:25:06 2021 +0200
@@ -567,7 +567,7 @@
                 self.tr("Protocol Compilation"),
                 self.tr(
                     "The compilation of the protocol file failed."),
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
         self.compileProc = None
         
--- a/eric6/Project/ProjectResourcesBrowser.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Project/ProjectResourcesBrowser.py	Tue Apr 27 17:25:06 2021 +0200
@@ -625,7 +625,7 @@
                 self.tr("Resource Compilation"),
                 self.tr(
                     "The compilation of the resource file failed."),
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
         self.compileProc = None
         
--- a/eric6/Project/ProjectTranslationsBrowser.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Project/ProjectTranslationsBrowser.py	Tue Apr 27 17:25:06 2021 +0200
@@ -955,7 +955,7 @@
                 self.tr(
                     "The generation of the translation files (*.ts) has"
                     " failed.{0}").format(info),
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
         
         for index in range(len(self.__pylupdateProcesses)):
@@ -1203,7 +1203,7 @@
                 self.tr("Translation file release"),
                 self.tr(
                     "The release of the translation files (*.qm) has failed."),
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
         
         for index in range(len(self.__lreleaseProcesses)):
--- a/eric6/QScintilla/Shell.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/QScintilla/Shell.py	Tue Apr 27 17:25:06 2021 +0200
@@ -10,8 +10,7 @@
 import sys
 import re
 import contextlib
-
-from enum import Enum
+import enum
 
 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QFileInfo, Qt, QEvent
 from PyQt5.QtGui import QClipboard, QPalette, QFont
@@ -93,13 +92,13 @@
         return self.__shell
 
 
-class ShellHistoryStyle(Enum):
+class ShellHistoryStyle(enum.Enum):
     """
     Class defining the shell history styles.
     """
-    Disabled = 0
-    LinuxStyle = 1
-    WindowsStyle = 2
+    DISABLED = 0
+    LINUXSTYLE = 1
+    WINDOWSSTYLE = 2
 
 
 class Shell(QsciScintillaCompat):
@@ -243,7 +242,8 @@
         dbs.mainClientExit.connect(self.__writePrompt)
         self.dbs = dbs
         
-        self.__debugUI = None
+        # will register a method to get the debugger ID to work with
+        self.__getSelectedDebuggerId = None
         
         # Make sure we have prompts.
         if self.passive:
@@ -612,7 +612,17 @@
         @param ui reference to the debugger UI object (DebugUI)
         """
         ui.exceptionInterrupt.connect(self.__writePrompt)
-        self.__debugUI = ui
+        self.registerDebuggerIdMethod(ui.getSelectedDebuggerId)
+    
+    def registerDebuggerIdMethod(self, method):
+        """
+        Public method to register a method to get the debugger ID to send data
+        to.
+        
+        @param method reference to the method
+        @type function
+        """
+        self.__getSelectedDebuggerId = method
         
     def __initialise(self):
         """
@@ -673,7 +683,7 @@
             # determine based on history style
             if (
                 self.clientType and
-                self.__historyStyle == ShellHistoryStyle.WindowsStyle
+                self.__historyStyle == ShellHistoryStyle.WINDOWSSTYLE
             ):
                 idx = int(Preferences.Prefs.settings.value(
                     "Shell/HistoryIndexes/" + self.clientType, -1))
@@ -688,7 +698,7 @@
                 self.__histidx = -1
             if (
                 self.clientType and
-                self.__historyStyle == ShellHistoryStyle.WindowsStyle
+                self.__historyStyle == ShellHistoryStyle.WINDOWSSTYLE
             ):
                 Preferences.Prefs.settings.setValue(
                     "Shell/HistoryIndexes/" + self.clientType, self.__histidx)
@@ -1338,7 +1348,7 @@
                 self.incrementalSearchActive = True
                 if ac and self.racEnabled:
                     self.dbs.remoteCompletion(
-                        self.__debugUI.getSelectedDebuggerId(),
+                        self.__getSelectedDebuggerId(),
                         self.completionText + txt
                     )
             else:
@@ -1373,7 +1383,7 @@
                 self.SendScintilla(cmd)
             elif self.racEnabled:
                 self.dbs.remoteCompletion(
-                    self.__debugUI.getSelectedDebuggerId(),
+                    self.__getSelectedDebuggerId(),
                     buf
                 )
         
@@ -1404,7 +1414,7 @@
             if db and ac and self.racEnabled and self.completionText:
                 delta = len(self.text(line)) - oldLength
                 self.dbs.remoteCompletion(
-                    self.__debugUI.getSelectedDebuggerId(),
+                    self.__getSelectedDebuggerId(),
                     self.completionText[:delta]
                 )
         
@@ -1797,9 +1807,9 @@
                     if len(self.__history) == self.__maxHistoryEntries:
                         del self.__history[0]
                     self.__history.append(cmd)
-                if self.__historyStyle == ShellHistoryStyle.LinuxStyle:
+                if self.__historyStyle == ShellHistoryStyle.LINUXSTYLE:
                     self.__setHistoryIndex(index=-1)
-                elif self.__historyStyle == ShellHistoryStyle.WindowsStyle:
+                elif self.__historyStyle == ShellHistoryStyle.WINDOWSSTYLE:
                     if historyIndex is None:
                         if (
                             self.__histidx - 1 > 0 and
@@ -1887,7 +1897,7 @@
                     return
             else:
                 self.dbs.remoteStatement(
-                    self.__debugUI.getSelectedDebuggerId(), cmd)
+                    self.__getSelectedDebuggerId(), cmd)
                 while self.inCommandExecution:
                     with contextlib.suppress(KeyboardInterrupt):
                         QApplication.processEvents()
@@ -2364,7 +2374,7 @@
         @return flag indicating if history is enabled
         @rtype bool
         """
-        return self.__historyStyle != ShellHistoryStyle.Disabled
+        return self.__historyStyle != ShellHistoryStyle.DISABLED
     
     #################################################################
     ## Project Support
--- a/eric6/QScintilla/ShellWindow.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/QScintilla/ShellWindow.py	Tue Apr 27 17:25:06 2021 +0200
@@ -65,6 +65,8 @@
         self.setStyle(Preferences.getUI("Style"),
                       Preferences.getUI("StyleSheet"))
         
+        self.__lastDebuggerId = ""
+        
         # initialize the APIs manager
         self.__apisManager = APIsManager(parent=self)
         
@@ -72,7 +74,11 @@
         self.__debugServer = DebugServer(originalPathString,
                                          preventPassiveDebugging=True,
                                          parent=self)
+        self.__debugServer.clientDebuggerId.connect(self.__clientDebuggerId)
+        
         self.__shell = Shell(self.__debugServer, self, None, True, self)
+        self.__shell.registerDebuggerIdMethod(self.getDebuggerId)
+        
         self.__searchWidget = SearchWidget(self.__shell, self, showLine=True)
         
         centralWidget = QWidget()
@@ -132,6 +138,24 @@
         
         event.accept()
     
+    def __clientDebuggerId(self, debuggerId):
+        """
+        Private slot to receive the ID of a newly connected debugger backend.
+        
+        @param debuggerId ID of a newly connected debugger backend
+        @type str
+        """
+        self.__lastDebuggerId = debuggerId
+    
+    def getDebuggerId(self):
+        """
+        Public method to get the most recently registered debugger ID.
+        
+        @return debugger ID
+        @rtype str
+        """
+        return self.__lastDebuggerId
+    
     ##################################################################
     ## Below are API handling methods
     ##################################################################
--- a/eric6/Snapshot/SnapWidget.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Snapshot/SnapWidget.py	Tue Apr 27 17:25:06 2021 +0200
@@ -63,27 +63,27 @@
         self.__grabber.grabbed.connect(self.__captured)
         supportedModes = self.__grabber.supportedModes()
         
-        if SnapshotModes.Fullscreen in supportedModes:
+        if SnapshotModes.FULLSCREEN in supportedModes:
             self.modeCombo.addItem(self.tr("Fullscreen"),
-                                   SnapshotModes.Fullscreen)
+                                   SnapshotModes.FULLSCREEN)
         if (
-            SnapshotModes.SelectedScreen in supportedModes and
+            SnapshotModes.SELECTEDSCREEN in supportedModes and
             len(QApplication.screens()) > 1
         ):
             self.modeCombo.addItem(self.tr("Select Screen"),
-                                   SnapshotModes.SelectedScreen)
-        if SnapshotModes.SelectedWindow in supportedModes:
+                                   SnapshotModes.SELECTEDSCREEN)
+        if SnapshotModes.SELECTEDWINDOW in supportedModes:
             self.modeCombo.addItem(self.tr("Select Window"),
-                                   SnapshotModes.SelectedWindow)
-        if SnapshotModes.Rectangle in supportedModes:
+                                   SnapshotModes.SELECTEDWINDOW)
+        if SnapshotModes.RECTANGLE in supportedModes:
             self.modeCombo.addItem(self.tr("Rectangular Selection"),
-                                   SnapshotModes.Rectangle)
-        if SnapshotModes.Ellipse in supportedModes:
+                                   SnapshotModes.RECTANGLE)
+        if SnapshotModes.ELLIPSE in supportedModes:
             self.modeCombo.addItem(self.tr("Elliptical Selection"),
-                                   SnapshotModes.Ellipse)
-        if SnapshotModes.Freehand in supportedModes:
+                                   SnapshotModes.ELLIPSE)
+        if SnapshotModes.FREEHAND in supportedModes:
             self.modeCombo.addItem(self.tr("Freehand Selection"),
-                                   SnapshotModes.Freehand)
+                                   SnapshotModes.FREEHAND)
         mode = int(Preferences.Prefs.settings.value("Snapshot/Mode", 0))
         index = self.modeCombo.findData(SnapshotModes(mode))
         if index == -1:
@@ -435,7 +435,7 @@
         isWindowMode = False
         if index >= 0:
             mode = self.modeCombo.itemData(index)
-            isWindowMode = (mode == SnapshotModes.SelectedWindow)
+            isWindowMode = (mode == SnapshotModes.SELECTEDWINDOW)
         
         self.decorationsCheckBox.setEnabled(isWindowMode)
         self.decorationsCheckBox.setChecked(isWindowMode)
--- a/eric6/Snapshot/SnapshotDefaultGrabber.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Snapshot/SnapshotDefaultGrabber.py	Tue Apr 27 17:25:06 2021 +0200
@@ -51,11 +51,11 @@
         @rtype tuple of SnapshotModes
         """
         return (
-            SnapshotModes.Fullscreen,
-            SnapshotModes.SelectedScreen,
-            SnapshotModes.Rectangle,
-            SnapshotModes.Freehand,
-            SnapshotModes.Ellipse,
+            SnapshotModes.FULLSCREEN,
+            SnapshotModes.SELECTEDSCREEN,
+            SnapshotModes.RECTANGLE,
+            SnapshotModes.FREEHAND,
+            SnapshotModes.ELLIPSE,
         )
     
     def grab(self, mode, delay=0, captureCursor=False,
@@ -84,11 +84,11 @@
         """
         Private slot to perform a delayed grab operation.
         """
-        if self.__mode == SnapshotModes.Rectangle:
+        if self.__mode == SnapshotModes.RECTANGLE:
             self.__grabRectangle()
-        elif self.__mode == SnapshotModes.Ellipse:
+        elif self.__mode == SnapshotModes.ELLIPSE:
             self.__grabEllipse()
-        elif self.__mode == SnapshotModes.Freehand:
+        elif self.__mode == SnapshotModes.FREEHAND:
             self.__grabFreehand()
         else:
             self.__performGrab(self.__mode)
@@ -97,11 +97,11 @@
         """
         Private slot to perform an undelayed grab operation.
         """
-        if self.__mode == SnapshotModes.Rectangle:
+        if self.__mode == SnapshotModes.RECTANGLE:
             self.__grabRectangle()
-        elif self.__mode == SnapshotModes.Ellipse:
+        elif self.__mode == SnapshotModes.ELLIPSE:
             self.__grabEllipse()
-        elif self.__mode == SnapshotModes.Freehand:
+        elif self.__mode == SnapshotModes.FREEHAND:
             self.__grabFreehand()
         else:
             if Globals.isMacPlatform():
@@ -147,12 +147,12 @@
         self.__grabberWidget.hide()
         self.__grabTimer.stop()
         
-        if mode == SnapshotModes.Fullscreen:
+        if mode == SnapshotModes.FULLSCREEN:
             screen = QGuiApplication.screens()[0]
             vgeom = screen.availableVirtualGeometry()
             snapshot = screen.grabWindow(
                 0, vgeom.x(), vgeom.y(), vgeom.width(), vgeom.height())
-        elif mode == SnapshotModes.SelectedScreen:
+        elif mode == SnapshotModes.SELECTEDSCREEN:
             screen = QGuiApplication.screenAt(QCursor.pos())
             sgeom = screen.geometry()
             if Globals.isMacPlatform():
--- a/eric6/Snapshot/SnapshotModes.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Snapshot/SnapshotModes.py	Tue Apr 27 17:25:06 2021 +0200
@@ -7,16 +7,16 @@
 Module implementing the snapshot mode enumeration.
 """
 
-from enum import Enum
+import enum
 
 
-class SnapshotModes(Enum):
+class SnapshotModes(enum.Enum):
     """
     Class implementing the snapshot modes.
     """
-    Fullscreen = 0
-    SelectedScreen = 1
-    Rectangle = 2
-    Freehand = 3
-    Ellipse = 4
-    SelectedWindow = 5
+    FULLSCREEN = 0
+    SELECTEDSCREEN = 1
+    RECTANGLE = 2
+    FREEHAND = 3
+    ELLIPSE = 4
+    SELECTEDWINDOW = 5
--- a/eric6/Snapshot/SnapshotWaylandGrabber.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Snapshot/SnapshotWaylandGrabber.py	Tue Apr 27 17:25:06 2021 +0200
@@ -59,16 +59,16 @@
         if DBusAvailable and Globals.isKdeDesktop():
             # __IGNORE_WARNING_Y114__
             return (
-                SnapshotModes.Fullscreen,
-                SnapshotModes.SelectedScreen,
-                SnapshotModes.SelectedWindow,
+                SnapshotModes.FULLSCREEN,
+                SnapshotModes.SELECTEDSCREEN,
+                SnapshotModes.SELECTEDWINDOW,
             )
         elif DBusAvailable and Globals.isGnomeDesktop():
             return (
-                SnapshotModes.Fullscreen,
-                SnapshotModes.SelectedScreen,
-                SnapshotModes.SelectedWindow,
-                SnapshotModes.Rectangle,
+                SnapshotModes.FULLSCREEN,
+                SnapshotModes.SELECTEDSCREEN,
+                SnapshotModes.SELECTEDWINDOW,
+                SnapshotModes.RECTANGLE,
             )
         else:
             return ()
@@ -85,7 +85,7 @@
         @param captureCursor flag indicating to include the mouse cursor
         @type bool
         @param captureDecorations flag indicating to include the window
-            decorations (only used for mode SnapshotModes.SelectedWindow)
+            decorations (only used for mode SnapshotModes.SELECTEDWINDOW)
         @type bool
         """
         if not DBusAvailable:
@@ -108,16 +108,16 @@
         @exception RuntimeError raised to indicate an unsupported grab mode
         """
         if self.__mode not in (
-            SnapshotModes.Fullscreen, SnapshotModes.SelectedScreen,
-            SnapshotModes.SelectedWindow, SnapshotModes.Rectangle,
+            SnapshotModes.FULLSCREEN, SnapshotModes.SELECTEDSCREEN,
+            SnapshotModes.SELECTEDWINDOW, SnapshotModes.RECTANGLE,
         ):
             raise RuntimeError("unsupported grab mode given")
         
-        if self.__mode == SnapshotModes.Fullscreen:
+        if self.__mode == SnapshotModes.FULLSCREEN:
             self.__grabFullscreen()
-        elif self.__mode == SnapshotModes.SelectedScreen:
+        elif self.__mode == SnapshotModes.SELECTEDSCREEN:
             self.__grabSelectedScreen()
-        elif self.__mode == SnapshotModes.SelectedWindow:
+        elif self.__mode == SnapshotModes.SELECTEDWINDOW:
             self.__grabSelectedWindow()
         else:
             self.__grabRectangle()
--- a/eric6/Tools/TrayStarter.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/Tools/TrayStarter.py	Tue Apr 27 17:25:06 2021 +0200
@@ -486,10 +486,12 @@
         """
         Private slot to set the preferences.
         """
-        from Preferences.ConfigurationDialog import ConfigurationDialog
+        from Preferences.ConfigurationDialog import (
+            ConfigurationDialog, ConfigurationMode
+        )
         dlg = ConfigurationDialog(
             None, 'Configuration', True, fromEric=True,
-            displayMode=ConfigurationDialog.TrayStarterMode)
+            displayMode=ConfigurationMode.TRAYSTARTERMODE)
         dlg.preferencesChanged.connect(self.preferencesChanged)
         dlg.show()
         dlg.showConfigurationPageByName("trayStarterPage")
--- a/eric6/UI/FindFileDialog.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/UI/FindFileDialog.py	Tue Apr 27 17:25:06 2021 +0200
@@ -737,7 +737,7 @@
                         .format(fn, str(err))
                     )
             
-            self.findProgress.setValue(index)
+            self.findProgress.setValue(index + 1)
         
         self.findProgressLabel.setPath("")
         
--- a/eric6/UI/NotificationWidget.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/UI/NotificationWidget.py	Tue Apr 27 17:25:06 2021 +0200
@@ -7,8 +7,8 @@
 Module implementing a Notification widget.
 """
 
-from enum import Enum
 import contextlib
+import enum
 
 from PyQt5.QtCore import Qt, QTimer, QPoint
 from PyQt5.QtWidgets import QFrame, QWidget, QVBoxLayout
@@ -20,14 +20,14 @@
 import UI.PixmapCache
 
 
-class NotificationTypes(Enum):
+class NotificationTypes(enum.Enum):
     """
     Class implementing the notification types.
     """
-    Information = 0
-    Warning = 1             # __IGNORE_WARNING_M131__
-    Critical = 2
-    Other = 99
+    INFORMATION = 0
+    WARNING = 1
+    CRITICAL = 2
+    OTHER = 99
 
 
 class NotificationFrame(QFrame, Ui_NotificationFrame):
@@ -37,7 +37,7 @@
     NotificationStyleSheetTemplate = "color:{0};background-color:{1};"
     
     def __init__(self, icon, heading, text,
-                 kind=NotificationTypes.Information, parent=None):
+                 kind=NotificationTypes.INFORMATION, parent=None):
         """
         Constructor
         
@@ -82,11 +82,11 @@
         @return icon for the notification kind
         @rtype QPixmap
         """
-        if kind == NotificationTypes.Critical:
+        if kind == NotificationTypes.CRITICAL:
             return UI.PixmapCache.getPixmap("notificationCritical48")
-        elif kind == NotificationTypes.Warning:
+        elif kind == NotificationTypes.WARNING:                 # __NO-TASK__
             return UI.PixmapCache.getPixmap("notificationWarning48")
-        elif kind == NotificationTypes.Information:
+        elif kind == NotificationTypes.INFORMATION:
             return UI.PixmapCache.getPixmap("notificationInformation48")
         else:
             return UI.PixmapCache.getPixmap("notification48")
@@ -101,12 +101,12 @@
         @return string containing the style sheet for the notification kind
         @rtype str
         """
-        if kind == NotificationTypes.Critical:
+        if kind == NotificationTypes.CRITICAL:
             return NotificationFrame.NotificationStyleSheetTemplate.format(
                 Preferences.getUI("NotificationCriticalForeground"),
                 Preferences.getUI("NotificationCriticalBackground")
             )
-        elif kind == NotificationTypes.Warning:
+        elif kind == NotificationTypes.WARNING:                 # __NO-TASK__
             return NotificationFrame.NotificationStyleSheetTemplate.format(
                 Preferences.getUI("NotificationWarningForeground"),
                 Preferences.getUI("NotificationWarningBackground")
@@ -156,7 +156,7 @@
             self.setCursor(Qt.CursorShape.OpenHandCursor)
     
     def showNotification(self, icon, heading, text,
-                         kind=NotificationTypes.Information, timeout=0):
+                         kind=NotificationTypes.INFORMATION, timeout=0):
         """
         Public method to show a notification.
         
--- a/eric6/UI/PythonDisViewer.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/UI/PythonDisViewer.py	Tue Apr 27 17:25:06 2021 +0200
@@ -32,8 +32,8 @@
     """
     Class implementing the disassembly viewer operation modes.
     """
-    SourceDisassemblyMode = 0
-    TracebackMode = 1
+    SOURCEDISASSEMBLY = 0
+    TRACEBACK = 1
 
 
 class PythonDisViewer(QWidget, Ui_PythonDisViewer):
@@ -46,7 +46,7 @@
     CodeInfoRole = Qt.ItemDataRole.UserRole + 2
     
     def __init__(self, viewmanager,
-                 mode=PythonDisViewerModes.SourceDisassemblyMode,
+                 mode=PythonDisViewerModes.SOURCEDISASSEMBLY,
                  parent=None):
         """
         Constructor
@@ -78,7 +78,7 @@
             [self.tr("Key"), self.tr("Value")])
         
         self.__disMenu = QMenu(self.disWidget)
-        if self.__mode == PythonDisViewerModes.SourceDisassemblyMode:
+        if self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY:
             self.__codeInfoAct = self.__disMenu.addAction(
                 self.tr("Show Code Info"), self.__showCodeInfo)
             self.__disMenu.addSeparator()
@@ -91,7 +91,7 @@
             self.tr('Configure...'), self.__configure)
         
         self.__codeInfoMenu = QMenu(self.codeInfoWidget)
-        if self.__mode == PythonDisViewerModes.SourceDisassemblyMode:
+        if self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY:
             self.__codeInfoMenu.addAction(
                 self.tr("Hide"), self.codeInfoWidget.hide)
         self.__codeInfoMenu.addAction(
@@ -112,7 +112,7 @@
         self.__showCodeInfoDetails = Preferences.getPython(
             "DisViewerExpandCodeInfoDetails")
         
-        if self.__mode == PythonDisViewerModes.SourceDisassemblyMode:
+        if self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY:
             self.disWidget.itemClicked.connect(self.__disItemClicked)
         self.disWidget.itemCollapsed.connect(self.__resizeDisColumns)
         self.disWidget.itemExpanded.connect(self.__resizeDisColumns)
@@ -124,14 +124,14 @@
         self.codeInfoWidget.customContextMenuRequested.connect(
             self.__codeInfoContextMenuRequested)
         
-        if self.__mode == PythonDisViewerModes.SourceDisassemblyMode:
+        if self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY:
             self.__vm.disViewerStateChanged.connect(
                 self.__disViewerStateChanged)
             
             self.codeInfoWidget.hide()
             self.hide()
         
-        elif self.__mode == PythonDisViewerModes.TracebackMode:
+        elif self.__mode == PythonDisViewerModes.TRACEBACK:
             self.__styleLabels()
     
     def __disContextMenuRequested(self, coord):
@@ -141,7 +141,7 @@
         @param coord position of the mouse pointer
         @type QPoint
         """
-        if self.__mode == PythonDisViewerModes.SourceDisassemblyMode:
+        if self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY:
             itm = self.disWidget.itemAt(coord)
             self.__codeInfoAct.setEnabled(bool(itm.data(0, self.CodeInfoRole)))
             self.disWidget.setCurrentItem(itm)
@@ -217,7 +217,7 @@
         super().show()
         
         if (
-            self.__mode == PythonDisViewerModes.SourceDisassemblyMode and
+            self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY and
             not self.__vmConnected
         ):
             self.__vm.editorChangedEd.connect(self.__editorChanged)
@@ -239,7 +239,7 @@
             self.__editor.clearAllHighlights()
         
         if (
-            self.__mode == PythonDisViewerModes.SourceDisassemblyMode and
+            self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY and
             self.__vmConnected
         ):
             self.__vm.editorChangedEd.disconnect(self.__editorChanged)
@@ -262,7 +262,7 @@
         @param on flag indicating to show the Disassembly
         @type bool
         """
-        if self.__mode == PythonDisViewerModes.SourceDisassemblyMode:
+        if self.__mode == PythonDisViewerModes.SOURCEDISASSEMBLY:
             editor = self.__vm.activeWindow()
             if on:
                 if editor is not self.__editor:
@@ -444,7 +444,7 @@
         Private method to generate the Disassembly from the source of the
         current editor and visualize it.
         """
-        if self.__mode != PythonDisViewerModes.SourceDisassemblyMode:
+        if self.__mode != PythonDisViewerModes.SOURCEDISASSEMBLY:
             # wrong mode, just return
             return
         
@@ -501,7 +501,7 @@
         @type dict
         """
         if (
-            self.__mode == PythonDisViewerModes.TracebackMode and
+            self.__mode == PythonDisViewerModes.TRACEBACK and
             disassembly and
             "instructions" in disassembly and
             disassembly["instructions"]
--- a/eric6/UI/UserInterface.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/UI/UserInterface.py	Tue Apr 27 17:25:06 2021 +0200
@@ -7431,7 +7431,7 @@
     ##########################################
     
     def showNotification(self, icon, heading, text,
-                         kind=NotificationTypes.Information, timeout=None):
+                         kind=NotificationTypes.INFORMATION, timeout=None):
         """
         Public method to show a desktop notification.
         
--- a/eric6/WebBrowser/Feeds/FeedsDialog.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/WebBrowser/Feeds/FeedsDialog.py	Tue Apr 27 17:25:06 2021 +0200
@@ -86,7 +86,7 @@
                 UI.PixmapCache.getPixmap("rss48"),
                 self.tr("Add RSS Feed"),
                 self.tr("""The feed was already added before."""),
-                kind=NotificationTypes.Warning,
+                kind=NotificationTypes.WARNING,
                 timeout=0)
         
         self.close()
--- a/eric6/WebBrowser/GreaseMonkey/GreaseMonkeyAddScriptDialog.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/WebBrowser/GreaseMonkey/GreaseMonkeyAddScriptDialog.py	Tue Apr 27 17:25:06 2021 +0200
@@ -101,5 +101,5 @@
                 UI.PixmapCache.getPixmap("greaseMonkey48"),
                 self.tr("GreaseMonkey Script Installation"),
                 msg,
-                kind=NotificationTypes.Critical,
+                kind=NotificationTypes.CRITICAL,
                 timeout=0)
--- a/eric6/WebBrowser/SafeBrowsing/SafeBrowsingManager.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/WebBrowser/SafeBrowsing/SafeBrowsingManager.py	Tue Apr 27 17:25:06 2021 +0200
@@ -159,9 +159,9 @@
         from WebBrowser.WebBrowserWindow import WebBrowserWindow
         
         kind = (
-            NotificationTypes.Critical
+            NotificationTypes.CRITICAL
             if timeout == 0 else
-            NotificationTypes.Information
+            NotificationTypes.INFORMATION
         )
         
         WebBrowserWindow.showNotification(
--- a/eric6/WebBrowser/WebBrowserWindow.py	Mon Apr 26 17:33:08 2021 +0200
+++ b/eric6/WebBrowser/WebBrowserWindow.py	Tue Apr 27 17:25:06 2021 +0200
@@ -3161,10 +3161,12 @@
         """
         Private slot to set the preferences.
         """
-        from Preferences.ConfigurationDialog import ConfigurationDialog
+        from Preferences.ConfigurationDialog import (
+            ConfigurationDialog, ConfigurationMode
+        )
         dlg = ConfigurationDialog(
             self, 'Configuration', True, fromEric=False,
-            displayMode=ConfigurationDialog.WebBrowserMode)
+            displayMode=ConfigurationMode.WEBBROWSERMODE)
         dlg.preferencesChanged.connect(self.preferencesChanged)
         dlg.masterPasswordChanged.connect(
             lambda old, new: self.masterPasswordChanged(old, new, local=True))
@@ -4685,7 +4687,7 @@
     
     @classmethod
     def showNotification(cls, icon, heading, text,
-                         kind=NotificationTypes.Information, timeout=None):
+                         kind=NotificationTypes.INFORMATION, timeout=None):
         """
         Class method to show a desktop notification.
         

eric ide

mercurial