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
7805d35a
Commit
7805d35a
authored
Nov 27, 2016
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add group support to the column UI
parent
902ee572
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
9 deletions
+23
-9
topydo/ui/columns/ColumnLayout.py
topydo/ui/columns/ColumnLayout.py
+2
-0
topydo/ui/columns/Main.py
topydo/ui/columns/Main.py
+2
-1
topydo/ui/columns/TodoListWidget.py
topydo/ui/columns/TodoListWidget.py
+11
-5
topydo/ui/columns/ViewWidget.py
topydo/ui/columns/ViewWidget.py
+7
-3
topydo_columns.conf
topydo_columns.conf
+1
-0
No files found.
topydo/ui/columns/ColumnLayout.py
View file @
7805d35a
...
...
@@ -30,6 +30,7 @@ def columns(p_alt_layout_path=None):
column_dict
[
'title'
]
=
p_cp
.
get
(
p_column
,
'title'
)
column_dict
[
'filterexpr'
]
=
p_cp
.
get
(
p_column
,
'filterexpr'
)
column_dict
[
'sortexpr'
]
=
p_cp
.
get
(
p_column
,
'sortexpr'
)
column_dict
[
'groupexpr'
]
=
p_cp
.
get
(
p_column
,
'groupexpr'
)
column_dict
[
'show_all'
]
=
p_cp
.
getboolean
(
p_column
,
'show_all'
)
return
column_dict
...
...
@@ -38,6 +39,7 @@ def columns(p_alt_layout_path=None):
'title'
:
'Yet another column'
,
'filterexpr'
:
''
,
'sortexpr'
:
config
().
sort_string
(),
'groupexpr'
:
config
().
group_string
(),
'show_all'
:
'0'
,
}
...
...
topydo/ui/columns/Main.py
View file @
7805d35a
...
...
@@ -413,7 +413,7 @@ class UIApplication(CLIApplicationBase):
"""
Converts a dictionary describing a view to an actual UIView instance.
"""
sorter
=
Sorter
(
p_data
[
'sortexpr'
])
sorter
=
Sorter
(
p_data
[
'sortexpr'
]
,
p_data
[
'groupexpr'
]
)
filters
=
[]
if
not
p_data
[
'show_all'
]:
...
...
@@ -607,6 +607,7 @@ class UIApplication(CLIApplicationBase):
dummy
=
{
"title"
:
"All tasks"
,
"sortexpr"
:
"desc:prio"
,
"groupexpr"
:
""
,
"filterexpr"
:
""
,
"show_all"
:
True
,
}
...
...
topydo/ui/columns/TodoListWidget.py
View file @
7805d35a
...
...
@@ -92,11 +92,17 @@ class TodoListWidget(urwid.LineBox):
del
self
.
todolist
[:]
for
todo
in
self
.
view
.
todos
:
todowidget
=
TodoWidget
.
create
(
todo
)
todowidget
.
number
=
self
.
view
.
todolist
.
number
(
todo
)
self
.
todolist
.
append
(
todowidget
)
self
.
todolist
.
append
(
urwid
.
Divider
(
'-'
))
for
group
,
todos
in
self
.
view
.
groups
.
items
():
if
len
(
self
.
view
.
groups
)
>
1
:
grouplabel
=
", "
.
join
(
group
)
self
.
todolist
.
append
(
urwid
.
Text
(
grouplabel
))
self
.
todolist
.
append
(
urwid
.
Divider
(
'-'
))
for
todo
in
todos
:
todowidget
=
TodoWidget
.
create
(
todo
)
todowidget
.
number
=
self
.
view
.
todolist
.
number
(
todo
)
self
.
todolist
.
append
(
todowidget
)
self
.
todolist
.
append
(
urwid
.
Divider
(
'-'
))
if
old_focus_position
:
try
:
...
...
topydo/ui/columns/ViewWidget.py
View file @
7805d35a
...
...
@@ -24,16 +24,18 @@ class ViewWidget(urwid.LineBox):
self
.
titleedit
=
urwid
.
Edit
(
"Title: "
,
""
)
self
.
sortedit
=
urwid
.
Edit
(
"Sort expression: "
,
""
)
self
.
groupedit
=
urwid
.
Edit
(
"Group expression: "
,
""
)
self
.
filteredit
=
urwid
.
Edit
(
"Filter expression: "
,
""
)
group
=
[]
self
.
relevantradio
=
urwid
.
RadioButton
(
group
,
"Only show relevant todo items"
,
True
)
self
.
allradio
=
urwid
.
RadioButton
(
group
,
"Show all todo items"
)
radio
group
=
[]
self
.
relevantradio
=
urwid
.
RadioButton
(
radio
group
,
"Only show relevant todo items"
,
True
)
self
.
allradio
=
urwid
.
RadioButton
(
radio
group
,
"Show all todo items"
)
self
.
pile
=
urwid
.
Pile
([
self
.
filteredit
,
self
.
titleedit
,
self
.
sortedit
,
self
.
groupedit
,
self
.
relevantradio
,
self
.
allradio
,
urwid
.
Button
(
"Save"
,
lambda
_
:
urwid
.
emit_signal
(
self
,
'save'
)),
...
...
@@ -51,6 +53,7 @@ class ViewWidget(urwid.LineBox):
return
{
'title'
:
self
.
titleedit
.
edit_text
or
self
.
filteredit
.
edit_text
,
'sortexpr'
:
self
.
sortedit
.
edit_text
or
config
().
sort_string
(),
'groupexpr'
:
self
.
groupedit
.
edit_text
or
config
().
group_string
(),
'filterexpr'
:
self
.
filteredit
.
edit_text
,
'show_all'
:
self
.
allradio
.
state
,
}
...
...
@@ -59,6 +62,7 @@ class ViewWidget(urwid.LineBox):
def
data
(
self
,
p_data
):
self
.
titleedit
.
edit_text
=
p_data
[
'title'
]
self
.
sortedit
.
edit_text
=
p_data
[
'sortexpr'
]
self
.
groupedit
.
edit_text
=
p_data
[
'groupexpr'
]
self
.
filteredit
.
edit_text
=
p_data
[
'filterexpr'
]
self
.
relevantradio
.
set_state
(
not
p_data
[
'show_all'
])
self
.
allradio
.
set_state
(
p_data
[
'show_all'
])
...
...
topydo_columns.conf
View file @
7805d35a
[
all
]
title
=
All
tasks
filterexpr
=
groupexpr
=
project
[
today
]
title
=
Due
today
...
...
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