This commit is contained in:
TD-Sky 2025-05-01 20:53:09 +08:00
parent 82056280b3
commit 013d00f577
6 changed files with 17 additions and 32 deletions

View file

@ -22,12 +22,12 @@ pub struct Confirm {
pub overwrite_offset: Offset, pub overwrite_offset: Offset,
// quit // quit
pub quit_title: String, pub quit_title: String,
pub quit_content: String, pub quit_content: String,
pub quit_origin: Origin, pub quit_origin: Origin,
pub quit_offset: Offset, pub quit_offset: Offset,
// bulk rename // bulk rename
pub bulk_rename_title: String, pub bulk_rename_title: String,
pub bulk_rename_origin: Origin, pub bulk_rename_origin: Origin,
pub bulk_rename_offset: Offset, pub bulk_rename_offset: Offset,
} }

View file

@ -1,17 +1,8 @@
use std::{ use std::{borrow::Cow, collections::HashMap, ffi::{OsStr, OsString}, path::PathBuf, sync::Arc};
borrow::Cow,
collections::HashMap,
ffi::{OsStr, OsString},
path::PathBuf,
sync::Arc,
};
use anyhow::Result; use anyhow::Result;
use scopeguard::defer; use scopeguard::defer;
use tokio::{ use tokio::{fs::{self, OpenOptions}, io::AsyncWriteExt};
fs::{self, OpenOptions},
io::AsyncWriteExt,
};
use yazi_config::{YAZI, popup::ConfirmCfg}; use yazi_config::{YAZI, popup::ConfirmCfg};
use yazi_fs::max_common_root; use yazi_fs::max_common_root;
use yazi_proxy::{AppProxy, ConfirmProxy, TasksProxy}; use yazi_proxy::{AppProxy, ConfirmProxy, TasksProxy};
@ -43,11 +34,10 @@ impl Mgr {
.await?; .await?;
defer! { tokio::spawn(fs::remove_file(tmp.clone())); } defer! { tokio::spawn(fs::remove_file(tmp.clone())); }
TasksProxy::process_exec( TasksProxy::process_exec(Cow::Borrowed(opener), cwd, vec![
Cow::Borrowed(opener), OsString::new(),
cwd, tmp.to_owned().into(),
vec![OsString::new(), tmp.to_owned().into()], ])
)
.await; .await;
let new: Vec<_> = let new: Vec<_> =

View file

@ -11,7 +11,7 @@ use super::{TASKS_BORDER, TASKS_PADDING, TASKS_PERCENT, TasksProgress};
pub struct Tasks { pub struct Tasks {
pub scheduler: Arc<Scheduler>, pub scheduler: Arc<Scheduler>,
handle: JoinHandle<()>, handle: JoinHandle<()>,
pub visible: bool, pub visible: bool,
pub cursor: usize, pub cursor: usize,

View file

@ -4,15 +4,10 @@ use anyhow::{Result, anyhow};
use tokio::{fs::{self, DirEntry}, io::{self, ErrorKind::{AlreadyExists, NotFound}}, sync::mpsc}; use tokio::{fs::{self, DirEntry}, io::{self, ErrorKind::{AlreadyExists, NotFound}}, sync::mpsc};
use tracing::warn; use tracing::warn;
use yazi_config::YAZI; use yazi_config::YAZI;
use yazi_fs::{ use yazi_fs::{SizeCalculator, cha::Cha, copy_with_progress, maybe_exists, ok_or_not_found, path_relative_to, paths_to_same_file, skip_path};
SizeCalculator, cha::Cha, copy_with_progress, maybe_exists, ok_or_not_found, path_relative_to,
paths_to_same_file, skip_path,
};
use yazi_shared::url::Url; use yazi_shared::url::Url;
use super::{ use super::{FileOp, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpRename, FileOpTrash};
FileOp, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpRename, FileOpTrash,
};
use crate::{LOW, NORMAL, TaskOp, TaskProg}; use crate::{LOW, NORMAL, TaskOp, TaskProg};
pub struct File { pub struct File {

View file

@ -110,7 +110,7 @@ pub struct FileOpTrash {
// --- Rename // --- Rename
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct FileOpRename { pub struct FileOpRename {
pub id: usize, pub id: usize,
pub from: Url, pub from: Url,
pub to: Url, pub to: Url,
} }

View file

@ -11,7 +11,7 @@ use yazi_proxy::{MgrProxy, options::{PluginOpt, ProcessExecOpt}};
use yazi_shared::{Throttle, url::Url}; use yazi_shared::{Throttle, url::Url};
use super::{Ongoing, TaskProg, TaskStage}; use super::{Ongoing, TaskProg, TaskStage};
use crate::{file::{File, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpRename, FileOpTrash}, plugin::{Plugin, PluginOpEntry}, prework::{Prework, PreworkOpFetch, PreworkOpLoad, PreworkOpSize}, process::{Process, ProcessOpBg, ProcessOpBlock, ProcessOpOrphan}, TaskKind, TaskOp, HIGH, LOW, NORMAL}; use crate::{HIGH, LOW, NORMAL, TaskKind, TaskOp, file::{File, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpRename, FileOpTrash}, plugin::{Plugin, PluginOpEntry}, prework::{Prework, PreworkOpFetch, PreworkOpLoad, PreworkOpSize}, process::{Process, ProcessOpBg, ProcessOpBlock, ProcessOpOrphan}};
pub struct Scheduler { pub struct Scheduler {
pub file: Arc<File>, pub file: Arc<File>,