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
ea5c6204
Commit
ea5c6204
authored
Jun 21, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to remove a column with 'D'.
parent
45d71dcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
topydo/ui/Main.py
topydo/ui/Main.py
+23
-5
No files found.
topydo/ui/Main.py
View file @
ea5c6204
...
...
@@ -43,8 +43,7 @@ class UIApplication(CLIApplicationBase):
# console widget
self
.
console
=
ConsoleWidget
()
urwid
.
connect_signal
(
self
.
commandline
,
'blur'
,
self
.
_blur_commandline
)
urwid
.
connect_signal
(
self
.
commandline
,
'blur'
,
self
.
_blur_commandline
)
urwid
.
connect_signal
(
self
.
commandline
,
'execute_command'
,
self
.
_execute_handler
)
...
...
@@ -107,12 +106,12 @@ class UIApplication(CLIApplicationBase):
for
column
,
_
in
self
.
columns
.
contents
:
column
.
update
()
def
_focus_commandline
(
self
):
self
.
mainwindow
.
focus_item
=
1
def
_blur_commandline
(
self
):
self
.
mainwindow
.
focus_item
=
0
def
_focus_commandline
(
self
):
self
.
mainwindow
.
focus_item
=
1
def
_focus_first_column
(
self
):
self
.
columns
.
focus_position
=
0
...
...
@@ -133,6 +132,22 @@ class UIApplication(CLIApplicationBase):
self
.
viewwidget
.
reset
()
self
.
_viewwidget_visible
=
True
def
_edit_view
(
self
):
pass
def
_delete_view
(
self
):
try
:
focus
=
self
.
columns
.
focus_position
del
self
.
columns
.
contents
[
focus
]
if
self
.
columns
.
contents
:
self
.
columns
.
focus_position
=
focus
else
:
self
.
_focus_commandline
()
except
IndexError
:
# no columns
pass
def
_handle_input
(
self
,
p_input
):
dispatch
=
{
':'
:
self
.
_focus_commandline
,
...
...
@@ -143,6 +158,8 @@ class UIApplication(CLIApplicationBase):
'right'
:
self
.
_focus_next_column
,
'l'
:
self
.
_focus_next_column
,
'C'
:
self
.
_new_view
,
'E'
:
self
.
_edit_view
,
'D'
:
self
.
_delete_view
,
}
try
:
...
...
@@ -170,6 +187,7 @@ class UIApplication(CLIApplicationBase):
item
=
(
todolist
,
options
)
self
.
columns
.
contents
.
append
(
item
)
self
.
columns
.
focus_position
=
len
(
self
.
columns
.
contents
)
-
1
self
.
_blur_commandline
()
@
property
def
_console_visible
(
self
):
...
...
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