# eric6.Tasks.TaskViewer

Module implementing a task viewer and associated classes.

Tasks can be defined manually or automatically. Automatically generated tasks are derived from a comment with a special introductory text. This text is configurable.

### Global Attributes

None

### Classes

TaskViewer | Class implementing the task viewer.

### Functions

None

## TaskViewer

Class implementing the task viewer.

### Signals

displayFile(str, int)
  emitted to go to a file task

### Derived from

QTreeWidget

### Class Attributes

None

### Class Methods

None

### Methods

TaskViewer | Constructor
__activateFilter | Private slot to handle the "Filtered display" context menu entry.
__configure | Private method to open the configuration dialog.
__configureFilter | Private slot to handle the "Configure filter" context menu entry.
__configureProjectTasksScanOptions | Private slot to configure scan options for project tasks.
__copyTask | Private slot to handle the "Copy" context menu entry.
__deleteCompleted | Private slot to handle the "Delete Completed Tasks" context menu entry.
__deleteTask | Private slot to handle the "Delete Task" context menu entry.
__editTaskProperties | Private slot to handle the "Properties" context menu entry.
__goToTask | Private slot to handle the "Go To" context menu entry.
__markCompleted | Private slot to handle the "Mark Completed" context menu entry.
__newTask | Private slot to handle the "New Task" context menu entry.
__pasteTask | Private slot to handle the "Paste" context menu entry.
__refreshDisplay | Private method to refresh the display.
__regenerateProjectTasks | Private slot to handle the "Regenerated project tasks" context menu entry.
__resizeColumns | Private method to resize the list columns.
__resort | Private method to resort the tree.
__showContextMenu | Private slot to show the context menu of the list.
__taskItemActivated | Private slot to handle the activation of an item.
addFileTask | Public slot to add a file related task.
addTask | Public slot to add a task.
clearFileTasks | Public slot to clear all tasks related to a file.
clearProjectTasks | Public slot to clear project related tasks.
clearTasks | Public slot to clear all tasks from display.
getGlobalTasks | Public method to retrieve all non project related tasks.
getProjectTasks | Public method to retrieve all project related tasks.
handlePreferencesChanged | Public slot to react to changes of the preferences.
saveProjectTasks | Public method to write the project tasks.
setProjectOpen | Public slot to set the project status.

### Static Methods

None

#### TaskViewer (Constructor)

TaskViewer(parent, project)

Constructor

parent
  the parent (QWidget)
project
  reference to the project object

#### TaskViewer.__activateFilter

__activateFilter(on)

Private slot to handle the "Filtered display" context menu entry.

on
  flag indicating the filter state (boolean)

#### TaskViewer.__configure

__configure()

Private method to open the configuration dialog.

#### TaskViewer.__configureFilter

__configureFilter()

Private slot to handle the "Configure filter" context menu entry.

#### TaskViewer.__configureProjectTasksScanOptions

__configureProjectTasksScanOptions()

Private slot to configure scan options for project tasks.

#### TaskViewer.__copyTask

__copyTask()

Private slot to handle the "Copy" context menu entry.

#### TaskViewer.__deleteCompleted

__deleteCompleted()

Private slot to handle the "Delete Completed Tasks" context menu entry.

#### TaskViewer.__deleteTask

__deleteTask()

Private slot to handle the "Delete Task" context menu entry.

#### TaskViewer.__editTaskProperties

__editTaskProperties()

Private slot to handle the "Properties" context menu entry.

#### TaskViewer.__goToTask

__goToTask()

Private slot to handle the "Go To" context menu entry.

#### TaskViewer.__markCompleted

__markCompleted()

Private slot to handle the "Mark Completed" context menu entry.

#### TaskViewer.__newTask

__newTask()

Private slot to handle the "New Task" context menu entry.

#### TaskViewer.__pasteTask

__pasteTask()

Private slot to handle the "Paste" context menu entry.

#### TaskViewer.__refreshDisplay

__refreshDisplay()

Private method to refresh the display.

#### TaskViewer.__regenerateProjectTasks

__regenerateProjectTasks()

Private slot to handle the "Regenerated project tasks" context menu entry.

#### TaskViewer.__resizeColumns

__resizeColumns()

Private method to resize the list columns.

#### TaskViewer.__resort

__resort()

Private method to resort the tree.

#### TaskViewer.__showContextMenu

__showContextMenu(coord)

Private slot to show the context menu of the list.

coord
  the position of the mouse pointer (QPoint)

#### TaskViewer.__taskItemActivated

__taskItemActivated(itm, col)

Private slot to handle the activation of an item.

itm
  reference to the activated item (QTreeWidgetItem)
col
  column the item was activated in (integer)

#### TaskViewer.addFileTask

addFileTask(summary, filename, lineno, taskType=Task.TypeTodo, description="")

Public slot to add a file related task.

summary
  summary text of the task (string)
filename
  filename containing the task (string)
lineno
  line number containing the task (integer)
taskType
  type of the task (one of Task.TypeFixme, Task.TypeTodo, Task.TypeWarning, Task.TypeNote)
description
  explanatory text of the task (string)

#### TaskViewer.addTask

addTask(summary, priority=1, filename="", lineno=0, completed=False, _time=0, isProjectTask=False, taskType=Task.TypeTodo, description="")

Public slot to add a task.

summary
  summary text of the task (string)
priority
  priority of the task (0=high, 1=normal, 2=low)
filename
  filename containing the task (string)
lineno
  line number containing the task (integer)
completed
  flag indicating completion status (boolean)
_time
  creation time of the task (float, if 0 use current time)
isProjectTask
  flag indicating a task related to the current project (boolean)
taskType
  type of the task (one of Task.TypeFixme, Task.TypeTodo, Task.TypeWarning, Task.TypeNote)
description
  explanatory text of the task (string)

#### TaskViewer.clearFileTasks

clearFileTasks(filename, conditionally=False)

Public slot to clear all tasks related to a file.

filename
  name of the file (string)
conditionally
  flag indicating to clear the tasks of the file checking some conditions (boolean)

#### TaskViewer.clearProjectTasks

clearProjectTasks(fileOnly=False)

Public slot to clear project related tasks.

fileOnly=
  flag indicating to clear only file related project tasks (boolean)

#### TaskViewer.clearTasks

clearTasks()

Public slot to clear all tasks from display.

#### TaskViewer.getGlobalTasks

getGlobalTasks()

Public method to retrieve all non project related tasks.

Returns:
  copy of tasks (list of Task)

#### TaskViewer.getProjectTasks

getProjectTasks()

Public method to retrieve all project related tasks.

Returns:
  copy of tasks (list of Task)

#### TaskViewer.handlePreferencesChanged

handlePreferencesChanged()

Public slot to react to changes of the preferences.

#### TaskViewer.saveProjectTasks

saveProjectTasks()

Public method to write the project tasks.

#### TaskViewer.setProjectOpen

setProjectOpen(o=False)

Public slot to set the project status.

o
  flag indicating the project status

Up