Copy feature in ui; new keybinding <C>

This commit is contained in:
ChristianVisintin
2020-12-21 11:11:29 +01:00
parent 08728bf55e
commit 3901ed54c6
6 changed files with 137 additions and 16 deletions

View File

@@ -177,6 +177,20 @@ impl FileTransferActivity {
}
}
KeyCode::Char(ch) => match ch {
'c' | 'C' => {
// Copy
self.input_mode = InputMode::Popup(PopupType::Input(
String::from("Insert destination name"),
FileTransferActivity::callback_copy,
));
}
'd' | 'D' => {
// Make directory
self.input_mode = InputMode::Popup(PopupType::Input(
String::from("Insert directory name"),
FileTransferActivity::callback_mkdir,
));
}
'e' | 'E' => {
// Get file at index
if let Some(entry) = self.local.files.get(self.local.index) {
@@ -201,13 +215,6 @@ impl FileTransferActivity {
FileTransferActivity::callback_change_directory,
));
}
'd' | 'D' => {
// Make directory
self.input_mode = InputMode::Popup(PopupType::Input(
String::from("Insert directory name"),
FileTransferActivity::callback_mkdir,
));
}
'h' | 'H' => {
// Show help
self.input_mode = InputMode::Popup(PopupType::Help);
@@ -389,6 +396,20 @@ impl FileTransferActivity {
}
}
KeyCode::Char(ch) => match ch {
'c' | 'C' => {
// Copy
self.input_mode = InputMode::Popup(PopupType::Input(
String::from("Insert destination name"),
FileTransferActivity::callback_copy,
));
}
'd' | 'D' => {
// Make directory
self.input_mode = InputMode::Popup(PopupType::Input(
String::from("Insert directory name"),
FileTransferActivity::callback_mkdir,
));
}
'e' | 'E' => {
// Get file at index
if let Some(entry) = self.remote.files.get(self.remote.index) {
@@ -405,13 +426,6 @@ impl FileTransferActivity {
))
}
}
'd' | 'D' => {
// Make directory
self.input_mode = InputMode::Popup(PopupType::Input(
String::from("Insert directory name"),
FileTransferActivity::callback_mkdir,
));
}
'g' | 'G' => {
// Goto
// Show input popup