msgbox & translations

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-10-14 11:19:49 +08:00
parent 5ddb10366e
commit 77de0d05f9
42 changed files with 271 additions and 64 deletions

View File

@@ -1088,7 +1088,7 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
fn job_progress(&self, id: i32, file_num: i32, speed: f64, finished_size: f64);
fn adapt_size(&self);
fn on_rgba(&self, data: &[u8]);
fn msgbox(&self, msgtype: &str, title: &str, text: &str, retry: bool);
fn msgbox(&self, msgtype: &str, title: &str, text: &str, link: &str, retry: bool);
#[cfg(any(target_os = "android", target_os = "ios"))]
fn clipboard(&self, content: String);
}
@@ -1137,9 +1137,9 @@ impl<T: InvokeUiSession> Interface for Session<T> {
self.lc.read().unwrap().conn_type.eq(&ConnType::RDP)
}
fn msgbox(&self, msgtype: &str, title: &str, text: &str) {
fn msgbox(&self, msgtype: &str, title: &str, text: &str, link: &str) {
let retry = check_if_retry(msgtype, title, text);
self.ui_handler.msgbox(msgtype, title, text, retry);
self.ui_handler.msgbox(msgtype, title, text, link, retry);
}
fn handle_login_error(&mut self, err: &str) -> bool {
@@ -1164,7 +1164,7 @@ impl<T: InvokeUiSession> Interface for Session<T> {
if pi.displays.is_empty() {
self.lc.write().unwrap().handle_peer_info(&pi);
self.update_privacy_mode();
self.msgbox("error", "Remote Error", "No Display");
self.msgbox("error", "Remote Error", "No Display", "");
return;
}
let p = self.lc.read().unwrap().should_auto_login();
@@ -1181,7 +1181,7 @@ impl<T: InvokeUiSession> Interface for Session<T> {
if self.is_file_transfer() {
self.close_success();
} else if !self.is_port_forward() {
self.msgbox("success", "Successful", "Connected, waiting for image...");
self.msgbox("success", "Successful", "Connected, waiting for image...", "");
}
#[cfg(windows)]
{