fix: file transfer, show error, msgbox (#9389)

* fix: file transfer, show error, msgbox

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: translation

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-09-18 19:29:35 +08:00
committed by GitHub
parent e5ec6957fe
commit d08c335fdf
46 changed files with 88 additions and 15 deletions

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", "Възобновяване"),
("Invalid file name", "Невалидно име за файл"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "父目录"),
("Resume", "继续"),
("Invalid file name", "无效文件名"),
("one-way-file-transfer-tip", "被控端启用了单项文件传输"),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Rodičovský adresář"),
("Resume", "Pokračovat"),
("Invalid file name", "Nesprávný název souboru"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "mappe"),
("Resume", "Fortsæt"),
("Invalid file name", "Ugyldigt filnavn"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Übergeordnetes Verzeichnis"),
("Resume", "Fortsetzen"),
("Invalid file name", "Ungültiger Dateiname"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -234,5 +234,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("About RustDesk", ""),
("network_error_tip", "Please check your network connection, then click retry."),
("enable-trusted-devices-tip", "Skip 2FA verification on trusted devices"),
("one-way-file-transfer-tip", "One-way file transfer is enabled on the controlled side."),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Directorio superior"),
("Resume", "Continuar"),
("Invalid file name", "Nombre de archivo no válido"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Cartella principale"),
("Resume", "Riprendi"),
("Invalid file name", "Nome file non valido"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "親ディレクトリ"),
("Resume", "再開"),
("Invalid file name", "無効なファイル名"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Vecākdirektorijs"),
("Resume", "Atsākt"),
("Invalid file name", "Nederīgs faila nosaukums"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Hoofdmap"),
("Resume", "Hervatten"),
("Invalid file name", "Ongeldige bestandsnaam"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Folder nadrzędny"),
("Resume", "Wznów"),
("Invalid file name", "Nieprawidłowa nazwa pliku"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Diretório pai"),
("Resume", "Continuar"),
("Invalid file name", "Nome de arquivo inválido"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Родительская директория"),
("Resume", "Продолжить"),
("Invalid file name", "Неверное имя файла"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "Rodičovský adresár"),
("Resume", "Obnoviť"),
("Invalid file name", "Nesprávny názov súboru"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", "父目錄"),
("Resume", "繼續"),
("Invalid file name", "無效文件名"),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -644,5 +644,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Parent directory", ""),
("Resume", ""),
("Invalid file name", ""),
("one-way-file-transfer-tip", ""),
].iter().cloned().collect();
}

View File

@@ -2139,22 +2139,34 @@ impl Connection {
return true;
}
if crate::get_builtin_option(keys::OPTION_ONE_WAY_FILE_TRANSFER) == "Y" {
match fa.union {
Some(file_action::Union::Send(_))
| Some(file_action::Union::RemoveFile(_))
| Some(file_action::Union::Rename(_))
| Some(file_action::Union::Create(_))
| Some(file_action::Union::RemoveDir(_)) => {
self.send(fs::new_error(
0,
"One-way file transfer is enabled on controlled side",
0,
))
.await;
return true;
let mut job_id = None;
match &fa.union {
Some(file_action::Union::Send(s)) => {
job_id = Some(s.id);
}
Some(file_action::Union::RemoveFile(rf)) => {
job_id = Some(rf.id);
}
Some(file_action::Union::Rename(r)) => {
job_id = Some(r.id);
}
Some(file_action::Union::Create(c)) => {
job_id = Some(c.id);
}
Some(file_action::Union::RemoveDir(rd)) => {
job_id = Some(rd.id);
}
_ => {}
}
if let Some(job_id) = job_id {
self.send(fs::new_error(
job_id,
"one-way-file-transfer-tip",
0,
))
.await;
return true;
}
}
match fa.union {
Some(file_action::Union::ReadDir(rd)) => {