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
33685a5d
Commit
33685a5d
authored
Jun 21, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit columns with 'E'.
parent
7fc4c64d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
topydo/ui/Main.py
topydo/ui/Main.py
+17
-3
topydo/ui/TodoListWidget.py
topydo/ui/TodoListWidget.py
+10
-2
No files found.
topydo/ui/Main.py
View file @
33685a5d
...
...
@@ -41,6 +41,9 @@ class UIView(View):
super
(
UIView
,
self
).
__init__
(
p_sorter
,
p_filter
,
p_todolist
)
self
.
data
=
p_data
_NEW_COLUMN
=
1
_EDIT_COLUMN
=
2
class
UIApplication
(
CLIApplicationBase
):
def
__init__
(
self
):
super
(
UIApplication
,
self
).
__init__
()
...
...
@@ -66,7 +69,7 @@ class UIApplication(CLIApplicationBase):
self
.
viewwidget
=
ViewWidget
(
self
.
todolist
)
urwid
.
connect_signal
(
self
.
viewwidget
,
'save'
,
lambda
:
self
.
_
cre
ate_view
(
self
.
viewwidget
.
data
))
lambda
:
self
.
_
upd
ate_view
(
self
.
viewwidget
.
data
))
def
hide_viewwidget
():
self
.
_viewwidget_visible
=
False
...
...
@@ -86,6 +89,8 @@ class UIApplication(CLIApplicationBase):
pop_ups
=
True
)
self
.
column_mode
=
_NEW_COLUMN
def
_output
(
self
,
p_text
):
self
.
_print_to_console
(
p_text
+
"
\
n
"
)
...
...
@@ -142,10 +147,12 @@ class UIApplication(CLIApplicationBase):
def
_new_column
(
self
):
self
.
viewwidget
.
reset
()
self
.
column_mode
=
_NEW_COLUMN
self
.
_viewwidget_visible
=
True
def
_edit_column
(
self
):
self
.
viewwidget
.
data
=
self
.
columns
.
focus
.
view
.
data
self
.
column_mode
=
_EDIT_COLUMN
self
.
_viewwidget_visible
=
True
def
_delete_column
(
self
):
...
...
@@ -196,11 +203,18 @@ class UIApplication(CLIApplicationBase):
return
UIView
(
sorter
,
filters
,
self
.
todolist
,
p_data
)
def
_
cre
ate_view
(
self
,
p_data
):
def
_
upd
ate_view
(
self
,
p_data
):
""" Creates a view from the data entered in the view widget. """
view
=
self
.
_viewdata_to_view
(
p_data
)
self
.
_add_column
(
view
)
if
self
.
column_mode
==
_NEW_COLUMN
:
self
.
_add_column
(
view
)
elif
self
.
column_mode
==
_EDIT_COLUMN
:
current_column
=
self
.
columns
.
focus
current_column
.
title
=
p_data
[
'title'
]
current_column
.
view
=
view
self
.
_viewwidget_visible
=
False
def
_add_column
(
self
,
p_view
):
...
...
topydo/ui/TodoListWidget.py
View file @
33685a5d
...
...
@@ -26,14 +26,14 @@ class TodoListWidget(urwid.LineBox):
# store a state for multi-key shortcuts (e.g. 'gg')
self
.
keystate
=
None
title_widget
=
urwid
.
Filler
(
urwid
.
Text
(
p_title
,
align
=
'center'
)
)
self
.
_title_widget
=
urwid
.
Text
(
p_title
,
align
=
'center'
)
self
.
todolist
=
urwid
.
SimpleFocusListWalker
([])
self
.
listbox
=
urwid
.
ListBox
(
self
.
todolist
)
self
.
view
=
p_view
pile
=
urwid
.
Pile
([
(
1
,
title_widget
),
(
1
,
urwid
.
Filler
(
self
.
_title_widget
)
),
(
1
,
urwid
.
Filler
(
urwid
.
Divider
(
u
(
'
\
u2500
'
)))),
(
'weight'
,
1
,
self
.
listbox
),
])
...
...
@@ -53,6 +53,14 @@ class TodoListWidget(urwid.LineBox):
self
.
_view
=
p_view
self
.
update
()
@
property
def
title
(
self
):
return
self
.
_title_widget
.
text
@
title
.
setter
def
title
(
self
,
p_title
):
self
.
_title_widget
.
set_text
(
p_title
)
def
update
(
self
):
"""
Updates the todo list according to the todos in the view associated
...
...
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