eric6/E5Gui/E5ErrorMessageFilterDialog.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7780
41420f82c0ac
child 8157
800c09ec0956
permissions
-rw-r--r--

Updated copyright for 2021.

2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2013 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to manage the list of messages to be ignored.
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
5858
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
10 from PyQt5.QtCore import pyqtSlot
4093
8dd5c3a49b82 Created a generic widget for editing a list of strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
11 from PyQt5.QtWidgets import QDialog
2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_E5ErrorMessageFilterDialog import Ui_E5ErrorMessageFilterDialog
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class E5ErrorMessageFilterDialog(QDialog, Ui_E5ErrorMessageFilterDialog):
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing a dialog to manage the list of messages to be ignored.
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
5858
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
20 def __init__(self, messageFilters, defaultFilters, parent=None):
2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Constructor
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
2990
583beaf0b4b8 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2697
diff changeset
24 @param messageFilters list of message filters to be edited
5859
28282fa0df7b Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5858
diff changeset
25 @type list of str
28282fa0df7b Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5858
diff changeset
26 @param defaultFilters list of default message filters
28282fa0df7b Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5858
diff changeset
27 @type list of str
28282fa0df7b Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5858
diff changeset
28 @param parent reference to the parent widget
28282fa0df7b Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5858
diff changeset
29 @type QWidget
2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
2791
a9577f248f04 Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2697
diff changeset
31 super(E5ErrorMessageFilterDialog, self).__init__(parent)
2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setupUi(self)
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
5858
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
34 self.__defaultFilters = defaultFilters[:]
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
35
4093
8dd5c3a49b82 Created a generic widget for editing a list of strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
36 self.filtersEditWidget.setList(messageFilters)
8dd5c3a49b82 Created a generic widget for editing a list of strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
37 self.filtersEditWidget.setListWhatsThis(self.tr(
4095
c78cdc1a3c14 Added a configuration page for the log viewer to the configuration dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4093
diff changeset
38 "<b>Error Message Filters</b>"
4093
8dd5c3a49b82 Created a generic widget for editing a list of strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
39 "<p>This list shows the configured message filters used to"
8dd5c3a49b82 Created a generic widget for editing a list of strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
40 " suppress error messages from within Qt.</p>"
8dd5c3a49b82 Created a generic widget for editing a list of strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
41 ))
5858
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
42
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
43 self.filtersEditWidget.setDefaultVisible(True)
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
44 self.filtersEditWidget.setToDefault.connect(self.__setToDefault)
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
45
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
46 @pyqtSlot()
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
47 def __setToDefault(self):
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
48 """
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
49 Private slot to set the message list to the default values.
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
50 """
7afdb26fcabc Added capability to reset to default to the message filter dialog and the mimetypes configuration page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
51 self.filtersEditWidget.setList(self.__defaultFilters)
2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 def getFilters(self):
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 """
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 Public method to get the list of message filters.
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 @return error message filters (list of strings)
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 """
4093
8dd5c3a49b82 Created a generic widget for editing a list of strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
59 return self.filtersEditWidget.getList()

eric ide

mercurial