mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
InputMode as Option<Popup> in FileTransferActivity
This commit is contained in:
@@ -20,10 +20,7 @@
|
||||
*/
|
||||
|
||||
// Locals
|
||||
use super::{
|
||||
Color, ConfigClient, FileTransferActivity, InputField, InputMode, LogLevel, LogRecord,
|
||||
PopupType,
|
||||
};
|
||||
use super::{Color, ConfigClient, FileTransferActivity, InputField, LogLevel, LogRecord, Popup};
|
||||
use crate::fs::explorer::{builder::FileExplorerBuilder, FileExplorer, FileSorting, GroupDirs};
|
||||
use crate::system::environment;
|
||||
use crate::system::sshkey_storage::SshKeyStorage;
|
||||
@@ -59,14 +56,14 @@ impl FileTransferActivity {
|
||||
LogLevel::Warn => Color::Yellow,
|
||||
};
|
||||
self.log(level, msg.as_str());
|
||||
self.input_mode = InputMode::Popup(PopupType::Alert(color, msg));
|
||||
self.popup = Some(Popup::Alert(color, msg));
|
||||
}
|
||||
|
||||
/// ### create_quit_popup
|
||||
///
|
||||
/// Create quit popup input mode (since must be shared between different input handlers)
|
||||
pub(super) fn create_disconnect_popup(&mut self) -> InputMode {
|
||||
InputMode::Popup(PopupType::YesNo(
|
||||
pub(super) fn create_disconnect_popup(&mut self) -> Option<Popup> {
|
||||
Some(Popup::YesNo(
|
||||
String::from("Are you sure you want to disconnect?"),
|
||||
FileTransferActivity::disconnect,
|
||||
FileTransferActivity::callback_nothing_to_do,
|
||||
@@ -76,8 +73,8 @@ impl FileTransferActivity {
|
||||
/// ### create_quit_popup
|
||||
///
|
||||
/// Create quit popup input mode (since must be shared between different input handlers)
|
||||
pub(super) fn create_quit_popup(&mut self) -> InputMode {
|
||||
InputMode::Popup(PopupType::YesNo(
|
||||
pub(super) fn create_quit_popup(&mut self) -> Option<Popup> {
|
||||
Some(Popup::YesNo(
|
||||
String::from("Are you sure you want to quit?"),
|
||||
FileTransferActivity::disconnect_and_quit,
|
||||
FileTransferActivity::callback_nothing_to_do,
|
||||
|
||||
Reference in New Issue
Block a user