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,
// quit
pub quit_title: String,
pub quit_content: String,
pub quit_origin: Origin,
pub quit_offset: Offset,
pub quit_title: String,
pub quit_content: String,
pub quit_origin: Origin,
pub quit_offset: Offset,
// bulk rename
pub bulk_rename_title: String,
pub bulk_rename_title: String,
pub bulk_rename_origin: Origin,
pub bulk_rename_offset: Offset,
}

View file

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

View file

@ -11,7 +11,7 @@ use super::{TASKS_BORDER, TASKS_PADDING, TASKS_PERCENT, TasksProgress};
pub struct Tasks {
pub scheduler: Arc<Scheduler>,
handle: JoinHandle<()>,
handle: JoinHandle<()>,
pub visible: bool,
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 tracing::warn;
use yazi_config::YAZI;
use yazi_fs::{
SizeCalculator, cha::Cha, copy_with_progress, maybe_exists, ok_or_not_found, path_relative_to,
paths_to_same_file, skip_path,
};
use yazi_fs::{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 super::{
FileOp, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpRename, FileOpTrash,
};
use super::{FileOp, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpRename, FileOpTrash};
use crate::{LOW, NORMAL, TaskOp, TaskProg};
pub struct File {

View file

@ -110,7 +110,7 @@ pub struct FileOpTrash {
// --- Rename
#[derive(Clone, Debug)]
pub struct FileOpRename {
pub id: usize,
pub id: usize,
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 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 file: Arc<File>,