Merge branch 'master' into subtask
This commit is contained in:
28
ui.py
28
ui.py
@@ -12,6 +12,7 @@ palette = [
|
|||||||
('header', 'bold,light green', ''),
|
('header', 'bold,light green', ''),
|
||||||
('secondary', 'light gray', ''),
|
('secondary', 'light gray', ''),
|
||||||
('task', 'light green', ''),
|
('task', 'light green', ''),
|
||||||
|
('project', 'yellow', ''),
|
||||||
('section', 'white', 'dark green'),
|
('section', 'white', 'dark green'),
|
||||||
('workspace', 'white', 'dark blue'),
|
('workspace', 'white', 'dark blue'),
|
||||||
('pager', 'standout', ''),
|
('pager', 'standout', ''),
|
||||||
@@ -71,8 +72,8 @@ class ProjectList(urwid.ListBox):
|
|||||||
self.projects = projects
|
self.projects = projects
|
||||||
|
|
||||||
body = urwid.SimpleFocusListWalker(
|
body = urwid.SimpleFocusListWalker(
|
||||||
[ProjectIcon({'name': 'My Tasks', 'id': None},
|
[urwid.AttrMap(ProjectIcon({'name': 'My Tasks', 'id': None},
|
||||||
self.loadProject),
|
self.loadProject), 'project'),
|
||||||
None]
|
None]
|
||||||
)
|
)
|
||||||
super(ProjectList, self).__init__(body)
|
super(ProjectList, self).__init__(body)
|
||||||
@@ -82,8 +83,8 @@ class ProjectList(urwid.ListBox):
|
|||||||
self.body.pop()
|
self.body.pop()
|
||||||
for i in range(50):
|
for i in range(50):
|
||||||
try:
|
try:
|
||||||
self.body.append(ProjectIcon(self.projects.next(),
|
self.body.append(urwid.AttrMap(ProjectIcon(self.projects.next(),
|
||||||
self.loadProject))
|
self.loadProject), 'project'))
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -267,19 +268,23 @@ class AssigneeTypeAhead(urwid.Pile):
|
|||||||
|
|
||||||
class ProjectTypeAhead(urwid.Pile):
|
class ProjectTypeAhead(urwid.Pile):
|
||||||
def __init__(self, task):
|
def __init__(self, task):
|
||||||
projects = [ProjectIcon(project, self.loadProject)
|
projects = [urwid.AttrMap(ProjectIcon(project, self.loadProject),
|
||||||
|
'project')
|
||||||
for project in task['projects']]
|
for project in task['projects']]
|
||||||
|
|
||||||
self.edit = urwid.Edit('Add Project: ')
|
|
||||||
project.append(self.edit)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if task['parent'] != None:
|
if task['parent'] != None:
|
||||||
parent = TaskEdit(task['parent'])
|
parent = TaskEdit(task['parent'])
|
||||||
urwid.connect_signal(parent, 'updatetask', self.updateSubtask)
|
urwid.connect_signal(parent, 'updatetask', self.updateSubtask)
|
||||||
urwid.connect_signal(parent, 'details', self.showDetails)
|
urwid.connect_signal(parent, 'details', self.showDetails)
|
||||||
projects.append(urwid.AttrMap(parent, 'task'))
|
|
||||||
|
#Remap enter to load details of parent
|
||||||
|
urwid.connect_signal(parent, 'newtask', self.showDetails)
|
||||||
|
projects.append(parent)
|
||||||
|
projects = [ProjectIcon(project, self.loadProject)
|
||||||
|
for project in task['projects']]
|
||||||
|
|
||||||
|
self.edit = urwid.Edit('Add Project: ')
|
||||||
|
project.append(self.edit)
|
||||||
|
|
||||||
class TaskDetails(urwid.ListBox):
|
class TaskDetails(urwid.ListBox):
|
||||||
def __init__(self, task, stories, subtasks):
|
def __init__(self, task, stories, subtasks):
|
||||||
@@ -300,7 +305,6 @@ class TaskDetails(urwid.ListBox):
|
|||||||
urwid.connect_signal(assignee_type_ahead, 'usertypeahead',
|
urwid.connect_signal(assignee_type_ahead, 'usertypeahead',
|
||||||
self.userTypeAhead)
|
self.userTypeAhead)
|
||||||
urwid.connect_signal(assignee_type_ahead, 'assigntask', self.assignTask)
|
urwid.connect_signal(assignee_type_ahead, 'assigntask', self.assignTask)
|
||||||
|
|
||||||
|
|
||||||
all_subtasks = [t for t in subtasks]
|
all_subtasks = [t for t in subtasks]
|
||||||
subtask_list = TaskList(all_subtasks)
|
subtask_list = TaskList(all_subtasks)
|
||||||
|
|||||||
Reference in New Issue
Block a user