Thu, 13 Aug 2020 16:59:03 +0200
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
7360
9190402e4505
Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
3 | # Copyright (c) 2005 - 2020 Detlev Offenbach <detlev@die-offenbachs.de> |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing a class to store task data. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2302
diff
changeset
|
10 | |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | import os |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | import time |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
14 | from PyQt5.QtCore import Qt, QUuid |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
15 | from PyQt5.QtWidgets import QTreeWidgetItem |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | import UI.PixmapCache |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | import Preferences |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | class Task(QTreeWidgetItem): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | Class implementing the task data structure. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | TypeNone = -1 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | TypeFixme = 0 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | TypeTodo = 1 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | TypeWarning = 2 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | TypeNote = 3 |
7663
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
30 | TypeTest = 4 |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
31 | TypeDocu = 5 |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
32 | |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
33 | TaskType2IconName = { |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
34 | TypeFixme: "taskFixme", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
35 | TypeTodo: "taskTodo", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
36 | TypeWarning: "taskWarning", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
37 | TypeNote: "taskNote", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
38 | TypeTest: "taskTest", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
39 | TypeDocu: "taskDocu", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
40 | } |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
41 | TaskType2ColorName = { |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
42 | TypeFixme: "TasksFixmeColor", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
43 | TypeTodo: "TasksTodoColor", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
44 | TypeWarning: "TasksWarningColor", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
45 | TypeNote: "TasksNoteColor", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
46 | TypeTest: "TasksTestColor", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
47 | TypeDocu: "TasksDocuColor", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
48 | } |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
49 | TaskType2MarkersName = { |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
50 | TypeFixme: "TasksFixmeMarkers", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
51 | TypeTodo: "TasksTodoMarkers", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
52 | TypeWarning: "TasksWarningMarkers", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
53 | TypeNote: "TasksNoteMarkers", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
54 | TypeTest: "TasksTestMarkers", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
55 | TypeDocu: "TasksDocuMarkers", |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
56 | } |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
58 | def __init__(self, summary, priority=1, filename="", lineno=0, |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | completed=False, _time=0, isProjectTask=False, |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
60 | taskType=TypeTodo, project=None, description="", |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
61 | uid="", parentUid=""): |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | Constructor |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
65 | @param summary summary text of the task (string) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | @param priority priority of the task (0=high, 1=normal, 2=low) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | @param filename filename containing the task (string) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | @param lineno line number containing the task (integer) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | @param completed flag indicating completion status (boolean) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | @param _time creation time of the task (float, if 0 use current time) |
2965
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
71 | @param isProjectTask flag indicating a task related to the current |
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
72 | project (boolean) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | @param taskType type of the task (one of TypeFixme, TypeTodo, |
7663
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
74 | TypeWarning, TypeNote, TypeTest, TypeDocu) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | @param project reference to the project object (Project) |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
76 | @param description explanatory text of the task (string) |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
77 | @param uid unique id of the task (string) |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
78 | @param parentUid unique id of the parent task (string) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | """ |
2525
8b507a9a2d40
Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
2302
diff
changeset
|
80 | super(Task, self).__init__() |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
82 | self.summary = summary |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | self.description = description |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | if priority in [0, 1, 2]: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | self.priority = priority |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | self.priority = 1 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | self.filename = filename |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | self.lineno = lineno |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | self.completed = completed |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | self.created = _time and _time or time.time() |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | self._isProjectTask = isProjectTask |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
93 | self.taskType = taskType |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
94 | self.project = project |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
95 | if uid: |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
96 | self.uid = uid |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
97 | else: |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
98 | self.uid = QUuid.createUuid().toString() |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
99 | self.parentUid = parentUid |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | if isProjectTask: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
102 | self.filename = self.project.getRelativePath(self.filename) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
103 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
104 | self.setData(0, Qt.DisplayRole, "") |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | self.setData(1, Qt.DisplayRole, "") |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
106 | self.setData(2, Qt.DisplayRole, self.summary) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
107 | self.setData(3, Qt.DisplayRole, self.filename) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
108 | self.setData(4, Qt.DisplayRole, self.lineno or "") |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
109 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | if self.completed: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
111 | self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | strikeOut = True |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | else: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
114 | self.setIcon(0, UI.PixmapCache.getIcon("empty")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | strikeOut = False |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | for column in range(2, 5): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
117 | f = self.font(column) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
118 | f.setStrikeOut(strikeOut) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
119 | self.setFont(column, f) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | if self.priority == 1: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
122 | self.setIcon(1, UI.PixmapCache.getIcon("empty")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | elif self.priority == 0: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
124 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
125 | elif self.priority == 2: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
126 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
127 | else: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
128 | self.setIcon(1, UI.PixmapCache.getIcon("empty")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | |
7663
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
130 | try: |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
131 | self.setIcon(2, UI.PixmapCache.getIcon( |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
132 | Task.TaskType2IconName[self.taskType])) |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
133 | except KeyError: |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
134 | self.setIcon(2, UI.PixmapCache.getIcon("empty")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
136 | self.colorizeTask() |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | self.setTextAlignment(4, Qt.AlignRight) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
139 | def colorizeTask(self): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | Public slot to set the colors of the task item. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
142 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
143 | boldFont = self.font(0) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
144 | boldFont.setBold(True) |
4457
6faeea06e9b6
Fixed a little bug related to styling of a task item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
145 | nonBoldFont = self.font(0) |
6faeea06e9b6
Fixed a little bug related to styling of a task item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
146 | nonBoldFont.setBold(False) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
147 | for col in range(5): |
7663
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
148 | try: |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
149 | self.setBackground( |
7663
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
150 | col, Preferences.getTasks( |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
151 | Task.TaskType2ColorName[self.taskType])) |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
152 | except KeyError: |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
153 | # do not set background color if type is not known |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
154 | pass |
b4d5234f92e7
Tasks: added separate task categories for 'Test' and 'Documentation' tasks
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
155 | |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
156 | if self._isProjectTask: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | self.setFont(col, boldFont) |
4457
6faeea06e9b6
Fixed a little bug related to styling of a task item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
158 | else: |
6faeea06e9b6
Fixed a little bug related to styling of a task item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
159 | self.setFont(col, nonBoldFont) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
161 | def setSummary(self, summary): |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
162 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
163 | Public slot to update the description. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
164 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
165 | @param summary summary text of the task (string) |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
166 | """ |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
167 | self.summary = summary |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
168 | self.setText(2, self.summary) |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
169 | |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
170 | def setDescription(self, description): |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
171 | """ |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
172 | Public slot to update the description field. |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
173 | |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
174 | @param description descriptive text of the task (string) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
175 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | self.description = description |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
177 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
178 | def setPriority(self, priority): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
179 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
180 | Public slot to update the priority. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
181 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
182 | @param priority priority of the task (0=high, 1=normal, 2=low) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | if priority in [0, 1, 2]: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
185 | self.priority = priority |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
187 | self.priority = 1 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | if self.priority == 1: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
190 | self.setIcon(1, UI.PixmapCache.getIcon("empty")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
191 | elif self.priority == 0: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
192 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
193 | elif self.priority == 2: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
194 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
195 | else: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
196 | self.setIcon(1, UI.PixmapCache.getIcon("empty")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
197 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
198 | def setCompleted(self, completed): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
200 | Public slot to update the completed flag. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
201 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
202 | @param completed flag indicating completion status (boolean) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | self.completed = completed |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | if self.completed: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
206 | self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | strikeOut = True |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | else: |
7533
88261c96484b
Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
209 | self.setIcon(0, UI.PixmapCache.getIcon("empty")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | strikeOut = False |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
211 | for column in range(2, 5): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | f = self.font(column) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
213 | f.setStrikeOut(strikeOut) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
214 | self.setFont(column, f) |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
215 | |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
216 | # set the completion status for all children |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
217 | for index in range(self.childCount()): |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
218 | self.child(index).setCompleted(completed) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | def isCompleted(self): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | Public slot to return the completion status. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
223 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
224 | @return flag indicating the completion status (boolean) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
225 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | return self.completed |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
227 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | def getFilename(self): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
229 | """ |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
230 | Public method to retrieve the task's filename. |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
231 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
232 | @return filename (string) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
233 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | if self._isProjectTask and self.filename: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
235 | return os.path.join(self.project.getProjectPath(), self.filename) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
236 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
237 | return self.filename |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
238 | |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
239 | def isFileTask(self): |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
240 | """ |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
241 | Public slot to get an indication, if this task is related to a file. |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
242 | |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
243 | @return flag indicating a file task (boolean) |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
244 | """ |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
245 | return self.filename != "" |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
246 | |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | def getLineno(self): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
248 | """ |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
249 | Public method to retrieve the task's linenumber. |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | @return linenumber (integer) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | return self.lineno |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | |
3990
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
255 | def getUuid(self): |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
256 | """ |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
257 | Public method to get the task's uid. |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
258 | |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
259 | @return uid (string) |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
260 | """ |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
261 | return self.uid |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
262 | |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
263 | def getParentUuid(self): |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
264 | """ |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
265 | Public method to get the parent task's uid. |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
266 | |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
267 | @return parent uid (string) |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
268 | """ |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
269 | return self.parentUid |
5dd6edf8540a
Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3656
diff
changeset
|
270 | |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
271 | def setProjectTask(self, pt): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
273 | Public method to set the project relation flag. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
275 | @param pt flag indicating a project task (boolean) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
276 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
277 | self._isProjectTask = pt |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
278 | self.colorizeTask() |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
279 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
280 | def isProjectTask(self): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
281 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
282 | Public slot to return the project relation status. |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
283 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
284 | @return flag indicating the project relation status (boolean) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
285 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
286 | return self._isProjectTask |
2000
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
287 | |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
288 | def isProjectFileTask(self): |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
289 | """ |
2997
7f0ef975da9e
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2965
diff
changeset
|
290 | Public slot to get an indication, if this task is related to a |
7f0ef975da9e
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2965
diff
changeset
|
291 | project file. |
2000
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
292 | |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
293 | @return flag indicating a project file task (boolean) |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
294 | """ |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
295 | return self._isProjectTask and self.filename != "" |