eric6/Preferences/ConfigurationPages/NotificationsPage.py

Sat, 01 May 2021 14:27:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 01 May 2021 14:27:20 +0200
branch
maintenance
changeset 8273
698ae46f40a4
parent 8177
5688d73cc3ae
parent 8265
0090cfa83159
permissions
-rw-r--r--

Merged with default branch to prepare release 21.5.

2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2012 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Notifications configuration page.
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
10 from PyQt5.QtCore import pyqtSlot, QPoint
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
11 from PyQt5.QtGui import QColor
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
12 from PyQt5.QtWidgets import QApplication, QColorDialog
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from .ConfigurationPageBase import ConfigurationPageBase
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from .Ui_NotificationsPage import Ui_NotificationsPage
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import Preferences
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
18
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
19 from UI.NotificationWidget import NotificationFrame, NotificationTypes
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 class NotificationsPage(ConfigurationPageBase, Ui_NotificationsPage):
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 Class implementing the Notifications configuration page.
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 def __init__(self):
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 Constructor
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8205
diff changeset
30 super().__init__()
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 self.setupUi(self)
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setObjectName("NotificationsPage")
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
7952
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
34 geom = QApplication.screens()[0].availableVirtualGeometry()
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
35 self.xSpinBox.setMinimum(geom.x())
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
36 self.xSpinBox.setMaximum(geom.width())
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
37 self.ySpinBox.setMinimum(geom.y())
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
38 self.ySpinBox.setMaximum(geom.height())
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
40 self.warningIcon.setPixmap(
8265
0090cfa83159 Converted enum names to use all uppercase letters (except for E5PathPickerModes to keep plug-ins using this compatible with previous eric releases).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
41 NotificationFrame.getIcon(NotificationTypes.WARNING))
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
42 self.criticalIcon.setPixmap(
8265
0090cfa83159 Converted enum names to use all uppercase letters (except for E5PathPickerModes to keep plug-ins using this compatible with previous eric releases).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
43 NotificationFrame.getIcon(NotificationTypes.CRITICAL))
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
44
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 self.__notification = None
7945
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
46 self.__firstTime = True
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 # set initial values
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.timeoutSpinBox.setValue(Preferences.getUI("NotificationTimeout"))
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 point = Preferences.getUI("NotificationPosition")
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.xSpinBox.setValue(point.x())
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.ySpinBox.setValue(point.y())
7952
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
53
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
54 self.xSpinBox.valueChanged.connect(self.__moveNotification)
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
55 self.ySpinBox.valueChanged.connect(self.__moveNotification)
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
56
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
57 self.__colors = {}
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
58 self.__colors["NotificationWarningForeground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
59 "NotificationWarningForeground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
60 self.__colors["NotificationWarningBackground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
61 "NotificationWarningBackground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
62 self.__colors["NotificationCriticalForeground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
63 "NotificationCriticalForeground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
64 self.__colors["NotificationCriticalBackground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
65 "NotificationCriticalBackground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
66
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
67 self.warningFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
68 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
69 self.__colors["NotificationWarningForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
70 self.__colors["NotificationWarningBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
71 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
72 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
73 self.criticalFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
74 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
75 self.__colors["NotificationCriticalForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
76 self.__colors["NotificationCriticalBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
77 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
78 )
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 def save(self):
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 Public slot to save the Notifications configuration.
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 Preferences.setUI("NotificationTimeout", self.timeoutSpinBox.value())
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 Preferences.setUI("NotificationPosition", QPoint(
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.xSpinBox.value(), self.ySpinBox.value()))
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
87
8205
4a0f1f896341 Applied some code simplifications suggested by the new Simplify checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7959
diff changeset
88 for key in self.__colors:
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
89 Preferences.setUI(key, self.__colors[key])
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 @pyqtSlot(bool)
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 def on_visualButton_clicked(self, checked):
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 Private slot to select the position visually.
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 @param checked state of the button (boolean)
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 if checked:
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
99 from UI.NotificationWidget import NotificationWidget
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
100 self.__notification = NotificationWidget(
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
101 parent=self, setPosition=True)
7952
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
102 self.__notification.showNotification(
8265
0090cfa83159 Converted enum names to use all uppercase letters (except for E5PathPickerModes to keep plug-ins using this compatible with previous eric releases).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
103 NotificationFrame.getIcon(NotificationTypes.OTHER),
7952
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
104 self.tr("Visual Selection"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
105 self.tr("Drag the notification window to"
7952
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
106 " the desired place and release the button."),
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
107 timeout=0
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
108 )
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
109 self.__notification.move(
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
110 QPoint(self.xSpinBox.value(), self.ySpinBox.value()))
7945
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
111 if self.__firstTime:
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
112 # adjust the maximum values to the width of the notification
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
113 self.xSpinBox.setMaximum(
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
114 self.xSpinBox.maximum() - self.__notification.width())
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
115 self.ySpinBox.setMaximum(
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
116 self.ySpinBox.maximum() - self.__notification.height())
76daafe10009 Removed code dealing with Qt versions less than the required one and removed use of QDesktopWidget or QApplication.desktop().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
117 self.__firstTime = False
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 else:
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 # retrieve the position
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 point = self.__notification.frameGeometry().topLeft()
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 self.xSpinBox.setValue(point.x())
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.ySpinBox.setValue(point.y())
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.__notification.close()
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.__notification = None
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125
7952
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
126 @pyqtSlot()
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
127 def __moveNotification(self):
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
128 """
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
129 Private slot to move the notification widget.
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
130 """
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
131 if self.visualButton.isChecked():
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
132 self.__notification.move(
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
133 self.xSpinBox.value(),
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
134 self.ySpinBox.value()
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
135 )
7959
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
136
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
137 ##################################################################
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
138 ## colors for warning notifications
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
139 ##################################################################
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
140
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
141 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
142 def on_warningFgButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
143 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
144 Private slot to set the foreground color of the warning notifications.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
145 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
146 color = QColorDialog.getColor(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
147 QColor(self.__colors["NotificationWarningForeground"]))
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
148 if color.isValid():
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
149 self.__colors["NotificationWarningForeground"] = color.name()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
150 self.warningFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
151 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
152 self.__colors["NotificationWarningForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
153 self.__colors["NotificationWarningBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
154 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
155 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
156
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
157 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
158 def on_warningBgButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
159 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
160 Private slot to set the background color of the warning notifications.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
161 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
162 color = QColorDialog.getColor(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
163 QColor(self.__colors["NotificationWarningBackground"]))
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
164 if color.isValid():
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
165 self.__colors["NotificationWarningBackground"] = color.name()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
166 self.warningFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
167 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
168 self.__colors["NotificationWarningForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
169 self.__colors["NotificationWarningBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
170 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
171 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
172
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
173 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
174 def on_warningResetButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
175 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
176 Private slot to reset the colors for warning notifications to their
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
177 current values.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
178 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
179 self.__colors["NotificationWarningForeground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
180 "NotificationWarningForeground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
181 self.__colors["NotificationWarningBackground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
182 "NotificationWarningBackground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
183 self.warningFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
184 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
185 self.__colors["NotificationWarningForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
186 self.__colors["NotificationWarningBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
187 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
188 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
189
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
190 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
191 def on_warningDefaultButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
192 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
193 Private slot to reset the colors for warning notifications to their
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
194 default values.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
195 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
196 self.__colors["NotificationWarningForeground"] = (
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
197 Preferences.Prefs.uiDefaults["NotificationWarningForeground"])
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
198 self.__colors["NotificationWarningBackground"] = (
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
199 Preferences.Prefs.uiDefaults["NotificationWarningBackground"])
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
200 self.warningFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
201 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
202 self.__colors["NotificationWarningForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
203 self.__colors["NotificationWarningBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
204 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
205 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
206
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
207 ##################################################################
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
208 ## colors for critical notifications
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
209 ##################################################################
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
210
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
211 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
212 def on_criticalFgButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
213 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
214 Private slot to set the foreground color of the critical notifications.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
215 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
216 color = QColorDialog.getColor(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
217 QColor(self.__colors["NotificationCriticalForeground"]))
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
218 if color.isValid():
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
219 self.__colors["NotificationCriticalForeground"] = color.name()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
220 self.criticalFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
221 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
222 self.__colors["NotificationCriticalForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
223 self.__colors["NotificationCriticalBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
224 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
225 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
226
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
227 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
228 def on_criticalBgButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
229 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
230 Private slot to set the background color of the critical notifications.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
231 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
232 color = QColorDialog.getColor(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
233 QColor(self.__colors["NotificationCriticalBackground"]))
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
234 if color.isValid():
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
235 self.__colors["NotificationCriticalBackground"] = color.name()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
236 self.criticalFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
237 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
238 self.__colors["NotificationCriticalForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
239 self.__colors["NotificationCriticalBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
240 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
241 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
242
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
243 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
244 def on_criticalResetButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
245 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
246 Private slot to reset the colors for critical notifications to their
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
247 current values.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
248 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
249 self.__colors["NotificationCriticalForeground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
250 "NotificationCriticalForeground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
251 self.__colors["NotificationCriticalBackground"] = Preferences.getUI(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
252 "NotificationCriticalBackground")
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
253 self.criticalFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
254 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
255 self.__colors["NotificationCriticalForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
256 self.__colors["NotificationCriticalBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
257 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
258 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
259
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
260 @pyqtSlot()
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
261 def on_criticalDefaultButton_clicked(self):
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
262 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
263 Private slot to reset the colors for critical notifications to their
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
264 default values.
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
265 """
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
266 self.__colors["NotificationCriticalForeground"] = (
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
267 Preferences.Prefs.uiDefaults["NotificationCriticalForeground"])
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
268 self.__colors["NotificationCriticalBackground"] = (
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
269 Preferences.Prefs.uiDefaults["NotificationCriticalBackground"])
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
270 self.criticalFrame.setStyleSheet(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
271 NotificationFrame.NotificationStyleSheetTemplate.format(
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
272 self.__colors["NotificationCriticalForeground"],
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
273 self.__colors["NotificationCriticalBackground"]
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
274 )
44e15eda6506 Improved the Notification system by supporting colored notifications.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7955
diff changeset
275 )
7952
1849f61cf2b6 Changed the notification widget to be able to show multiple notification simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7945
diff changeset
276
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 def create(dlg):
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 Module function to create the configuration page.
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 @param dlg reference to the configuration dialog
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
283 @return reference to the instantiated page (ConfigurationPageBase)
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 """
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 page = NotificationsPage()
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 return page

eric ide

mercurial