Exec command

This commit is contained in:
veeso
2021-03-21 22:57:05 +01:00
parent 8ff7040a0a
commit 3a1c6cac95
6 changed files with 96 additions and 3 deletions

View File

@@ -186,6 +186,14 @@ impl FileTransferActivity {
self.view.render(super::COMPONENT_INPUT_SAVEAS, f, popup);
}
}
if let Some(mut props) = self.view.get_props(super::COMPONENT_INPUT_EXEC) {
if props.build().visible {
let popup = draw_area_in(f.size(), 40, 10);
f.render_widget(Clear, popup);
// make popup
self.view.render(super::COMPONENT_INPUT_EXEC, f, popup);
}
}
if let Some(mut props) = self.view.get_props(super::COMPONENT_LIST_FILEINFO) {
if props.build().visible {
let popup = draw_area_in(f.size(), 50, 50);
@@ -411,6 +419,22 @@ impl FileTransferActivity {
self.view.umount(super::COMPONENT_INPUT_COPY);
}
pub(super) fn mount_exec(&mut self) {
self.view.mount(
super::COMPONENT_INPUT_EXEC,
Box::new(Input::new(
PropsBuilder::default()
.with_texts(TextParts::new(Some(String::from("Execute command")), None))
.build(),
)),
);
self.view.active(super::COMPONENT_INPUT_EXEC);
}
pub(super) fn umount_exec(&mut self) {
self.view.umount(super::COMPONENT_INPUT_EXEC);
}
pub(super) fn mount_goto(&mut self) {
self.view.mount(
super::COMPONENT_INPUT_GOTO,