Commit 0b07837f authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add functionality to copy a column with 'Y'.

parent 33685a5d
...@@ -43,6 +43,7 @@ class UIView(View): ...@@ -43,6 +43,7 @@ class UIView(View):
_NEW_COLUMN = 1 _NEW_COLUMN = 1
_EDIT_COLUMN = 2 _EDIT_COLUMN = 2
_COPY_COLUMN = 3
class UIApplication(CLIApplicationBase): class UIApplication(CLIApplicationBase):
def __init__(self): def __init__(self):
...@@ -168,6 +169,11 @@ class UIApplication(CLIApplicationBase): ...@@ -168,6 +169,11 @@ class UIApplication(CLIApplicationBase):
# no columns # no columns
pass pass
def _copy_column(self):
self.viewwidget.data = self.columns.focus.view.data
self.column_mode = _COPY_COLUMN
self._viewwidget_visible = True
def _handle_input(self, p_input): def _handle_input(self, p_input):
dispatch = { dispatch = {
':': self._focus_commandline, ':': self._focus_commandline,
...@@ -180,6 +186,7 @@ class UIApplication(CLIApplicationBase): ...@@ -180,6 +186,7 @@ class UIApplication(CLIApplicationBase):
'N': self._new_column, 'N': self._new_column,
'E': self._edit_column, 'E': self._edit_column,
'D': self._delete_column, 'D': self._delete_column,
'Y': self._copy_column,
} }
try: try:
...@@ -207,7 +214,7 @@ class UIApplication(CLIApplicationBase): ...@@ -207,7 +214,7 @@ class UIApplication(CLIApplicationBase):
""" Creates a view from the data entered in the view widget. """ """ Creates a view from the data entered in the view widget. """
view = self._viewdata_to_view(p_data) view = self._viewdata_to_view(p_data)
if self.column_mode == _NEW_COLUMN: if self.column_mode == _NEW_COLUMN or self.column_mode == _COPY_COLUMN:
self._add_column(view) self._add_column(view)
elif self.column_mode == _EDIT_COLUMN: elif self.column_mode == _EDIT_COLUMN:
current_column = self.columns.focus current_column = self.columns.focus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment