diff --git a/rm-main/src/ui/tabs/torrents/task_manager.rs b/rm-main/src/ui/tabs/torrents/task_manager.rs index ec24979..e66f2dd 100644 --- a/rm-main/src/ui/tabs/torrents/task_manager.rs +++ b/rm-main/src/ui/tabs/torrents/task_manager.rs @@ -147,92 +147,3 @@ impl TaskManager { } } } - -// enum CurrentTaskState { -// Nothing, -// Loading(Arc>), -// Success(), -// Failure(), -// } -// -// impl CurrentTaskState { -// fn new() -> Self { -// Self::Nothing -// } -// -// fn loading(&mut self, state: Arc>) { -// *self = Self::Loading(task, state); -// } -// -// fn failure(&mut self) { -// *self = Self::Failure(task); -// } -// -// fn success(&mut self, task: CurrentTask) { -// *self = Self::Success(task); -// } -// } -// -// impl Component for CurrentTaskState { -// fn render(&mut self, f: &mut Frame, rect: Rect) { -// match self { -// CurrentTaskState::Nothing => return, -// CurrentTaskState::Loading(task, state) => { -// let label = match task { -// CurrentTask::DeleteBar(_) => Some("Deleting..."), -// CurrentTask::AddMagnetBar(_) => Some("Adding..."), -// _ => None, -// }; -// -// if let Some(text) = label { -// let default_throbber = throbber_widgets_tui::Throbber::default() -// .label(text) -// .style(ratatui::style::Style::default().fg(ratatui::style::Color::Yellow)); -// f.render_stateful_widget( -// default_throbber.clone(), -// rect, -// &mut state.lock().unwrap(), -// ); -// } -// } -// CurrentTaskState::Failure(task) => { -// let label = match task { -// CurrentTask::DeleteBar(_) => Some(" Error deleting torrent"), -// CurrentTask::AddMagnetBar(_) => Some(" Error adding torrent"), -// _ => None, -// }; -// if let Some(text) = label { -// let mut line = Line::default(); -// line.push_span(Span::styled("", Style::default().red())); -// line.push_span(Span::raw(text)); -// let paragraph = Paragraph::new(line); -// f.render_widget(paragraph, rect); -// } -// } -// CurrentTaskState::Success(task) => { -// let label = match task { -// CurrentTask::DeleteBar(_) => Some(" Deleted torrent"), -// CurrentTask::AddMagnetBar(_) => Some(" Added torrent"), -// _ => None, -// }; -// if let Some(text) = label { -// let mut line = Line::default(); -// line.push_span(Span::styled("", Style::default().green())); -// line.push_span(Span::raw(text)); -// let paragraph = Paragraph::new(line); -// f.render_widget(paragraph, rect); -// } -// } -// } -// } -// -// fn tick(&mut self) -> Option { -// match self { -// CurrentTaskState::Loading(_, state) => { -// state.lock().unwrap().calc_next(); -// Some(Action::Render) -// } -// _ => None, -// } -// } -// }