quick cleanup to some untranslated strings, moving zip extract dir creation order
This commit is contained in:
parent
22552c658f
commit
a4d7a377d3
3 changed files with 28 additions and 7 deletions
|
|
@ -39,6 +39,9 @@ resume = Resume
|
|||
## Compress Dialog
|
||||
create-archive = Create archive
|
||||
|
||||
## Extract Dialog
|
||||
extract-password-required = Password required
|
||||
|
||||
## Empty Trash Dialog
|
||||
empty-trash = Empty trash
|
||||
empty-trash-warning = Are you sure you want to permanently delete all the items in Trash?
|
||||
|
|
|
|||
|
|
@ -3677,7 +3677,7 @@ impl Application for App {
|
|||
let password_unwrapped = password.clone().unwrap_or_else(String::default);
|
||||
dialog = dialog.control(
|
||||
widget::column::with_children(vec![
|
||||
widget::text::body("Password").into(),
|
||||
widget::text::body(fl!("password")).into(),
|
||||
widget::text_input("", password_unwrapped).password().on_input(move |password_unwrapped| {
|
||||
Message::DialogUpdate(DialogPage::Compress {
|
||||
paths: paths.clone(),
|
||||
|
|
@ -3723,7 +3723,7 @@ impl Application for App {
|
|||
password
|
||||
} => {
|
||||
widget::dialog()
|
||||
.title("Password required")
|
||||
.title(fl!("extract-password-required"))
|
||||
.icon(widget::icon::from_name("dialog-error").size(64))
|
||||
.control(widget::text_input("", password).password().on_input(move |password| {
|
||||
Message::DialogUpdate(DialogPage::ExtractPassword {
|
||||
|
|
@ -3732,7 +3732,7 @@ impl Application for App {
|
|||
})
|
||||
}))
|
||||
.primary_action(
|
||||
widget::button::suggested(fl!("create")).on_press(Message::DialogComplete),
|
||||
widget::button::suggested(fl!("extract-here")).on_press(Message::DialogComplete),
|
||||
)
|
||||
}
|
||||
DialogPage::MountError {
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ fn zip_extract<R: io::Read + io::Seek, P: AsRef<Path>>(
|
|||
let mut files_by_unix_mode = Vec::new();
|
||||
let mut buffer = vec![0; 4 * 1024 * 1024];
|
||||
let total_files = archive.len();
|
||||
let mut pending_directory_creates = Vec::new();
|
||||
|
||||
for i in 0..total_files {
|
||||
controller
|
||||
.check()
|
||||
|
|
@ -137,7 +139,7 @@ fn zip_extract<R: io::Read + io::Seek, P: AsRef<Path>>(
|
|||
let outpath = directory.as_ref().join(filepath);
|
||||
|
||||
if file.is_dir() {
|
||||
make_writable_dir_all(&outpath)?;
|
||||
pending_directory_creates.push(outpath.clone());
|
||||
continue;
|
||||
}
|
||||
let symlink_target = if file.is_symlink() && (cfg!(unix) || cfg!(windows)) {
|
||||
|
|
@ -148,10 +150,16 @@ fn zip_extract<R: io::Read + io::Seek, P: AsRef<Path>>(
|
|||
None
|
||||
};
|
||||
drop(file);
|
||||
if let Some(p) = outpath.parent() {
|
||||
make_writable_dir_all(p)?;
|
||||
}
|
||||
if let Some(target) = symlink_target {
|
||||
// create all pending dirs
|
||||
while let Some(pending_dir) = pending_directory_creates.pop() {
|
||||
make_writable_dir_all(pending_dir)?;
|
||||
}
|
||||
|
||||
if let Some(p) = outpath.parent() {
|
||||
make_writable_dir_all(p)?;
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::ffi::OsStringExt;
|
||||
|
|
@ -186,6 +194,16 @@ fn zip_extract<R: io::Read + io::Seek, P: AsRef<Path>>(
|
|||
None => archive.by_index(i),
|
||||
Some(pwd) => archive.by_index_decrypt(i, pwd.as_bytes())
|
||||
}.map_err(|e| e)?;
|
||||
|
||||
// create all pending dirs
|
||||
while let Some(pending_dir) = pending_directory_creates.pop() {
|
||||
make_writable_dir_all(pending_dir)?;
|
||||
}
|
||||
|
||||
if let Some(p) = outpath.parent() {
|
||||
make_writable_dir_all(p)?;
|
||||
}
|
||||
|
||||
let total = file.size();
|
||||
let mut outfile = fs::File::create(&outpath)?;
|
||||
let mut current = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue