eric6/E5Gui/E5ErrorMessage.py

changeset 8268
6b8128e0c9d1
parent 8257
28146736bbfc
--- a/eric6/E5Gui/E5ErrorMessage.py	Tue Apr 27 17:42:00 2021 +0200
+++ b/eric6/E5Gui/E5ErrorMessage.py	Wed Apr 28 19:42:28 2021 +0200
@@ -10,8 +10,8 @@
 import contextlib
 
 from PyQt5.QtCore import (
-    qInstallMessageHandler, QtDebugMsg, QtWarningMsg, QtCriticalMsg,
-    QtFatalMsg, QThread, QMetaObject, Qt, Q_ARG, QSettings
+    qInstallMessageHandler, Qt, Q_ARG, QSettings, QtMsgType, QThread,
+    QMetaObject
 )
 from PyQt5.QtWidgets import QErrorMessage, QDialog
 
@@ -97,7 +97,6 @@
         dlg = E5ErrorMessageFilterDialog(
             Globals.toList(_filterSettings.value(
                 "MessageFilters", [])))
-##            _defaultFilters)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             filters = dlg.getFilters()
             _filterSettings.setValue("MessageFilters", filters)
@@ -121,13 +120,15 @@
             return
         
         with contextlib.suppress(RuntimeError):
-            if msgType == QtDebugMsg:
+            if msgType == QtMsgType.QtDebugMsg:
                 messageType = "Debug Message:"
-            elif msgType == QtWarningMsg:
+            elif msgType == QtMsgType.QtInfoMsg:
+                messageType = "Info Message:"
+            elif msgType == QtMsgType.QtWarningMsg:
                 messageType = "Warning:"
-            elif msgType == QtCriticalMsg:
+            elif msgType == QtMsgType.QtCriticalMsg:
                 messageType = "Critical:"
-            elif msgType == QtFatalMsg:
+            elif msgType == QtMsgType.QtFatalMsg:
                 messageType = "Fatal Error:"
             if isinstance(message, bytes):
                 message = Utilities.decodeBytes(message)
@@ -161,13 +162,15 @@
         _origMsgHandler(msgType, message)
         return
     
-    if msgType == QtDebugMsg:
+    if msgType == QtMsgType.QtDebugMsg:
         messageType = "Debug Message"
-    elif msgType == QtWarningMsg:
+    elif msgType == QtMsgType.QtInfoMsg:
+        messageType = "Info Message:"
+    elif msgType == QtMsgType.QtWarningMsg:
         messageType = "Warning"
-    elif msgType == QtCriticalMsg:
+    elif msgType == QtMsgType.QtCriticalMsg:
         messageType = "Critical"
-    elif msgType == QtFatalMsg:
+    elif msgType == QtMsgType.QtFatalMsg:
         messageType = "Fatal Error"
     if isinstance(message, bytes):
         message = message.decode()

eric ide

mercurial