Sat, 03 Dec 2016 12:49:53 +0100
Re-merged with the default branch.
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 | |
4631
5c1a96925da4
Updated copyright for 2016.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4457
diff
changeset
|
3 | # Copyright (c) 2005 - 2016 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 | |
3145
a9de05d4a22f
# __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents:
3057
diff
changeset
|
10 | from __future__ import unicode_literals |
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
|
11 | |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | import os |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | import time |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
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
|
15 | from PyQt5.QtCore import Qt, QUuid |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
16 | 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
|
17 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | 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
|
19 | import Preferences |
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 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | 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
|
23 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | 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
|
25 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | TypeNone = -1 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | TypeFixme = 0 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | TypeTodo = 1 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | TypeWarning = 2 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | TypeNote = 3 |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
32 | 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
|
33 | 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
|
34 | 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
|
35 | 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
|
36 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | Constructor |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
39 | @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
|
40 | @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
|
41 | @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
|
42 | @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
|
43 | @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
|
44 | @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
|
45 | @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
|
46 | 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
|
47 | @param taskType type of the task (one of TypeFixme, TypeTodo, |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | TypeWarning, TypeNote) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | @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
|
50 | @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
|
51 | @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
|
52 | @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
|
53 | """ |
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
|
54 | 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
|
55 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
56 | 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
|
57 | 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
|
58 | 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
|
59 | 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
|
60 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | 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
|
62 | 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
|
63 | 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
|
64 | 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
|
65 | 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
|
66 | 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
|
67 | 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
|
68 | 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
|
69 | 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
|
70 | 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
|
71 | 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
|
72 | 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
|
73 | 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
|
74 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | if isProjectTask: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
76 | 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
|
77 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | 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
|
79 | 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
|
80 | 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
|
81 | 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
|
82 | 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
|
83 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | if self.completed: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | strikeOut = True |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | self.setIcon(0, UI.PixmapCache.getIcon("empty.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | strikeOut = False |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | 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
|
91 | 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
|
92 | 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
|
93 | 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
|
94 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
95 | if 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
|
96 | self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | elif self.priority == 0: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | elif self.priority == 2: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
102 | self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) |
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 | if self.taskType == Task.TypeFixme: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | self.setIcon(2, UI.PixmapCache.getIcon("taskFixme.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | elif self.taskType == Task.TypeWarning: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
107 | self.setIcon(2, UI.PixmapCache.getIcon("taskWarning.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
108 | elif self.taskType == Task.TypeTodo: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
109 | self.setIcon(2, UI.PixmapCache.getIcon("taskTodo.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | self.setIcon(2, UI.PixmapCache.getIcon("taskNote.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | self.colorizeTask() |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | 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
|
115 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | 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
|
117 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
118 | 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
|
119 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | 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
|
121 | 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
|
122 | 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
|
123 | 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
|
124 | for col in range(5): |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
125 | if self.taskType == Task.TypeFixme: |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
126 | self.setBackground( |
2997
7f0ef975da9e
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2965
diff
changeset
|
127 | col, Preferences.getTasks("TasksFixmeColor")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
128 | elif self.taskType == Task.TypeWarning: |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
129 | self.setBackground( |
2997
7f0ef975da9e
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2965
diff
changeset
|
130 | col, Preferences.getTasks("TasksWarningColor")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | elif self.taskType == Task.TypeTodo: |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
132 | self.setBackground( |
2997
7f0ef975da9e
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2965
diff
changeset
|
133 | col, Preferences.getTasks("TasksTodoColor")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | else: |
3656
441956d8fce5
Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3178
diff
changeset
|
135 | self.setBackground( |
2997
7f0ef975da9e
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2965
diff
changeset
|
136 | col, Preferences.getTasks("TasksNoteColor")) |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | 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
|
138 | 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
|
139 | else: |
6faeea06e9b6
Fixed a little bug related to styling of a task item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
140 | 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
|
141 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
142 | 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
|
143 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
144 | 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
|
145 | |
2197
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
146 | @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
|
147 | """ |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
148 | self.summary = summary |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
149 | 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
|
150 | |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
151 | def setDescription(self, description): |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
152 | """ |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
153 | 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
|
154 | |
c4f24f8f34c0
Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2000
diff
changeset
|
155 | @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
|
156 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | 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
|
158 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | 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
|
160 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
161 | 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
|
162 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
163 | @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
|
164 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
165 | 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
|
166 | 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
|
167 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
168 | 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
|
169 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
170 | if 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
|
171 | self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
172 | elif self.priority == 0: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
173 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
174 | elif self.priority == 2: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
175 | self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
177 | self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
178 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
179 | 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
|
180 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
181 | 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
|
182 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | @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
|
184 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
185 | 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
|
186 | if self.completed: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
187 | self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | strikeOut = True |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | self.setIcon(0, UI.PixmapCache.getIcon("empty.png")) |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
191 | strikeOut = False |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
192 | 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
|
193 | 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
|
194 | 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
|
195 | 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
|
196 | |
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
|
197 | # 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
|
198 | 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
|
199 | 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
|
200 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
201 | 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
|
202 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | 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
|
204 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | @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
|
206 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | 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
|
208 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | 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
|
210 | """ |
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
|
211 | 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
|
212 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
213 | @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
|
214 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | 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
|
216 | 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
|
217 | else: |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | 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
|
219 | |
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
|
220 | 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
|
221 | """ |
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
|
222 | 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
|
223 | |
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
|
224 | @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
|
225 | """ |
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
|
226 | 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
|
227 | |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | 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
|
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 linenumber. |
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 linenumber (integer) |
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 | 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
|
235 | |
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
|
236 | 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
|
237 | """ |
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
|
238 | 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
|
239 | |
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 | @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
|
241 | """ |
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 | 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
|
243 | |
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 | 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
|
245 | """ |
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 | 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
|
247 | |
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
|
248 | @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
|
249 | """ |
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
|
250 | 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
|
251 | |
1819
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | 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
|
253 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | 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
|
255 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
256 | @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
|
257 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
258 | 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
|
259 | self.colorizeTask() |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
260 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | 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
|
262 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | 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
|
264 | |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | @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
|
266 | """ |
cfcfd617216a
Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
267 | return self._isProjectTask |
2000
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
268 | |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
269 | def isProjectFileTask(self): |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
270 | """ |
2997
7f0ef975da9e
Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2965
diff
changeset
|
271 | 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
|
272 | project file. |
2000
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
273 | |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
274 | @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
|
275 | """ |
a81bf687e4ee
Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1819
diff
changeset
|
276 | return self._isProjectTask and self.filename != "" |