eric6/Tasks/TaskViewer.py

Sat, 31 Aug 2019 12:58:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 31 Aug 2019 12:58:11 +0200
branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 6942
2602857055c5
child 7229
53054eb5b15a
permissions
-rw-r--r--

Started removing runtime support for Python2 and PyQt4.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
6645
ad476851d7e0 Updated copyright for 2019.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6494
diff changeset
3 # Copyright (c) 2005 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a task viewer and associated classes.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 Tasks can be defined manually or automatically. Automatically
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 generated tasks are derived from a comment with a special
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 introductory text. This text is configurable.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
3145
a9de05d4a22f # __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3080
diff changeset
14 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: 2409
diff changeset
15
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import os
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
17 import fnmatch
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
18 import threading
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
20 from PyQt5.QtCore import pyqtSignal, Qt, QThread
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3611
diff changeset
21 from PyQt5.QtWidgets import QHeaderView, QLineEdit, QTreeWidget, QDialog, \
3071
83d066710d60 Added an extended progress dialog to make the progress bar label more descriptive.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3039
diff changeset
22 QInputDialog, QApplication, QMenu, QAbstractItemView, QTreeWidgetItem
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
24 from E5Gui.E5Application import e5App
536
6d8d39753c82 Started replaceing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 501
diff changeset
25 from E5Gui import E5MessageBox
3071
83d066710d60 Added an extended progress dialog to make the progress bar label more descriptive.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3039
diff changeset
26 from E5Gui.E5ProgressDialog import E5ProgressDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
1819
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
28 from .Task import Task
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
35 from Utilities.AutoSaver import AutoSaver
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
37
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 class TaskViewer(QTreeWidget):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 Class implementing the task viewer.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
501
5c615a85241a Finished porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
42 @signal displayFile(str, int) emitted to go to a file task
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 """
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 458
diff changeset
44 displayFile = pyqtSignal(str, int)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 458
diff changeset
45
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 def __init__(self, parent, project):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 @param parent the parent (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2409
diff changeset
53 super(TaskViewer, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 self.setSortingEnabled(True)
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
56 self.setExpandsOnDoubleClick(False)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
58 self.__headerItem = QTreeWidgetItem(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
59 ["", "", self.tr("Summary"), self.tr("Filename"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
60 self.tr("Line"), ""])
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
61 self.__headerItem.setIcon(
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
62 0, UI.PixmapCache.getIcon("taskCompleted.png"))
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
63 self.__headerItem.setIcon(
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
64 1, UI.PixmapCache.getIcon("taskPriority.png"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.setHeaderItem(self.__headerItem)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 self.header().setSortIndicator(2, Qt.AscendingOrder)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 self.__resizeColumns()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 self.tasks = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 self.copyTask = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.projectOpen = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.project = project
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
74 self.projectTasksScanFilter = ""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
76 from .TaskFilter import TaskFilter
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.taskFilter = TaskFilter()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.taskFilter.setActive(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
80 self.__projectTasksSaveTimer = AutoSaver(self, self.saveProjectTasks)
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
81 self.__projectTaskExtractionThread = ProjectTaskExtractionThread()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
82 self.__projectTaskExtractionThread.taskFound.connect(self.addFileTask)
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
83
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
84 self.__projectTasksMenu = QMenu(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
85 self.tr("P&roject Tasks"), self)
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
86 self.__projectTasksMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
87 self.tr("&Regenerate project tasks"),
5105
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
88 self.regenerateProjectTasks)
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
89 self.__projectTasksMenu.addSeparator()
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
90 self.__projectTasksMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
91 self.tr("&Configure scan options"),
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
92 self.__configureProjectTasksScanOptions)
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
93
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.__menu = QMenu(self)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
95 self.__menu.addAction(self.tr("&New Task..."), self.__newTask)
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
96 self.subtaskItem = self.__menu.addAction(
5dd6edf8540a Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
97 self.tr("New &Sub-Task..."), self.__newSubTask)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.__menu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
99 self.projectTasksMenuItem = self.__menu.addMenu(
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
100 self.__projectTasksMenu)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.__menu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
102 self.gotoItem = self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
103 self.tr("&Go To"), self.__goToTask)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 self.__menu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
105 self.copyItem = self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
106 self.tr("&Copy"), self.__copyTask)
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
107 self.pasteItem = self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
108 self.tr("&Paste"), self.__pasteTask)
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
109 self.pasteMainItem = self.__menu.addAction(
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
110 self.tr("Paste as &Main Task"), self.__pasteMainTask)
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
111 self.deleteItem = self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
112 self.tr("&Delete"), self.__deleteTask)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 self.__menu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
114 self.markCompletedItem = self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
115 self.tr("&Mark Completed"), self.__markCompleted)
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
116 self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
117 self.tr("Delete Completed &Tasks"), self.__deleteCompleted)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 self.__menu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
119 self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
120 self.tr("P&roperties..."), self.__editTaskProperties)
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
121 self.__menu.addSeparator()
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
122 self.__menuFilteredAct = self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
123 self.tr("&Filtered display"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.__menuFilteredAct.setCheckable(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.__menuFilteredAct.setChecked(False)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 458
diff changeset
126 self.__menuFilteredAct.triggered[bool].connect(self.__activateFilter)
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
127 self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
128 self.tr("Filter c&onfiguration..."), self.__configureFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 self.__menu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
130 self.__menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
131 self.tr("Resi&ze columns"), self.__resizeColumns)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 self.__menu.addSeparator()
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
133 self.__menu.addAction(self.tr("Configure..."), self.__configure)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 self.__backMenu = QMenu(self)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
136 self.__backMenu.addAction(self.tr("&New Task..."), self.__newTask)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 self.__backMenu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
138 self.backProjectTasksMenuItem = self.__backMenu.addMenu(
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
139 self.__projectTasksMenu)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 self.__backMenu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
141 self.backPasteItem = self.__backMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
142 self.tr("&Paste"), self.__pasteTask)
4866
7a2cecb49b5b Fixed an issue in the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
143 self.backPasteMainItem = self.__backMenu.addAction(
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
144 self.tr("Paste as &Main Task"), self.__pasteMainTask)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 self.__backMenu.addSeparator()
4883
ae0ee88c9d62 Improved the context menu of the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4866
diff changeset
146 self.backDeleteCompletedItem = self.__backMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
147 self.tr("Delete Completed &Tasks"), self.__deleteCompleted)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 self.__backMenu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
149 self.__backMenuFilteredAct = self.__backMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
150 self.tr("&Filtered display"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 self.__backMenuFilteredAct.setCheckable(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.__backMenuFilteredAct.setChecked(False)
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
153 self.__backMenuFilteredAct.triggered[bool].connect(
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
154 self.__activateFilter)
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
155 self.__backMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
156 self.tr("Filter c&onfiguration..."), self.__configureFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 self.__backMenu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
158 self.__backMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
159 self.tr("Resi&ze columns"), self.__resizeColumns)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 self.__backMenu.addSeparator()
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
161 self.__backMenu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
162 self.tr("Configure..."), self.__configure)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163
2099
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
164 self.__activating = False
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
165
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 self.setContextMenuPolicy(Qt.CustomContextMenu)
458
1695e7a2db54 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 428
diff changeset
167 self.customContextMenuRequested.connect(self.__showContextMenu)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 458
diff changeset
168 self.itemActivated.connect(self.__taskItemActivated)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
171
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
172 self.__generateTopLevelItems()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
173
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
174 def __generateTopLevelItems(self):
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
175 """
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
176 Private method to generate the 'Extracted Tasks' item.
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
177 """
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
178 self.__extractedItem = QTreeWidgetItem(self,
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
179 [self.tr("Extracted Tasks")])
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
180 self.__manualItem = QTreeWidgetItem(self,
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
181 [self.tr("Manual Tasks")])
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
182 for itm in [self.__extractedItem, self.__manualItem]:
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
183 itm.setFirstColumnSpanned(True)
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
184 itm.setExpanded(True)
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
185 itm.setHidden(True)
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
186 font = itm.font(0)
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
187 font.setUnderline(True)
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
188 itm.setFont(0, font)
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
189
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
190 def __checkTopLevelItems(self):
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
191 """
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
192 Private slot to check the 'Extracted Tasks' item for children.
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
193 """
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
194 for itm in [self.__extractedItem, self.__manualItem]:
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
195 visibleCount = itm.childCount()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
196 for index in range(itm.childCount()):
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
197 if itm.child(index).isHidden():
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
198 visibleCount -= 1
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
199 itm.setHidden(visibleCount == 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 def __resort(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 Private method to resort the tree.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 self.sortItems(self.sortColumn(), self.header().sortIndicatorOrder())
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
206
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 def __resizeColumns(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 Private method to resize the list columns.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 self.header().resizeSections(QHeaderView.ResizeToContents)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 self.header().setStretchLastSection(True)
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
213
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
214 def findParentTask(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
215 """
5dd6edf8540a Aadded capability to add sub-tasks (i.e. a task hierarchy) for manually generated tasks to the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
216 Public method to find a parent task by its ID.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217
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
218 @param parentUid uid of the parent 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
219 @return reference to the task (Task)
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 """
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 if not 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
222 return None
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 parentTask = None
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 for task in self.tasks:
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 if task.getUuid() == 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
227 parentTask = task
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
228 break
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
229
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 return parentTask
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
231
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 def __refreshDisplay(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 Private method to refresh the display.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 for task in self.tasks:
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
237 task.setHidden(not self.taskFilter.showTask(task))
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
238
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
239 self.__checkTopLevelItems()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.__resort()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 self.__resizeColumns()
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
242
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 def __taskItemActivated(self, itm, col):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
245 Private slot to handle the activation of an item.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 @param itm reference to the activated item (QTreeWidgetItem)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 @param col column the item was activated in (integer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 """
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
250 if not self.__activating and \
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
251 itm is not self.__extractedItem and \
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
252 itm is not self.__manualItem:
2099
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
253 self.__activating = True
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
254 fn = itm.getFilename()
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
255 if fn:
5851
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
256 if os.path.exists(fn):
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
257 self.displayFile.emit(fn, itm.getLineno())
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
258 else:
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
259 if itm.isProjectTask():
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
260 self.__deleteTask(itm)
2099
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
261 else:
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
262 self.__editTaskProperties()
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2000
diff changeset
263 self.__activating = False
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 def __showContextMenu(self, coord):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 Private slot to show the context menu of the list.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 @param coord the position of the mouse pointer (QPoint)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 itm = self.itemAt(coord)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 coord = self.mapToGlobal(coord)
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
273 if itm is None or \
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
274 itm is self.__extractedItem or \
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
275 itm is self.__manualItem:
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
276 self.backProjectTasksMenuItem.setEnabled(self.projectOpen)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 if self.copyTask:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 self.backPasteItem.setEnabled(True)
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
279 self.backPasteMainItem.setEnabled(True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 self.backPasteItem.setEnabled(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
282 self.backPasteMainItem.setEnabled(False)
4883
ae0ee88c9d62 Improved the context menu of the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4866
diff changeset
283 self.backDeleteCompletedItem.setEnabled(
ae0ee88c9d62 Improved the context menu of the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4866
diff changeset
284 bool(self.tasks))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 self.__backMenu.popup(coord)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 else:
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
287 self.projectTasksMenuItem.setEnabled(self.projectOpen)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 if itm.getFilename():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 self.gotoItem.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 self.deleteItem.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 self.markCompletedItem.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 self.copyItem.setEnabled(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
293 self.subtaskItem.setEnabled(False)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 self.gotoItem.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 self.deleteItem.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 self.markCompletedItem.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 self.copyItem.setEnabled(True)
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
299 self.subtaskItem.setEnabled(True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 if self.copyTask:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 self.pasteItem.setEnabled(True)
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
302 self.pasteMainItem.setEnabled(True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 self.pasteItem.setEnabled(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
305 self.pasteMainItem.setEnabled(False)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 self.__menu.popup(coord)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
309 def setProjectOpen(self, o=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 Public slot to set the project status.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 @param o flag indicating the project status
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 self.projectOpen = o
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
317 def addTask(self, summary, priority=1, filename="", lineno=0,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
318 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
319 taskType=Task.TypeTodo, description="", 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
320 parentTask=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 Public slot to add a task.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
324 @param summary summary text of the task (string)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 @param priority priority of the task (0=high, 1=normal, 2=low)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 @param filename filename containing the task (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 @param lineno line number containing the task (integer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 @param completed flag indicating completion status (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 @param _time creation time of the task (float, if 0 use current time)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
330 @param isProjectTask flag indicating a task related to the current
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 project (boolean)
1819
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
332 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo,
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
333 Task.TypeWarning, Task.TypeNote)
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
334 @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
335 @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
336 @param parentTask reference to the parent task item (Task)
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
337 @return reference to the task item (Task)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 """
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
339 if parentTask:
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
340 parentUid = parentTask.getUuid()
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
341 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
342 parentUid = ""
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
343 task = Task(summary, priority, filename, lineno, completed,
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
344 _time, isProjectTask, taskType,
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
345 self.project, description, uid, parentUid)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 self.tasks.append(task)
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
347 if parentTask:
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
348 parentTask.addChild(task)
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
349 parentTask.setExpanded(True)
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
350 elif filename:
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
351 self.__extractedItem.addChild(task)
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
352 else:
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
353 self.__manualItem.addChild(task)
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
354 task.setHidden(not self.taskFilter.showTask(task))
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
355
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
356 self.__checkTopLevelItems()
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
357 self.__resort()
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
358 self.__resizeColumns()
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
359
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
360 if isProjectTask:
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
361 self.__projectTasksSaveTimer.changeOccurred()
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
362
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
363 return task
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
365 def addFileTask(self, summary, filename, lineno, taskType=Task.TypeTodo,
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
366 description=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 Public slot to add a file related task.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
370 @param summary summary text of the task (string)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 @param filename filename containing the task (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 @param lineno line number containing the task (integer)
1819
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
373 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo,
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
374 Task.TypeWarning, Task.TypeNote)
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
375 @param description explanatory text of the task (string)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 """
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
377 self.addTask(summary, filename=filename, lineno=lineno,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
378 isProjectTask=(
3039
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
379 self.project and
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
380 self.project.isProjectSource(filename)),
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
381 taskType=taskType, description=description)
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
382
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 def getProjectTasks(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 Public method to retrieve all project related tasks.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 @return copy of tasks (list of Task)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 tasks = [task for task in self.tasks if task.isProjectTask()]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 return tasks[:]
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
391
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 def getGlobalTasks(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 Public method to retrieve all non project related tasks.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 @return copy of tasks (list of Task)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 tasks = [task for task in self.tasks if not task.isProjectTask()]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 return tasks[:]
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
400
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 def clearTasks(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 Public slot to clear all tasks from display.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405 self.tasks = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 self.clear()
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
407 self.__generateTopLevelItems()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
408
2000
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1965
diff changeset
409 def clearProjectTasks(self, fileOnly=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 Public slot to clear project related tasks.
2000
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1965
diff changeset
412
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1965
diff changeset
413 @keyparam fileOnly flag indicating to clear only file related
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1965
diff changeset
414 project tasks (boolean)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 """
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
416 for task in reversed(self.tasks[:]):
2000
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1965
diff changeset
417 if (fileOnly and task.isProjectFileTask()) or \
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1965
diff changeset
418 (not fileOnly and task.isProjectTask()):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 if self.copyTask == task:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 self.copyTask = None
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
421 parent = task.parent()
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
422 parent.removeChild(task)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 self.tasks.remove(task)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 del task
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
426 self.__checkTopLevelItems()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
427 self.__resort()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
428 self.__resizeColumns()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
429
1373
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
430 def clearFileTasks(self, filename, conditionally=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 Public slot to clear all tasks related to a file.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 @param filename name of the file (string)
1373
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
435 @param conditionally flag indicating to clear the tasks of the file
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
436 checking some conditions (boolean)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 """
1373
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
438 if conditionally:
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
439 if self.project and self.project.isProjectSource(filename):
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
440 # project related tasks will not be cleared
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
441 return
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
442 if not Preferences.getTasks("ClearOnFileClose"):
b3b3c99dba01 Made tasks manager forget about global file tasks when file is closed (configurable via configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
443 return
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 for task in self.tasks[:]:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 if task.getFilename() == filename:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 if self.copyTask == task:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 self.copyTask = None
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
448 self.__extractedItem.removeChild(task)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 self.tasks.remove(task)
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
450 if task.isProjectTask:
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
451 self.__projectTasksSaveTimer.changeOccurred()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 del task
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
454 self.__checkTopLevelItems()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
455 self.__resort()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
456 self.__resizeColumns()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
457
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 def __editTaskProperties(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
460 Private slot to handle the "Properties" context menu entry.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 """
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
462 from .TaskPropertiesDialog import TaskPropertiesDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 task = self.currentItem()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 dlg = TaskPropertiesDialog(task, self, self.projectOpen)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 ro = task.getFilename() != ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 if ro:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 dlg.setReadOnly()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 if dlg.exec_() == QDialog.Accepted and not ro:
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
469 summary, priority, completed, isProjectTask, 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
470 dlg.getData()
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
471 task.setSummary(summary)
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
472 task.setPriority(priority)
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
473 task.setCompleted(completed)
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
474 task.setProjectTask(isProjectTask)
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
475 task.setDescription(description)
1965
96f5a76e1845 Fixed some PEP-8 related issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1819
diff changeset
476 self.__projectTasksSaveTimer.changeOccurred()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 def __newTask(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 Private slot to handle the "New Task" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 """
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
482 from .TaskPropertiesDialog import TaskPropertiesDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 dlg = TaskPropertiesDialog(None, self, self.projectOpen)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 if dlg.exec_() == QDialog.Accepted:
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
485 summary, priority, completed, isProjectTask, 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
486 dlg.getData()
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
487 self.addTask(summary, priority, completed=completed,
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
488 isProjectTask=isProjectTask, description=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
489
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
490 def __newSubTask(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
491 """
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
492 Private slot to handle the "New Sub-Task" context menu entry.
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
493 """
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
494 parentTask = self.currentItem()
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
495 projectTask = parentTask.isProjectTask()
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
496
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
497 from .TaskPropertiesDialog import TaskPropertiesDialog
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
498 dlg = TaskPropertiesDialog(None, self, self.projectOpen)
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
499 dlg.setSubTaskMode(projectTask)
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
500 if dlg.exec_() == QDialog.Accepted:
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
501 summary, priority, completed, isProjectTask, 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
502 dlg.getData()
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
503 self.addTask(summary, priority, completed=completed,
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
504 isProjectTask=isProjectTask, description=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
505 parentTask=parentTask)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
507 def __markCompleted(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509 Private slot to handle the "Mark Completed" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 task = self.currentItem()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 task.setCompleted(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 def __deleteCompleted(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516 Private slot to handle the "Delete Completed Tasks" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517 """
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
518 for task in reversed(self.tasks[:]):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 if task.isCompleted():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 if self.copyTask == task:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521 self.copyTask = None
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
522 parent = task.parent()
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
523 parent.removeChild(task)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
524 self.tasks.remove(task)
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
525 if task.isProjectTask:
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
526 self.__projectTasksSaveTimer.changeOccurred()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 del task
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
528
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
529 self.__checkTopLevelItems()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
530 self.__resort()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
531 self.__resizeColumns()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
532
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 ci = self.currentItem()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 if ci:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 ind = self.indexFromItem(ci, self.currentColumn())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 self.scrollTo(ind, QAbstractItemView.PositionAtCenter)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 def __copyTask(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 Private slot to handle the "Copy" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 task = self.currentItem()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543 self.copyTask = task
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 def __pasteTask(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 Private slot to handle the "Paste" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 if self.copyTask:
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
550 parent = self.copyTask.parent()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
551 if not isinstance(parent, Task):
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
552 parent = None
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
553
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
554 self.addTask(self.copyTask.summary,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
555 priority=self.copyTask.priority,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
556 completed=self.copyTask.completed,
2197
c4f24f8f34c0 Some harminisation of nomenclature in the various Task dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
557 description=self.copyTask.description,
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
558 isProjectTask=self.copyTask._isProjectTask,
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
559 parentTask=parent)
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
560
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
561 def __pasteMainTask(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
562 """
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
563 Private slot to handle the "Paste as Main Task" context menu entry.
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
564 """
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
565 if self.copyTask:
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
566 self.addTask(self.copyTask.summary,
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
567 priority=self.copyTask.priority,
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
568 completed=self.copyTask.completed,
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
569 description=self.copyTask.description,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
570 isProjectTask=self.copyTask._isProjectTask)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571
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
572 def __deleteSubTasks(self, task):
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
573 """
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
574 Private method to delete all sub-tasks.
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
575
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
576 @param task task to delete sub-tasks of (Task)
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
577 """
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
578 for subtask in task.takeChildren():
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
579 if self.copyTask == subtask:
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
580 self.copyTask = None
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
581 if subtask.childCount() > 0:
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
582 self.__deleteSubTasks(subtask)
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
583 self.tasks.remove(subtask)
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
584
5851
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
585 def __deleteTask(self, task=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
586 """
5851
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
587 Private slot to delete a task.
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
588
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
589 @param task task to be deleted
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
590 @type Task
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
591 """
5851
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
592 if task is None:
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
593 # called via "Delete Task" context menu entry
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
594 task = self.currentItem()
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
595
8f8b264e5d5f Fixed an issue with the task viewer causing empty files being created.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5603
diff changeset
596 if self.copyTask is task:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
597 self.copyTask = None
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
598 if task.childCount() > 0:
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
599 self.__deleteSubTasks(task)
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
600 parent = task.parent()
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
601 parent.removeChild(task)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
602 self.tasks.remove(task)
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
603 if task.isProjectTask:
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
604 self.__projectTasksSaveTimer.changeOccurred()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
605 del task
3994
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
606
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
607 self.__checkTopLevelItems()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
608 self.__resort()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
609 self.__resizeColumns()
04792ff88ddf Refined the task viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3990
diff changeset
610
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
611 ci = self.currentItem()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
612 if ci:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
613 ind = self.indexFromItem(ci, self.currentColumn())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
614 self.scrollTo(ind, QAbstractItemView.PositionAtCenter)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
615
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 def __goToTask(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
617 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 Private slot to handle the "Go To" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
619 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
620 task = self.currentItem()
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 458
diff changeset
621 self.displayFile.emit(task.getFilename(), task.getLineno())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 def handlePreferencesChanged(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
624 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 Public slot to react to changes of the preferences.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627 for task in self.tasks:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
628 task.colorizeTask()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
630 def __activateFilter(self, on):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
631 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
632 Private slot to handle the "Filtered display" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
633
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
634 @param on flag indicating the filter state (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
635 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
636 if on and not self.taskFilter.hasActiveFilter():
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2997
diff changeset
637 res = E5MessageBox.yesNo(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2997
diff changeset
638 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
639 self.tr("Activate task filter"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
640 self.tr(
2997
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
641 """The task filter doesn't have any active filters."""
7f0ef975da9e Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
642 """ Do you want to configure the filter settings?"""),
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
643 yesDefault=True)
541
00e1a5d060c5 Continued replacing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 538
diff changeset
644 if not res:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
645 on = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
646 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 self.__configureFilter()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648 on = self.taskFilter.hasActiveFilter()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
649
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
650 self.taskFilter.setActive(on)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
651 self.__menuFilteredAct.setChecked(on)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
652 self.__backMenuFilteredAct.setChecked(on)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
653 self.__refreshDisplay()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
654
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
655 def __configureFilter(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
656 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
657 Private slot to handle the "Configure filter" context menu entry.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
658 """
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
659 from .TaskFilterConfigDialog import TaskFilterConfigDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
660 dlg = TaskFilterConfigDialog(self.taskFilter)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
661 if dlg.exec_() == QDialog.Accepted:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
662 dlg.configureTaskFilter(self.taskFilter)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
663 self.__refreshDisplay()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
664
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
665 def __configureProjectTasksScanOptions(self):
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
666 """
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
667 Private slot to configure scan options for project tasks.
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
668 """
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
669 scanFilter, ok = QInputDialog.getText(
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
670 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
671 self.tr("Scan Filter Patterns"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
672 self.tr("Enter filename patterns of files"
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
673 " to be excluded separated by a comma:"),
992
566e87428fc8 Fixed a few PEP-8 issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 961
diff changeset
674 QLineEdit.Normal,
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
675 self.projectTasksScanFilter)
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
676 if ok:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
677 self.projectTasksScanFilter = scanFilter
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
678
5105
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
679 def regenerateProjectTasks(self, quiet=False):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
680 """
5105
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
681 Public slot to regenerate project related tasks.
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
682
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
683 @param quiet flag indicating quiet operation
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
684 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
685 """
1819
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
686 markers = {
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3030
diff changeset
687 Task.TypeWarning:
3039
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
688 Preferences.getTasks("TasksWarningMarkers").split(),
1819
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
689 Task.TypeNote: Preferences.getTasks("TasksNoteMarkers").split(),
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
690 Task.TypeTodo: Preferences.getTasks("TasksTodoMarkers").split(),
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
691 Task.TypeFixme: Preferences.getTasks("TasksFixmeMarkers").split(),
cfcfd617216a Changed the tasks handling to allow for more fine grained task designations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1653
diff changeset
692 }
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
693 files = self.project.pdata["SOURCES"]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
695 # apply file filter
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
696 filterList = [f.strip() for f in self.projectTasksScanFilter.split(",")
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
697 if f.strip()]
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
698 if filterList:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
699 for scanFilter in filterList:
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
700 files = [f for f in files
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
701 if not fnmatch.fnmatch(f, scanFilter)]
960
64a6e66b4707 Added capability to the tasks viewer to ignore files based on a wildcard during a project tasks scan.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
702
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
703 # remove all project tasks
2000
a81bf687e4ee Fixed an issue with the task manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1965
diff changeset
704 self.clearProjectTasks(fileOnly=True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
705
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
706 # now process them
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
707 if quiet:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
708 ppath = self.project.getProjectPath()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
709 self.__projectTaskExtractionThread.scan(
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
710 markers, [os.path.join(ppath, f) for f in files])
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
711 else:
5105
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
712 progress = E5ProgressDialog(
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
713 self.tr("Extracting project tasks..."),
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
714 self.tr("Abort"), 0, len(files), self.tr("%v/%m Files"))
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
715 progress.setMinimumDuration(0)
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
716 progress.setWindowTitle(self.tr("Tasks"))
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
717 count = 0
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
718
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
719 ppath = self.project.getProjectPath()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
720 for file in files:
5105
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
721 progress.setLabelText(
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
722 self.tr("Extracting project tasks...\n{0}").format(file))
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
723 progress.setValue(count)
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
724 QApplication.processEvents()
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
725 if progress.wasCanceled():
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
726 break
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
727
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
728 fn = os.path.join(ppath, file)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
729 # read the file and split it into textlines
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
730 try:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
731 text, encoding = Utilities.readEncodedFile(fn)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
732 lines = text.splitlines()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
733 except (UnicodeError, IOError):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
734 count += 1
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
735 progress.setValue(count)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
736 continue
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
737
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
738 # now search tasks and record them
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
739 lineIndex = 0
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
740 for line in lines:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
741 lineIndex += 1
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
742 shouldBreak = False
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
743
6494
72e3d61e5a20 TaskViewer: amended another place to check for '__NO-TASK__' marker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6493
diff changeset
744 if line.endswith("__NO-TASK__"):
72e3d61e5a20 TaskViewer: amended another place to check for '__NO-TASK__' marker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6493
diff changeset
745 # ignore potential task marker
72e3d61e5a20 TaskViewer: amended another place to check for '__NO-TASK__' marker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6493
diff changeset
746 continue
72e3d61e5a20 TaskViewer: amended another place to check for '__NO-TASK__' marker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6493
diff changeset
747
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
748 for taskType, taskMarkers in markers.items():
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
749 for taskMarker in taskMarkers:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
750 index = line.find(taskMarker)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
751 if index > -1:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
752 task = line[index:]
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
753 self.addFileTask(task, fn, lineIndex, taskType)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
754 shouldBreak = True
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
755 break
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
756 if shouldBreak:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
757 break
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
758
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
759 count += 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760
5105
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
761 progress.setValue(len(files))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
762
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
763 def __configure(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765 Private method to open the configuration dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
766 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
767 e5App().getObject("UserInterface").showPreferences("tasksPage")
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
768
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
769 def saveProjectTasks(self):
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
770 """
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
771 Public method to write the project tasks.
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
772 """
5105
8a773a100c34 Added an option to the project to rescan the project for tasks upon open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4883
diff changeset
773 if self.projectOpen and Preferences.getProject("TasksProjectAutoSave"):
1653
fed1920ff53b Added capability to save project tasks automatically (configurable on project configuration page of configuration dialog).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1640
diff changeset
774 self.project.writeTasks()
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
775
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
776 def stopProjectTaskExtraction(self):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
777 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
778 Public method to stop the project task extraction thread.
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
779 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
780 self.__projectTaskExtractionThread.requestInterrupt()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
781 self.__projectTaskExtractionThread.wait()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
782
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
783
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
784 class ProjectTaskExtractionThread(QThread):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
785 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
786 Class implementing a thread to extract tasks related to a project.
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
787
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
788 @signal taskFound(str, str, int, int) emitted with the task description,
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
789 the file name, the line number and task type to signal the presence of
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
790 a task
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
791 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
792 taskFound = pyqtSignal(str, str, int, int)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
793
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
794 def __init__(self, parent=None):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
795 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
796 Constructor
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
797
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
798 @param parent reference to the parent object (QObject)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
799 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
800 super(ProjectTaskExtractionThread, self).__init__()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
801
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
802 self.__lock = threading.Lock()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
803 self.__interrupt = False
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
804
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
805 def requestInterrupt(self):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
806 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
807 Public method to request iterruption of the thread.
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
808 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
809 if self.isRunning():
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
810 self.__interrupt = True
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
811
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
812 def scan(self, markers, files):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
813 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
814 Public method to scan the given list of files for tasks.
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
815
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
816 @param markers dictionary of defined task markers
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
817 @type dict of lists of str
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
818 @param files list of file names to be scanned
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
819 @type list of str
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
820 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
821 with self.__lock:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
822 self.__interrupt = False
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
823 self.__files = files[:]
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
824 self.__markers = {}
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
825 for markerType in markers:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
826 self.__markers[markerType] = markers[markerType][:]
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
827
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
828 if not self.isRunning():
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
829 self.start(QThread.LowPriority)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
830
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
831 def run(self):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
832 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
833 Public thread method to scan the given files.
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
834 """
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
835 with self.__lock:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
836 files = self.__files[:]
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
837 markers = {}
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
838 for markerType in self.__markers:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
839 markers[markerType] = self.__markers[markerType][:]
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
840
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
841 for fn in files:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
842 if self.__interrupt:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
843 break
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
844
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
845 # read the file and split it into textlines
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
846 try:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
847 text, encoding = Utilities.readEncodedFile(fn)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
848 lines = text.splitlines()
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
849 except (UnicodeError, IOError):
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
850 continue
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
851
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
852 # now search tasks and record them
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
853 lineIndex = 0
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
854 for line in lines:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
855 if self.__interrupt:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
856 break
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
857
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
858 lineIndex += 1
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
859 found = False
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
860
6493
b64d6d0b4175 TaskViewer, Editor: added code to mark a line as not containing a task with '__NO-TASK__'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
861 if line.endswith("__NO-TASK__"):
b64d6d0b4175 TaskViewer, Editor: added code to mark a line as not containing a task with '__NO-TASK__'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
862 # ignore potential task marker
b64d6d0b4175 TaskViewer, Editor: added code to mark a line as not containing a task with '__NO-TASK__'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
863 continue
b64d6d0b4175 TaskViewer, Editor: added code to mark a line as not containing a task with '__NO-TASK__'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
864
5117
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
865 for taskType, taskMarkers in markers.items():
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
866 for taskMarker in taskMarkers:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
867 index = line.find(taskMarker)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
868 if index > -1:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
869 task = line[index:]
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
870 with self.__lock:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
871 self.taskFound.emit(task, fn, lineIndex,
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
872 taskType)
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
873 found = True
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
874 break
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
875 if found:
1faa0780ae1d Improved the quiet task extraction process by implementing a threaded solution.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5114
diff changeset
876 break

eric ide

mercurial