portable-service: better prompt message

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-11-15 16:49:55 +08:00
parent abd665153b
commit ca8cb5a3b0
38 changed files with 131 additions and 124 deletions

View File

@ -627,7 +627,7 @@ class CustomAlertDialog extends StatelessWidget {
}
}
void msgBox(String type, String title, String text, String link,
void msgBox(String id, String type, String title, String text, String link,
OverlayDialogManager dialogManager,
{bool? hasCancel}) {
dialogManager.dismissAll();
@ -672,14 +672,17 @@ void msgBox(String type, String title, String text, String link,
if (link.isNotEmpty) {
buttons.insert(0, msgBoxButton(translate('JumpLink'), jumplink));
}
dialogManager.show((setState, close) => CustomAlertDialog(
title: _msgBoxTitle(title),
content: SelectableText(translate(text),
style: const TextStyle(fontSize: 15)),
actions: buttons,
onSubmit: hasOk ? submit : null,
onCancel: hasCancel == true ? cancel : null,
));
dialogManager.show(
(setState, close) => CustomAlertDialog(
title: _msgBoxTitle(title),
content:
SelectableText(translate(text), style: const TextStyle(fontSize: 15)),
actions: buttons,
onSubmit: hasOk ? submit : null,
onCancel: hasCancel == true ? cancel : null,
),
tag: '$id-$type-$title-$text-$link',
);
}
Widget msgBoxButton(String text, void Function() onPressed) {

View File

@ -163,7 +163,7 @@ class _RemotePageState extends State<RemotePage>
super.build(context);
return WillPopScope(
onWillPop: () async {
clientClose(_ffi.dialogManager);
clientClose(widget.id, _ffi.dialogManager);
return false;
},
child: MultiProvider(providers: [

View File

@ -489,7 +489,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
return IconButton(
tooltip: translate('Close'),
onPressed: () {
clientClose(widget.ffi.dialogManager);
clientClose(widget.id, widget.ffi.dialogManager);
},
icon: const Icon(
Icons.close,

View File

@ -63,7 +63,8 @@ class _FileManagerPageState extends State<FileManagerPage> {
leading: Row(children: [
IconButton(
icon: Icon(Icons.close),
onPressed: () => clientClose(gFFI.dialogManager)),
onPressed: () =>
clientClose(widget.id, gFFI.dialogManager)),
]),
centerTitle: true,
title: ToggleSwitch(

View File

@ -223,7 +223,7 @@ class _RemotePageState extends State<RemotePage> {
return WillPopScope(
onWillPop: () async {
clientClose(gFFI.dialogManager);
clientClose(widget.id, gFFI.dialogManager);
return false;
},
child: getRawPointerAndKeyBody(Scaffold(
@ -304,7 +304,7 @@ class _RemotePageState extends State<RemotePage> {
color: Colors.white,
icon: Icon(Icons.clear),
onPressed: () {
clientClose(gFFI.dialogManager);
clientClose(widget.id, gFFI.dialogManager);
},
)
] +

View File

@ -5,9 +5,9 @@ import '../../common.dart';
import '../../models/model.dart';
import '../../models/platform_model.dart';
void clientClose(OverlayDialogManager dialogManager) {
msgBox(
'', 'Close', 'Are you sure to close the connection?', '', dialogManager);
void clientClose(String id, OverlayDialogManager dialogManager) {
msgBox(id, '', 'Close', 'Are you sure to close the connection?', '',
dialogManager);
}
void showSuccess() {

View File

@ -195,6 +195,8 @@ class FfiModel with ChangeNotifier {
} else if (name == 'show_elevation') {
final show = evt['show'].toString() == 'true';
parent.target?.serverModel.setShowElevation(show);
} else if (name == 'cancel_msgbox') {
cancelMsgBox(evt, peerId);
}
};
}
@ -231,6 +233,13 @@ class FfiModel with ChangeNotifier {
notifyListeners();
}
cancelMsgBox(Map<String, dynamic> evt, String id) {
if (parent.target == null) return;
final dialogManager = parent.target!.dialogManager;
final tag = '$id-${evt['tag']}';
dialogManager.dismissByTag(tag);
}
/// Handle the message box event based on [evt] and [id].
handleMsgBox(Map<String, dynamic> evt, String id) {
if (parent.target == null) return;
@ -256,7 +265,7 @@ class FfiModel with ChangeNotifier {
showMsgBox(String id, String type, String title, String text, String link,
bool hasRetry, OverlayDialogManager dialogManager,
{bool? hasCancel}) {
msgBox(type, title, text, link, dialogManager, hasCancel: hasCancel);
msgBox(id, type, title, text, link, dialogManager, hasCancel: hasCancel);
_timer?.cancel();
if (hasRetry) {
_timer = Timer(Duration(seconds: _reconnects), () {

View File

@ -20,18 +20,14 @@ use hbb_common::fs::{
use hbb_common::message_proto::permission_info::Permission;
use hbb_common::protobuf::Message as _;
use hbb_common::rendezvous_proto::ConnType;
#[cfg(windows)]
use hbb_common::tokio::sync::Mutex as TokioMutex;
use hbb_common::tokio::{
self,
sync::mpsc,
time::{self, Duration, Instant, Interval},
};
#[cfg(windows)]
use hbb_common::tokio::sync::Mutex as TokioMutex;
use hbb_common::{
allow_err,
message_proto::*,
sleep,
};
use hbb_common::{allow_err, message_proto::*, sleep};
use hbb_common::{fs, log, Stream};
use std::collections::HashMap;
@ -998,23 +994,31 @@ impl<T: InvokeUiSession> Remote<T> {
}
}
Some(misc::Union::Uac(uac)) => {
let msgtype = "custom-uac-nocancel";
let title = "Prompt";
let text = "Please wait for confirmation of UAC...";
let link = "";
if uac {
self.handler.msgbox(
"custom-uac-nocancel",
"Warning",
"uac_warning",
"",
);
self.handler.msgbox(msgtype, title, text, link);
} else {
self.handler
.cancel_msgbox(
&format!("{}-{}-{}-{}", msgtype, title, text, link,),
);
}
}
Some(misc::Union::ForegroundWindowElevated(elevated)) => {
let msgtype = "custom-elevated-foreground-nocancel";
let title = "Prompt";
let text = "elevated_foreground_window_tip";
let link = "";
if elevated {
self.handler.msgbox(
"custom-elevated-foreground-nocancel",
"Warning",
"elevated_foreground_window_warning",
"",
);
self.handler.msgbox(msgtype, title, text, link);
} else {
self.handler
.cancel_msgbox(
&format!("{}-{}-{}-{}", msgtype, title, text, link,),
);
}
}
_ => {}

View File

@ -228,8 +228,7 @@ impl InvokeUiSession for FlutterHandler {
id: i32,
entries: &Vec<FileEntry>,
path: String,
#[allow(unused_variables)]
is_local: bool,
#[allow(unused_variables)] is_local: bool,
only_count: bool,
) {
// TODO opt
@ -327,6 +326,10 @@ impl InvokeUiSession for FlutterHandler {
);
}
fn cancel_msgbox(&self, tag: &str) {
self.push_event("cancel_msgbox", vec![("tag", tag)]);
}
fn new_message(&self, msg: String) {
self.push_event("chat_client_mode", vec![("text", &msg)]);
}

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "拒绝局域网发现"),
("Write a message", "输入聊天消息"),
("Prompt", "提示"),
("elevation_prompt", "以当前用户权限运行软件,可能导致远端在访问本机时,没有足够的权限来操作部分窗口。"),
("uac_warning", "暂时无法访问远端设备因为远端设备正在请求用户账户权限请等待对方关闭UAC窗口。为避免这个问题建议在远端设备上安装或者以管理员权限运行本软件。"),
("elevated_foreground_window_warning", "暂时无法使用鼠标键盘,因为远端桌面的当前窗口需要更高的权限才能操作, 可以请求对方最小化当前窗口。为避免这个问题,建议在远端设备上安装或者以管理员权限运行本软件。"),
("Please wait for confirmation of UAC...", "请等待对方确认UAC..."),
("elevated_foreground_window_tip", "远端桌面的当前窗口需要更高的权限才能操作, 暂时无法使用鼠标键盘, 可以请求对方最小化当前窗口, 或者在连接管理窗口点击提升。为避免这个问题,建议在远端设备上安装本软件。"),
("Disconnected", "会话已结束"),
("Other", "其他"),
("Confirm before closing multiple tabs", "关闭多个标签页时向您确认"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Afvis LAN Discovery"),
("Write a message", "Skriv en besked"),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Afbrudt"),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "LAN-Erkennung verbieten"),
("Write a message", "Nachricht schreiben"),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -30,9 +30,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("android_open_battery_optimizations_tip", "If you want to disable this feature, please go to the next RustDesk application settings page, find and enter [Battery], Uncheck [Unrestricted]"),
("remote_restarting_tip", "Remote device is restarting, please close this message box and reconnect with permanent password after a while"),
("Are you sure to close the connection?", "Are you sure you want to close the connection?"),
("elevation_prompt", "Running software without privilege elevation may cause problems when remote users operate certain windows."),
("uac_warning", "Temporarily denied access due to elevation request, please wait for the remote user to accept the UAC dialog. To avoid this problem, it is recommended to install the software on the remote device or run it with administrator privileges."),
("elevated_foreground_window_warning", "Temporarily unable to use the mouse and keyboard, because the current window of the remote desktop requires higher privilege to operate, you can request the remote user to minimize the current window. To avoid this problem, it is recommended to install the software on the remote device or run it with administrator privileges."),
("elevated_foreground_window_tip", "The current window of the remote desktop requires higher privilege to operate, so it's unable to use the mouse and keyboard temporarily. You can request the remote user to minimize the current window, or click elevation button on the connection management window. To avoid this problem, it is recommended to install the software on the remote device."),
("JumpLink", "View"),
("Stop service", "Stop Service"),
("or", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Denegar descubrimiento de LAN"),
("Write a message", "Escribir un mensaje"),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Desconectado"),
("Other", "Otro"),
("Confirm before closing multiple tabs", "Confirmar antes de cerrar múltiples pestañas"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "غیر فعالسازی جستجو در شبکه"),
("Write a message", "یک پیام بنویسید"),
("Prompt", ""),
("elevation_prompt", "اجرای نرم‌افزار بدون افزایش امتیاز می‌تواند باعث ایجاد مشکلاتی در هنگام کار کردن کاربران راه دور با ویندوزهای خاص شود"),
("uac_warning", "به دلیل درخواست دسترسی سطح بالا، به طور موقت از دسترسی رد شد. منتظر بمانید تا کاربر راه دور گفتگوی UAC را بپذیرد. برای جلوگیری از این مشکل، توصیه می شود نرم افزار را روی دستگاه از راه دور نصب کنید یا آن را با دسترسی مدیر اجرا کنید."),
("elevated_foreground_window_warning", "به طور موقت استفاده از ماوس و صفحه کلید امکان پذیر نیست زیرا پنجره دسکتاپ از راه دور فعلی برای کار کردن به دسترسی های بالاتر نیاز دارد، می توانید از کاربر راه دور بخواهید که پنجره فعلی را به حداقل برساند. برای جلوگیری از این مشکل، توصیه می شود نرم افزار را روی یک دستگاه راه دور نصب کنید یا آن را با دسترسی مدیر اجرا کنید"),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "قطع ارتباط"),
("Other", "دیگر"),
("Confirm before closing multiple tabs", "بستن چندین برگه را تأیید کنید"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Interdir la découverte réseau local"),
("Write a message", "Ecrire un message"),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Déconnecté"),
("Other", "Divers"),
("Confirm before closing multiple tabs", "Confirmer avant de fermer plusieurs onglets"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Felfedezés tiltása"),
("Write a message", "Üzenet írása"),
("Prompt", ""),
("elevation_prompt", "A szoftver jogosultságnövelés nélküli futtatása problémákat okozhat, ha távoli felhasználók bizonyos ablakokat működtetnek."),
("uac_warning", "Kérjük, várja meg, amíg a távoli felhasználó elfogadja az UAC párbeszédpanelt. A probléma elkerülése érdekében javasoljuk, hogy telepítse a szoftvert a távoli eszközre, vagy futtassa rendszergazdai jogosultságokkal."),
("elevated_foreground_window_warning", "Átmenetileg nem tudja használni az egeret és a billentyűzetet, mert a távoli asztal aktuális ablakának működéséhez magasabb jogosultság szükséges, ezért kérheti a távoli felhasználót, hogy minimalizálja az aktuális ablakot. A probléma elkerülése érdekében javasoljuk, hogy telepítse a szoftvert a távoli eszközre, vagy futtassa rendszergazdai jogosultságokkal."),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Szétkapcsolva"),
("Other", "Egyéb"),
("Confirm before closing multiple tabs", "Biztos, hogy bezárja az összes lapot?"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Tolak Penemuan LAN"),
("Write a message", "Menulis pesan"),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Terputus"),
("Other", "Lainnya"),
("Confirm before closing multiple tabs", "Konfirmasi sebelum menutup banyak tab"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", "他の"),
("Confirm before closing multiple tabs", "同時に複数のタブを閉じる前に確認する"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Zablokuj Wykrywanie LAN"),
("Write a message", "Napisz wiadomość"),
("Prompt", "Monit"),
("elevation_prompt", "Monit o podwyższeniu uprawnień"),
("uac_warning", "Ostrzeżenie UAC"),
("elevated_foreground_window_warning", "Pierwszoplanowe okno ostrzeżenia o podwyższeniu uprawnień"),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Rozłączone"),
("Other", "Inne"),
("Confirm before closing multiple tabs", "Potwierdź przed zamknięciem wielu kart"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Desconectado"),
("Other", "Outro"),
("Confirm before closing multiple tabs", "Confirme antes de fechar vários separadores"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Negar descoberta da LAN"),
("Write a message", "Escrever uma mensagem"),
("Prompt", "Prompt de comando"),
("elevation_prompt", "Prompt de comando (Admin)"),
("uac_warning", "Aviso UAC"),
("elevated_foreground_window_warning", "Aviso de janela de primeiro plano elevado"),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Desconectado"),
("Other", "Outro"),
("Confirm before closing multiple tabs", "Confirmar antes de fechar múltiplas abas"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Запретить обнаружение в локальной сети"),
("Write a message", "Написать сообщение"),
("Prompt", "Подсказка"),
("elevation_prompt", "Запуск программного обеспечения без повышения привилегий может вызвать проблемы, когда удалённые пользователи работают с определёнными окнами."),
("uac_warning", "Временно отказано в доступе из-за запроса на повышение прав. Подождите, пока удалённый пользователь примет диалоговое окно UAC. Чтобы избежать этой проблемы, рекомендуется устанавливать программное обеспечение на удалённое устройство или запускать его с правами администратора."),
("elevated_foreground_window_warning", "Временно невозможно использовать мышь и клавиатуру, поскольку текущее окно удалённого рабочего стола требует более высоких привилегий для работы, вы можете попросить удалённого пользователя свернуть текущее окно. Чтобы избежать этой проблемы, рекомендуется устанавливать программное обеспечение на удалённое устройство или запускать его с правами администратора."),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", "Отключено"),
("Other", "Другое"),
("Confirm before closing multiple tabs", "Подтверждение закрытия несколько вкладок"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "拒絕局域網發現"),
("Write a message", "輸入聊天消息"),
("Prompt", "提示"),
("elevation_prompt", "以當前用戶權限運行軟件,可能導致遠端在訪問本機時,沒有足夠的權限來操作部分窗口。"),
("uac_warning", "暂时无法访问远端设备因为远端设备正在请求用户账户权限请等待对方关闭UAC窗口。为避免这个问题建议在远端设备上安装或者以管理员权限运行本软件。"),
("elevated_foreground_window_warning", "暫時無法使用鼠標鍵盤,因為遠端桌面的當前窗口需要更高的權限才能操作, 可以請求對方最小化當前窗口。為避免這個問題,建議在遠端設備上安裝或者以管理員權限運行本軟件。"),
("Please wait for confirmation of UAC...", "請等待對方確認UAC"),
("elevated_foreground_window_tip", "遠端桌面的當前窗口需要更高的權限才能操作, 暫時無法使用鼠標鍵盤, 可以請求對方最小化當前窗口, 或者在連接管理窗口點擊提升。為避免這個問題,建議在遠端設備上安裝本軟件。"),
("Disconnected", "會話已結束"),
("Other", "其他"),
("Confirm before closing multiple tabs", "關閉多個分頁前跟我確認"),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", "Заборонити виявлення локальної мережі"),
("Write a message", "Написати повідомлення"),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -371,9 +371,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Deny LAN Discovery", ""),
("Write a message", ""),
("Prompt", ""),
("elevation_prompt", ""),
("uac_warning", ""),
("elevated_foreground_window_warning", ""),
("Please wait for confirmation of UAC...", ""),
("elevated_foreground_window_tip", ""),
("Disconnected", ""),
("Other", ""),
("Confirm before closing multiple tabs", ""),

View File

@ -26,12 +26,9 @@ use hbb_common::{
use scrap::android::call_main_service_mouse_input;
use serde_json::{json, value::Value};
use sha2::{Digest, Sha256};
use std::sync::{
atomic::AtomicI64,
mpsc as std_mpsc,
};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use std::sync::atomic::Ordering;
use std::sync::{atomic::AtomicI64, mpsc as std_mpsc};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use system_shutdown;
@ -434,7 +431,7 @@ impl Connection {
let uac = crate::video_service::IS_UAC_RUNNING.lock().unwrap().clone();
if last_uac != uac {
last_uac = uac;
if !portable_service_running {
if !uac || !portable_service_running{
let mut misc = Misc::new();
misc.set_uac(uac);
let mut msg = Message::new();
@ -445,7 +442,7 @@ impl Connection {
let foreground_window_elevated = crate::video_service::IS_FOREGROUND_WINDOW_ELEVATED.lock().unwrap().clone();
if last_foreground_window_elevated != foreground_window_elevated {
last_foreground_window_elevated = foreground_window_elevated;
if !portable_service_running {
if !foreground_window_elevated || !portable_service_running {
let mut misc = Misc::new();
misc.set_foreground_window_elevated(foreground_window_elevated);
let mut msg = Message::new();

View File

@ -232,6 +232,7 @@ class ChatBox: Reactor.Component {
/******************** start of msgbox ****************************************/
var remember_password = false;
var last_msgbox_tag = "";
function msgbox(type, title, content, link="", callback=null, height=180, width=500, hasRetry=false, contentStyle="") {
$(body).scrollTo(0, 0);
if (!type) {
@ -264,6 +265,7 @@ function msgbox(type, title, content, link="", callback=null, height=180, width=
} else if (type.indexOf("custom") < 0 && !is_port_forward && !callback) {
callback = function() { view.close(); }
}
last_msgbox_tag = type + "-" + title + "-" + content + "-" + link;
$(#msgbox).content(<MsgboxComponent width={width} height={height} auto_login={auto_login} type={type} title={title} content={content} link={link} remember={remember} callback={callback} contentStyle={contentStyle} hasRetry={hasRetry} />);
}
@ -276,6 +278,12 @@ handler.msgbox = function(type, title, text, link = "", hasRetry=false) {
self.timer(60ms, function() { msgbox(type, title, text, link, null, 180, 500, hasRetry); });
}
handler.cancel_msgbox = function(tag) {
if (last_msgbox_tag == tag) {
closeMsgbox();
}
}
var reconnectTimeout = 1000;
handler.msgbox_retry = function(type, title, text, link, hasRetry) {
handler.msgbox(type, title, text, link, hasRetry);

View File

@ -231,7 +231,14 @@ impl InvokeUiSession for SciterHandler {
}
fn msgbox(&self, msgtype: &str, title: &str, text: &str, link: &str, retry: bool) {
self.call2("msgbox_retry", &make_args!(msgtype, title, text, link, retry));
self.call2(
"msgbox_retry",
&make_args!(msgtype, title, text, link, retry),
);
}
fn cancel_msgbox(&self, tag: &str) {
self.call("cancel_msgbox", &make_args!(tag));
}
fn new_message(&self, msg: String) {

View File

@ -1,11 +1,11 @@
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use crate::client::{get_key_state, SERVER_KEYBOARD_ENABLED};
use crate::client::io_loop::Remote;
use crate::client::{
check_if_retry, handle_hash, handle_login_from_ui, handle_test_delay, input_os_password,
load_config, send_mouse, start_video_audio_threads, FileManager, Key, LoginConfigHandler,
QualityStatus, KEY_MAP,
};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use crate::client::{get_key_state, SERVER_KEYBOARD_ENABLED};
#[cfg(target_os = "linux")]
use crate::common::IS_X11;
use crate::{client::Data, client::Interface};
@ -15,9 +15,9 @@ use hbb_common::rendezvous_proto::ConnType;
use hbb_common::tokio::{self, sync::mpsc};
use hbb_common::{allow_err, message_proto::*};
use hbb_common::{fs, get_version_number, log, Stream};
use rdev::{Event, EventType, EventType::*, Key as RdevKey};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use rdev::{Keyboard as RdevKeyboard, KeyboardState};
use rdev::{Event, EventType, EventType::*, Key as RdevKey};
use std::collections::{HashMap, HashSet};
use std::ops::{Deref, DerefMut};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
@ -1120,6 +1120,7 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
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);
fn cancel_msgbox(&self, tag: &str);
}
impl<T: InvokeUiSession> Deref for Session<T> {