Move files to prepare for setup tools and add ability to delete tasks
This commit is contained in:
parent
34b5ae35c7
commit
7571a949cb
@ -120,3 +120,6 @@ class Board:
|
||||
"""Add a task to icol"""
|
||||
self.tasks[icol].append(task)
|
||||
|
||||
def del_task(self, icol, itask):
|
||||
del self.tasks[icol][itask]
|
||||
|
@ -37,12 +37,13 @@ EditColScreen {
|
||||
content-align: center top;
|
||||
color: #ebdbb9;
|
||||
text-style: underline;
|
||||
padding: 1;
|
||||
}
|
||||
.header-focused {
|
||||
content-align: center top;
|
||||
color: #458588;
|
||||
text-style: underline;
|
||||
|
||||
padding: 1;
|
||||
}
|
||||
|
||||
ListItem{
|
@ -130,13 +130,14 @@ class EditColScreen(Screen):
|
||||
class KanbanForm(App):
|
||||
CSS_PATH = 'layout.tcss'
|
||||
BINDINGS = [
|
||||
Binding("l", "fnext", "Focus Next", show=False, ),
|
||||
Binding("a", "new_task", "Add New Task", show=False, ),
|
||||
Binding("l", "fnext", "Focus Next", show=False, ),
|
||||
Binding("h", "fprev", "Focus Prev", show=False, ),
|
||||
Binding("L", "move_up", "Focus Next", show=False),
|
||||
Binding("H", "move_down", "Focus Prev", show=False),
|
||||
Binding("e", "edit_task", "Edit Task", show=False,),
|
||||
Binding("r", "edit_column", "Edit Column Name", show=False,),
|
||||
Binding("d", "delete_task", "Delete Task", show=False,),
|
||||
Binding('q', 'exit', "Exit")
|
||||
]
|
||||
|
||||
@ -229,6 +230,11 @@ class KanbanForm(App):
|
||||
text = self.board.get_columns()[icol]
|
||||
self.push_screen(EditColScreen(text), self.update_col)
|
||||
|
||||
def action_delete_task(self):
|
||||
icol, itask = self.get_col_task()
|
||||
self.focused.highlighted_child.remove()
|
||||
self.board.del_task(icol,itask)
|
||||
|
||||
def update_col(self, text):
|
||||
""" Update the column
|
||||
"""
|
||||
@ -283,7 +289,7 @@ class KanbanForm(App):
|
||||
icol,_ = self.get_col_task()
|
||||
self.focused.mount(ListItem(Label(task.summary)))
|
||||
self.board.add_task(icol, task)
|
||||
self.focused.highlighted_child
|
||||
self.focused.action_cursor_down()
|
||||
|
||||
# def on_key(self):
|
||||
# with open('log','a') as f:
|
Reference in New Issue
Block a user