Tasks/Task.py

Thu, 01 Jan 2015 13:11:59 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 01 Jan 2015 13:11:59 +0100
changeset 4021
195a471c327b
parent 3990
5dd6edf8540a
child 4457
6faeea06e9b6
permissions
-rw-r--r--

Updated copyright for 2015.

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
4021
195a471c327b Updated copyright for 2015.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
3 # Copyright (c) 2005 - 2015 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)
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 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
123 if self.taskType == Task.TypeFixme:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
124 self.setBackground(
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
125 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
126 elif self.taskType == Task.TypeWarning:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
127 self.setBackground(
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
128 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
129 elif self.taskType == Task.TypeTodo:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
130 self.setBackground(
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
131 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
132 else:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3178
diff changeset
133 self.setBackground(
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
134 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
135 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
136 self.setFont(col, boldFont)
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
138 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
139 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 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
141
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
142 @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
143 """
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
144 self.summary = summary
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
145 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
146
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
147 def setDescription(self, description):
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
148 """
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
149 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
150
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
151 @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
152 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 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
154
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 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
156 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 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
158
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 @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
160 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 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
162 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
163 else:
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 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
165
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 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
167 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
168 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
169 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
170 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
171 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
172 else:
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("empty.png"))
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 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
176 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 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
178
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 @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
180 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 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
182 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
183 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
184 strikeOut = True
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 else:
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 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
187 strikeOut = False
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 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
189 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
190 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
191 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
192
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
193 # 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
194 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
195 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
196
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 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
198 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 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
200
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 @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
202 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 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
204
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 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
206 """
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
207 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
208
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 @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
210 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 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
212 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
213 else:
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 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
215
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
216 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
217 """
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 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
219
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 @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
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 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
223
1819
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 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
225 """
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
226 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
227
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 @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
229 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 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
231
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
232 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
233 """
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
234 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
235
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 @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
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 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
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 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
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 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
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 @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
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 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
247
1819
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 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
249 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 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
251
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 @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
253 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 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
255 self.colorizeTask()
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 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
258 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 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
260
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 @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
262 """
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 return self._isProjectTask
2000
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1819
diff changeset
264
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1819
diff changeset
265 def isProjectFileTask(self):
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1819
diff changeset
266 """
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
267 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
268 project file.
2000
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1819
diff changeset
269
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1819
diff changeset
270 @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
271 """
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1819
diff changeset
272 return self._isProjectTask and self.filename != ""

eric ide

mercurial