Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
93ac32e6
Commit
93ac32e6
authored
Mar 10, 2017
by
Bram Schoenmakers
Committed by
GitHub
Mar 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #175 from mruwek/select-all
Introduce new 'mark_all' action in Column UI
parents
c6960e71
4bae3b95
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
+24
-4
topydo.conf
topydo.conf
+1
-0
topydo/lib/Config.py
topydo/lib/Config.py
+2
-0
topydo/ui/columns/Main.py
topydo/ui/columns/Main.py
+11
-3
topydo/ui/columns/TodoListWidget.py
topydo/ui/columns/TodoListWidget.py
+10
-1
No files found.
topydo.conf
View file @
93ac32e6
...
@@ -94,6 +94,7 @@ pp = postpone
...
@@ -94,6 +94,7 @@ pp = postpone
ps
=
postpone_s
ps
=
postpone_s
pr
=
pri
pr
=
pri
m
=
mark
m
=
mark
<
C
-
a
> =
mark_all
0
=
first_column
0
=
first_column
$ =
last_column
$ =
last_column
h
=
prev_column
h
=
prev_column
...
...
topydo/lib/Config.py
View file @
93ac32e6
...
@@ -53,6 +53,7 @@ class _Config:
...
@@ -53,6 +53,7 @@ class _Config:
'add'
,
'add'
,
'aliases'
,
'aliases'
,
'colorscheme'
,
'colorscheme'
,
'column_keymap'
,
'columns'
,
'columns'
,
'dep'
,
'dep'
,
'ls'
,
'ls'
,
...
@@ -140,6 +141,7 @@ class _Config:
...
@@ -140,6 +141,7 @@ class _Config:
'u'
:
'cmd revert'
,
'u'
:
'cmd revert'
,
'x'
:
'cmd do {}'
,
'x'
:
'cmd do {}'
,
'm'
:
'mark'
,
'm'
:
'mark'
,
'<C-a>'
:
'mark_all'
,
'.'
:
'repeat'
,
'.'
:
'repeat'
,
'pp'
:
'postpone'
,
'pp'
:
'postpone'
,
'ps'
:
'postpone_s'
,
'ps'
:
'postpone_s'
,
...
...
topydo/ui/columns/Main.py
View file @
93ac32e6
...
@@ -630,13 +630,21 @@ class UIApplication(CLIApplicationBase):
...
@@ -630,13 +630,21 @@ class UIApplication(CLIApplicationBase):
def
_has_marked_todos
(
self
):
def
_has_marked_todos
(
self
):
return
len
(
self
.
marked_todos
)
>
0
return
len
(
self
.
marked_todos
)
>
0
def
_process_mark_toggle
(
self
,
p_todo_id
):
def
_process_mark_toggle
(
self
,
p_todo_id
,
p_force
=
None
):
"""
"""
Adds p_todo_id to marked_todos attribute and returns True if p_todo_id
Adds p_todo_id to marked_todos attribute and returns True if p_todo_id
is not already
present
. Removes p_todo_id from marked_todos and returns
is not already
marked
. Removes p_todo_id from marked_todos and returns
False otherwise.
False otherwise.
p_force parameter accepting 'mark' or 'unmark' values, if set, can force
desired action without checking p_todo_id presence in marked_todos.
"""
"""
if
p_todo_id
not
in
self
.
marked_todos
:
if
p_force
in
[
'mark'
,
'unmark'
]:
action
=
p_force
else
:
action
=
'mark'
if
p_todo_id
not
in
self
.
marked_todos
else
'unmark'
if
action
==
'mark'
:
self
.
marked_todos
.
add
(
p_todo_id
)
self
.
marked_todos
.
add
(
p_todo_id
)
return
True
return
True
else
:
else
:
...
...
topydo/ui/columns/TodoListWidget.py
View file @
93ac32e6
...
@@ -220,6 +220,13 @@ class TodoListWidget(urwid.LineBox):
...
@@ -220,6 +220,13 @@ class TodoListWidget(urwid.LineBox):
# No todo item selected
# No todo item selected
pass
pass
def
_mark_all
(
self
):
for
todo
in
self
.
listbox
.
body
:
if
isinstance
(
todo
,
TodoWidget
):
todo_id
=
str
(
self
.
view
.
todolist
.
number
(
todo
.
todo
))
urwid
.
emit_signal
(
self
,
'toggle_mark'
,
todo_id
,
'mark'
)
todo
.
mark
()
def
_execute_on_selected
(
self
,
p_cmd_str
,
p_execute_signal
):
def
_execute_on_selected
(
self
,
p_cmd_str
,
p_execute_signal
):
"""
"""
Executes command specified by p_cmd_str on selected todo item.
Executes command specified by p_cmd_str on selected todo item.
...
@@ -272,7 +279,7 @@ class TodoListWidget(urwid.LineBox):
...
@@ -272,7 +279,7 @@ class TodoListWidget(urwid.LineBox):
'first_column', 'last_column', 'prev_column', 'next_column',
'first_column', 'last_column', 'prev_column', 'next_column',
'append_column', 'insert_column', 'edit_column', 'delete_column',
'append_column', 'insert_column', 'edit_column', 'delete_column',
'copy_column', swap_right', 'swap_left', 'postpone', 'postpone_s',
'copy_column', swap_right', 'swap_left', 'postpone', 'postpone_s',
'pri', 'mark', 'reset' and 'repeat'.
'pri', 'mark', '
mark_all, '
reset' and 'repeat'.
"""
"""
column_actions
=
[
'first_column'
,
column_actions
=
[
'first_column'
,
'last_column'
,
'last_column'
,
...
@@ -302,6 +309,8 @@ class TodoListWidget(urwid.LineBox):
...
@@ -302,6 +309,8 @@ class TodoListWidget(urwid.LineBox):
pass
pass
elif
p_action_str
==
'mark'
:
elif
p_action_str
==
'mark'
:
self
.
_toggle_marked_status
()
self
.
_toggle_marked_status
()
elif
p_action_str
==
'mark_all'
:
self
.
_mark_all
()
elif
p_action_str
==
'repeat'
:
elif
p_action_str
==
'repeat'
:
self
.
_repeat_cmd
()
self
.
_repeat_cmd
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment