5 |
5 |
6 """ |
6 """ |
7 Module implementing the Tasks configuration page. |
7 Module implementing the Tasks configuration page. |
8 """ |
8 """ |
9 |
9 |
|
10 from PyQt6.QtCore import pyqtSlot |
|
11 from PyQt6.QtGui import QColor |
|
12 |
10 from .ConfigurationPageBase import ConfigurationPageBase |
13 from .ConfigurationPageBase import ConfigurationPageBase |
11 from .Ui_TasksPage import Ui_TasksPage |
14 from .Ui_TasksPage import Ui_TasksPage |
12 |
15 |
13 import Preferences |
16 import Preferences |
14 |
17 |
15 |
18 |
16 # TODO: colorize tasks marker line edits according to the selected background |
|
17 # colors |
|
18 class TasksPage(ConfigurationPageBase, Ui_TasksPage): |
19 class TasksPage(ConfigurationPageBase, Ui_TasksPage): |
19 """ |
20 """ |
20 Class implementing the Tasks configuration page. |
21 Class implementing the Tasks configuration page. |
21 """ |
22 """ |
22 def __init__(self): |
23 def __init__(self): |
81 Preferences.setTasks( |
84 Preferences.setTasks( |
82 "ClearOnFileClose", self.clearCheckBox.isChecked()) |
85 "ClearOnFileClose", self.clearCheckBox.isChecked()) |
83 |
86 |
84 self.saveColours(Preferences.setTasks) |
87 self.saveColours(Preferences.setTasks) |
85 |
88 |
|
89 @pyqtSlot(str, QColor) |
|
90 def __colorChanged(self, colorKey, color): |
|
91 """ |
|
92 Private slot handling the selection of a color. |
|
93 |
|
94 @param colorKey key of the color entry |
|
95 @type str |
|
96 @param color selected color |
|
97 @type QColor |
|
98 """ |
|
99 if colorKey == "TasksFixmeColor": |
|
100 self.tasksMarkerFixmeEdit.setStyleSheet( |
|
101 f"background-color: {color.name()}") |
|
102 elif colorKey == "TasksWarningColor": |
|
103 self.tasksMarkerWarningEdit.setStyleSheet( |
|
104 f"background-color: {color.name()}") |
|
105 elif colorKey == "TasksTodoColor": |
|
106 self.tasksMarkerTodoEdit.setStyleSheet( |
|
107 f"background-color: {color.name()}") |
|
108 elif colorKey == "TasksNoteColor": |
|
109 self.tasksMarkerNoteEdit.setStyleSheet( |
|
110 f"background-color: {color.name()}") |
|
111 elif colorKey == "TasksTestColor": |
|
112 self.tasksMarkerTestEdit.setStyleSheet( |
|
113 f"background-color: {color.name()}") |
|
114 elif colorKey == "TasksDocuColor": |
|
115 self.tasksMarkerDocuEdit.setStyleSheet( |
|
116 f"background-color: {color.name()}") |
|
117 |
86 |
118 |
87 def create(dlg): |
119 def create(dlg): |
88 """ |
120 """ |
89 Module function to create the configuration page. |
121 Module function to create the configuration page. |
90 |
122 |