Automatically update description when edit looses focus
Closes #42682572598273
This commit is contained in:
16
ui.py
16
ui.py
@@ -236,8 +236,8 @@ class TaskDetails(urwid.Pile):
|
|||||||
comment_edit = CommentEdit(task)
|
comment_edit = CommentEdit(task)
|
||||||
urwid.connect_signal(comment_edit, 'comment', self.comment)
|
urwid.connect_signal(comment_edit, 'comment', self.comment)
|
||||||
|
|
||||||
description_edit = DescriptionEdit(task)
|
self.description_edit = DescriptionEdit(task)
|
||||||
urwid.connect_signal(description_edit, 'updatedescription',
|
urwid.connect_signal(self.description_edit, 'updatedescription',
|
||||||
self.updateDescription)
|
self.updateDescription)
|
||||||
|
|
||||||
task_name_edit = TaskNameEdit(task)
|
task_name_edit = TaskNameEdit(task)
|
||||||
@@ -258,7 +258,7 @@ class TaskDetails(urwid.Pile):
|
|||||||
('pack', task_name_edit),
|
('pack', task_name_edit),
|
||||||
('pack', assignee),
|
('pack', assignee),
|
||||||
('pack', urwid.Divider('-')),
|
('pack', urwid.Divider('-')),
|
||||||
('pack', description_edit),
|
('pack', self.description_edit),
|
||||||
('pack', urwid.Divider('-')),
|
('pack', urwid.Divider('-')),
|
||||||
] + \
|
] + \
|
||||||
[('pack', urwid.Text('[' + story['created_by']['name'] + '] ' + \
|
[('pack', urwid.Text('[' + story['created_by']['name'] + '] ' + \
|
||||||
@@ -269,6 +269,16 @@ class TaskDetails(urwid.Pile):
|
|||||||
|
|
||||||
super(TaskDetails, self).__init__(body)
|
super(TaskDetails, self).__init__(body)
|
||||||
|
|
||||||
|
def keypress(self, size, key):
|
||||||
|
key = super(TaskDetails, self).keypress(size, key)
|
||||||
|
|
||||||
|
if self.focus != self.description_edit and \
|
||||||
|
self.description_edit.edit_text != self.task['notes']:
|
||||||
|
self.updateDescription(self.task['id'],
|
||||||
|
self.description_edit.edit_text)
|
||||||
|
|
||||||
|
return key
|
||||||
|
|
||||||
def comment(self, task_id, comment):
|
def comment(self, task_id, comment):
|
||||||
urwid.emit_signal(self, 'comment', task_id, comment)
|
urwid.emit_signal(self, 'comment', task_id, comment)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user