From dab956fe851f6c2aa20f87e079dbe1662135b85e Mon Sep 17 00:00:00 2001 From: dignow Date: Thu, 20 Jul 2023 08:05:38 +0800 Subject: [PATCH 01/37] common oidc Signed-off-by: dignow --- flutter/assets/auth-apple.svg | 1 + flutter/assets/auth-azure.svg | 1 + flutter/assets/auth-default.svg | 14 +++++ flutter/assets/auth-facebook.svg | 1 + .../assets/{GitHub.svg => auth-github.svg} | 0 .../assets/{Google.svg => auth-google.svg} | 0 flutter/assets/{Okta.svg => auth-okta.svg} | 0 flutter/lib/common.dart | 7 +++ flutter/lib/common/widgets/login.dart | 51 +++++++++---------- flutter/lib/models/user_model.dart | 6 +-- 10 files changed, 51 insertions(+), 30 deletions(-) create mode 100644 flutter/assets/auth-apple.svg create mode 100644 flutter/assets/auth-azure.svg create mode 100644 flutter/assets/auth-default.svg create mode 100644 flutter/assets/auth-facebook.svg rename flutter/assets/{GitHub.svg => auth-github.svg} (100%) rename flutter/assets/{Google.svg => auth-google.svg} (100%) rename flutter/assets/{Okta.svg => auth-okta.svg} (100%) diff --git a/flutter/assets/auth-apple.svg b/flutter/assets/auth-apple.svg new file mode 100644 index 000000000..a3c2e871d --- /dev/null +++ b/flutter/assets/auth-apple.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/flutter/assets/auth-azure.svg b/flutter/assets/auth-azure.svg new file mode 100644 index 000000000..0482b22e6 --- /dev/null +++ b/flutter/assets/auth-azure.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/flutter/assets/auth-default.svg b/flutter/assets/auth-default.svg new file mode 100644 index 000000000..905c9ca9b --- /dev/null +++ b/flutter/assets/auth-default.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/flutter/assets/auth-facebook.svg b/flutter/assets/auth-facebook.svg new file mode 100644 index 000000000..d921a6716 --- /dev/null +++ b/flutter/assets/auth-facebook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/flutter/assets/GitHub.svg b/flutter/assets/auth-github.svg similarity index 100% rename from flutter/assets/GitHub.svg rename to flutter/assets/auth-github.svg diff --git a/flutter/assets/Google.svg b/flutter/assets/auth-google.svg similarity index 100% rename from flutter/assets/Google.svg rename to flutter/assets/auth-google.svg diff --git a/flutter/assets/Okta.svg b/flutter/assets/auth-okta.svg similarity index 100% rename from flutter/assets/Okta.svg rename to flutter/assets/auth-okta.svg diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index e96f02772..71fbfcdd9 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -2314,3 +2314,10 @@ Widget unreadTopRightBuilder(RxInt? count, {Widget? icon}) { ], ); } + +String toCapitalized(String s) { + if (s.isEmpty) { + return s; + } + return s.substring(0, 1).toUpperCase() + s.substring(1); +} diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 17cc7090c..1eecdc2d5 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -13,13 +13,13 @@ import '../../common.dart'; import './dialog.dart'; class _IconOP extends StatelessWidget { - final String icon; - final double iconWidth; + final String op; + final String? icon; final EdgeInsets margin; const _IconOP( {Key? key, + required this.op, required this.icon, - required this.iconWidth, this.margin = const EdgeInsets.symmetric(horizontal: 4.0)}) : super(key: key); @@ -27,10 +27,15 @@ class _IconOP extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: margin, - child: SvgPicture.asset( - 'assets/$icon.svg', - width: iconWidth, - ), + child: icon == null + ? SvgPicture.asset( + 'assets/auth-${op.toLowerCase()}.svg', + width: 20, + ) + : SvgPicture.string( + icon!, + width: 20, + ), ); } } @@ -38,7 +43,7 @@ class _IconOP extends StatelessWidget { class ButtonOP extends StatelessWidget { final String op; final RxString curOP; - final double iconWidth; + final String? icon; final Color primaryColor; final double height; final Function() onTap; @@ -47,7 +52,7 @@ class ButtonOP extends StatelessWidget { Key? key, required this.op, required this.curOP, - required this.iconWidth, + required this.icon, required this.primaryColor, required this.height, required this.onTap, @@ -71,15 +76,15 @@ class ButtonOP extends StatelessWidget { SizedBox( width: 30, child: _IconOP( - icon: op, - iconWidth: iconWidth, + op: op, + icon: icon, margin: EdgeInsets.only(right: 5), )), Expanded( child: FittedBox( fit: BoxFit.scaleDown, child: Center( - child: Text('${translate("Continue with")} $op')))), + child: Text('${translate("Continue with")} ${toCapitalized(op)}')))), ], ))), ), @@ -89,8 +94,8 @@ class ButtonOP extends StatelessWidget { class ConfigOP { final String op; - final double iconWidth; - ConfigOP({required this.op, required this.iconWidth}); + final String? icon; + ConfigOP({required this.op, required this.icon}); } class WidgetOP extends StatefulWidget { @@ -182,7 +187,7 @@ class _WidgetOPState extends State { ButtonOP( op: widget.config.op, curOP: widget.curOP, - iconWidth: widget.config.iconWidth, + icon: widget.config.icon, primaryColor: str2color(widget.config.op, 0x7f), height: 36, onTap: () async { @@ -380,7 +385,7 @@ Future loginDialog() async { final loginOptions = [].obs; Future.delayed(Duration.zero, () async { - loginOptions.value = await UserModel.queryLoginOptions(); + loginOptions.value = await UserModel.queryOidcLoginOptions(); }); final res = await gFFI.dialogManager.show((setState, close, context) { @@ -460,12 +465,8 @@ Future loginDialog() async { } thirdAuthWidget() => Obx(() { - final oidcOptions = loginOptions - .where((opt) => opt.startsWith(kAuthReqTypeOidc)) - .map((opt) => opt.substring(kAuthReqTypeOidc.length)) - .toList(); return Offstage( - offstage: oidcOptions.isEmpty, + offstage: loginOptions.isEmpty, child: Column( children: [ const SizedBox( @@ -480,12 +481,8 @@ Future loginDialog() async { height: 8.0, ), LoginWidgetOP( - ops: [ - ConfigOP(op: 'GitHub', iconWidth: 20), - ConfigOP(op: 'Google', iconWidth: 20), - ConfigOP(op: 'Okta', iconWidth: 38), - ] - .where((op) => oidcOptions.contains(op.op.toLowerCase())) + ops: loginOptions + .map((e) => ConfigOP(op: e['name'], icon: e['icon'])) .toList(), curOP: curOP, cbLogin: (Map authBody) { diff --git a/flutter/lib/models/user_model.dart b/flutter/lib/models/user_model.dart index 83df2e632..18f409608 100644 --- a/flutter/lib/models/user_model.dart +++ b/flutter/lib/models/user_model.dart @@ -163,15 +163,15 @@ class UserModel { return loginResponse; } - static Future> queryLoginOptions() async { + static Future> queryOidcLoginOptions() async { try { final url = await bind.mainGetApiServer(); if (url.trim().isEmpty) return []; - final resp = await http.get(Uri.parse('$url/api/login-options')); + final resp = await http.get(Uri.parse('$url/api/oidc/login-options')); return jsonDecode(resp.body); } catch (e) { debugPrint( - "queryLoginOptions: jsonDecode resp body failed: ${e.toString()}"); + "queryOidcLoginOptions: jsonDecode resp body failed: ${e.toString()}"); return []; } } From 3f3c45b6633631aef6d6f3231ffdbe79736e1bc8 Mon Sep 17 00:00:00 2001 From: dignow Date: Thu, 20 Jul 2023 08:27:30 +0800 Subject: [PATCH 02/37] common oidc, tmp commit Signed-off-by: dignow --- flutter/lib/common/widgets/login.dart | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 1eecdc2d5..12171be34 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -66,7 +66,7 @@ class ButtonOP extends StatelessWidget { width: 200, child: Obx(() => ElevatedButton( style: ElevatedButton.styleFrom( - primary: curOP.value.isEmpty || curOP.value == op + backgroundColor: curOP.value.isEmpty || curOP.value == op ? primaryColor : Colors.grey, ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), @@ -74,17 +74,21 @@ class ButtonOP extends StatelessWidget { child: Row( children: [ SizedBox( - width: 30, - child: _IconOP( - op: op, - icon: icon, - margin: EdgeInsets.only(right: 5), - )), + width: 30, + child: _IconOP( + op: op, + icon: icon, + margin: EdgeInsets.only(right: 5), + ), + ), Expanded( - child: FittedBox( - fit: BoxFit.scaleDown, - child: Center( - child: Text('${translate("Continue with")} ${toCapitalized(op)}')))), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Center( + child: Text( + '${translate("Continue with")} ${op.toLowerCase() == "github" ? "GitHub" : toCapitalized(op)}')), + ), + ), ], ))), ), From 0bf007e63c6a137a918c152ec4a4f14b9a6d4e73 Mon Sep 17 00:00:00 2001 From: dignow Date: Thu, 20 Jul 2023 11:09:08 +0800 Subject: [PATCH 03/37] common oidc, debug Signed-off-by: dignow --- flutter/lib/common/widgets/login.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 12171be34..11cb067ac 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -12,6 +12,8 @@ import 'package:url_launcher/url_launcher.dart'; import '../../common.dart'; import './dialog.dart'; +const kOpSvgList = ['github', 'google', 'apple', 'okta', 'facebook', 'azure']; + class _IconOP extends StatelessWidget { final String op; final String? icon; @@ -25,11 +27,12 @@ class _IconOP extends StatelessWidget { @override Widget build(BuildContext context) { + final svgFile = kOpSvgList.contains(op.toLowerCase()) ? op.toLowerCase() : 'default'; return Container( margin: margin, child: icon == null ? SvgPicture.asset( - 'assets/auth-${op.toLowerCase()}.svg', + 'assets/auth-$svgFile.svg', width: 20, ) : SvgPicture.string( From 35c1cee18bbaba30ada3bd2c2663f49e9d0b1510 Mon Sep 17 00:00:00 2001 From: dignow Date: Thu, 20 Jul 2023 22:58:57 +0800 Subject: [PATCH 04/37] common oidc, add auth0 Signed-off-by: dignow --- flutter/assets/auth-auth0.svg | 1 + flutter/lib/common/widgets/login.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 flutter/assets/auth-auth0.svg diff --git a/flutter/assets/auth-auth0.svg b/flutter/assets/auth-auth0.svg new file mode 100644 index 000000000..e8c7557e7 --- /dev/null +++ b/flutter/assets/auth-auth0.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 11cb067ac..d7037e58f 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -12,7 +12,7 @@ import 'package:url_launcher/url_launcher.dart'; import '../../common.dart'; import './dialog.dart'; -const kOpSvgList = ['github', 'google', 'apple', 'okta', 'facebook', 'azure']; +const kOpSvgList = ['github', 'google', 'apple', 'okta', 'facebook', 'azure', 'auth0']; class _IconOP extends StatelessWidget { final String op; From 4e1d7ca3de8f9ff22d79712d5a3543416deb6923 Mon Sep 17 00:00:00 2001 From: dignow Date: Thu, 20 Jul 2023 23:23:59 +0800 Subject: [PATCH 05/37] update svg Signed-off-by: dignow --- flutter/assets/auth-github.svg | 2 +- flutter/assets/auth-google.svg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/assets/auth-github.svg b/flutter/assets/auth-github.svg index ef0bb12a7..1ba71c98b 100644 --- a/flutter/assets/auth-github.svg +++ b/flutter/assets/auth-github.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/flutter/assets/auth-google.svg b/flutter/assets/auth-google.svg index df394a84f..f9ab170e6 100644 --- a/flutter/assets/auth-google.svg +++ b/flutter/assets/auth-google.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 2c86fac20824e6cca1f98bfd71a1d22ac2b13e93 Mon Sep 17 00:00:00 2001 From: dignow Date: Mon, 7 Aug 2023 19:08:29 +0800 Subject: [PATCH 06/37] refact, common oidc Signed-off-by: dignow --- flutter/lib/models/user_model.dart | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/flutter/lib/models/user_model.dart b/flutter/lib/models/user_model.dart index 18f409608..ebed47587 100644 --- a/flutter/lib/models/user_model.dart +++ b/flutter/lib/models/user_model.dart @@ -167,8 +167,20 @@ class UserModel { try { final url = await bind.mainGetApiServer(); if (url.trim().isEmpty) return []; - final resp = await http.get(Uri.parse('$url/api/oidc/login-options')); - return jsonDecode(resp.body); + final resp = await http.get(Uri.parse('$url/api/login-options')); + final List ops = []; + for (final item in jsonDecode(resp.body)) { + ops.add(item as String); + } + for (final item in ops) { + if (item.startsWith('common-oidc/')) { + return jsonDecode(item.substring('common-oidc/'.length)); + } + } + return ops + .where((item) => item.startsWith('oidc/')) + .map((item) => {'name': item.substring('oidc/'.length)}) + .toList(); } catch (e) { debugPrint( "queryOidcLoginOptions: jsonDecode resp body failed: ${e.toString()}"); From 0c50feeb1b465b71f4eb1808b4be03f8b6c9e2db Mon Sep 17 00:00:00 2001 From: Mr-Update <37781396+Mr-Update@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:17:14 +0200 Subject: [PATCH 07/37] Supplement for "fix some words" from yesterday --- src/ui/index.tis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/index.tis b/src/ui/index.tis index f0bfc13d2..c6286e903 100644 --- a/src/ui/index.tis +++ b/src/ui/index.tis @@ -215,7 +215,7 @@ class Enhancements: Reactor.Component { return
  • {translate('Enhancements')} {has_hwcodec ?
  • {svg_checkmark}{translate("Hardware Codec")} (beta)
  • : ""} -
  • {svg_checkmark}{translate("Adaptive Bitrate")} (beta)
  • +
  • {svg_checkmark}{translate("Adaptive bitrate")} (beta)
  • {translate("Recording")}
  • ; From b34f745837f0f491d135eb7565c71a52b053dc2b Mon Sep 17 00:00:00 2001 From: Mr-Update <37781396+Mr-Update@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:20:20 +0200 Subject: [PATCH 08/37] Supplement for "fix some words" from yesterday --- flutter/lib/mobile/pages/settings_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/mobile/pages/settings_page.dart b/flutter/lib/mobile/pages/settings_page.dart index eea1498db..e7e6daade 100644 --- a/flutter/lib/mobile/pages/settings_page.dart +++ b/flutter/lib/mobile/pages/settings_page.dart @@ -242,7 +242,7 @@ class _SettingsState extends State with WidgetsBindingObserver { }, ), SettingsTile.switchTile( - title: Text('${translate('Adaptive Bitrate')} (beta)'), + title: Text('${translate('Adaptive bitrate')} (beta)'), initialValue: _enableAbr, onToggle: (v) async { await bind.mainSetOption(key: "enable-abr", value: v ? "" : "N"); From 9905695699e105109bfefc41f7cf5538b05aee90 Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 7 Aug 2023 21:32:36 +0800 Subject: [PATCH 09/37] enable keyframe interval when recording Signed-off-by: 21pages --- flutter/lib/models/model.dart | 3 +- libs/hbb_common/protos/message.proto | 1 + libs/scrap/examples/benchmark.rs | 3 +- libs/scrap/examples/record-screen.rs | 2 +- libs/scrap/src/common/aom.rs | 8 ++- libs/scrap/src/common/codec.rs | 1 + libs/scrap/src/common/hwcodec.rs | 3 +- libs/scrap/src/common/vpxcodec.rs | 18 ++++--- src/flutter_ffi.rs | 6 +++ src/server/connection.rs | 4 ++ src/server/video_qos.rs | 11 ++++ src/server/video_service.rs | 80 ++++++++++++++++------------ src/ui/header.tis | 1 + src/ui/remote.rs | 1 + src/ui_session_interface.rs | 8 +++ 15 files changed, 105 insertions(+), 45 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index c9bcc0477..9fa73e1b7 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -1532,12 +1532,13 @@ class RecordingModel with ChangeNotifier { sessionId: sessionId, start: true, width: width, height: height); } - toggle() { + toggle() async { if (isIOS) return; final sessionId = parent.target?.sessionId; if (sessionId == null) return; _start = !_start; notifyListeners(); + await bind.sessionRecordStatus(sessionId: sessionId, status: _start); if (_start) { bind.sessionRefresh(sessionId: sessionId); } else { diff --git a/libs/hbb_common/protos/message.proto b/libs/hbb_common/protos/message.proto index dac137e1c..e6862bc80 100644 --- a/libs/hbb_common/protos/message.proto +++ b/libs/hbb_common/protos/message.proto @@ -664,6 +664,7 @@ message Misc { PluginFailure plugin_failure = 26; uint32 full_speed_fps = 27; uint32 auto_adjust_fps = 28; + bool client_record_status = 29; } } diff --git a/libs/scrap/examples/benchmark.rs b/libs/scrap/examples/benchmark.rs index f8f2e9436..83fba99d7 100644 --- a/libs/scrap/examples/benchmark.rs +++ b/libs/scrap/examples/benchmark.rs @@ -114,9 +114,9 @@ fn test_vpx( let config = EncoderCfg::VPX(VpxEncoderConfig { width: width as _, height: height as _, - timebase: [1, 1000], quality, codec: codec_id, + keyframe_interval: None, }); let mut encoder = VpxEncoder::new(config).unwrap(); let mut vpxs = vec![]; @@ -161,6 +161,7 @@ fn test_av1(yuvs: &Vec>, width: usize, height: usize, quality: Q, yuv_co width: width as _, height: height as _, quality, + keyframe_interval: None, }); let mut encoder = AomEncoder::new(config).unwrap(); let start = Instant::now(); diff --git a/libs/scrap/examples/record-screen.rs b/libs/scrap/examples/record-screen.rs index 2430e2872..6640d5698 100644 --- a/libs/scrap/examples/record-screen.rs +++ b/libs/scrap/examples/record-screen.rs @@ -113,9 +113,9 @@ fn main() -> io::Result<()> { let mut vpx = vpx_encode::VpxEncoder::new(EncoderCfg::VPX(vpx_encode::VpxEncoderConfig { width, height, - timebase: [1, 1000], quality, codec: vpx_codec, + keyframe_interval: None, })) .unwrap(); diff --git a/libs/scrap/src/common/aom.rs b/libs/scrap/src/common/aom.rs index f677858a7..dcb4968e6 100644 --- a/libs/scrap/src/common/aom.rs +++ b/libs/scrap/src/common/aom.rs @@ -45,6 +45,7 @@ pub struct AomEncoderConfig { pub width: u32, pub height: u32, pub quality: Quality, + pub keyframe_interval: Option, } pub struct AomEncoder { @@ -105,7 +106,12 @@ mod webrtc { c.g_timebase.num = 1; c.g_timebase.den = kRtpTicksPerSecond; c.g_input_bit_depth = kBitDepth; - c.kf_mode = aom_kf_mode::AOM_KF_DISABLED; + if let Some(keyframe_interval) = cfg.keyframe_interval { + c.kf_min_dist = 0; + c.kf_max_dist = keyframe_interval as _; + } else { + c.kf_mode = aom_kf_mode::AOM_KF_DISABLED; + } let (q_min, q_max, b) = AomEncoder::convert_quality(cfg.quality); if q_min > 0 && q_min < q_max && q_max < 64 { c.rc_min_quantizer = q_min; diff --git a/libs/scrap/src/common/codec.rs b/libs/scrap/src/common/codec.rs index fac5f82d7..2c3cbff6c 100644 --- a/libs/scrap/src/common/codec.rs +++ b/libs/scrap/src/common/codec.rs @@ -45,6 +45,7 @@ pub struct HwEncoderConfig { pub width: usize, pub height: usize, pub quality: Quality, + pub keyframe_interval: Option, } #[derive(Debug, Clone)] diff --git a/libs/scrap/src/common/hwcodec.rs b/libs/scrap/src/common/hwcodec.rs index ba834e048..c1fbdfa6e 100644 --- a/libs/scrap/src/common/hwcodec.rs +++ b/libs/scrap/src/common/hwcodec.rs @@ -52,6 +52,7 @@ impl EncoderApi for HwEncoder { if base_bitrate <= 0 { bitrate = base_bitrate; } + let gop = config.keyframe_interval.unwrap_or(DEFAULT_GOP as _) as i32; let ctx = EncodeContext { name: config.name.clone(), width: config.width as _, @@ -60,7 +61,7 @@ impl EncoderApi for HwEncoder { align: HW_STRIDE_ALIGN as _, bitrate: bitrate as i32 * 1000, timebase: DEFAULT_TIME_BASE, - gop: DEFAULT_GOP, + gop, quality: DEFAULT_HW_QUALITY, rc: DEFAULT_RC, thread_count: codec_thread_num() as _, // ffmpeg's thread_count is used for cpu diff --git a/libs/scrap/src/common/vpxcodec.rs b/libs/scrap/src/common/vpxcodec.rs index d17aad676..1bdde0ca6 100644 --- a/libs/scrap/src/common/vpxcodec.rs +++ b/libs/scrap/src/common/vpxcodec.rs @@ -65,8 +65,8 @@ impl EncoderApi for VpxEncoder { c.g_w = config.width; c.g_h = config.height; - c.g_timebase.num = config.timebase[0]; - c.g_timebase.den = config.timebase[1]; + c.g_timebase.num = 1; + c.g_timebase.den = 1000; // Output timestamp precision c.rc_undershoot_pct = 95; // When the data buffer falls below this percentage of fullness, a dropped frame is indicated. Set the threshold to zero (0) to disable this feature. // In dynamic scenes, low bitrate gets low fps while high bitrate gets high fps. @@ -76,9 +76,13 @@ impl EncoderApi for VpxEncoder { // https://developers.google.com/media/vp9/bitrate-modes/ // Constant Bitrate mode (CBR) is recommended for live streaming with VP9. c.rc_end_usage = vpx_rc_mode::VPX_CBR; - // c.kf_min_dist = 0; - // c.kf_max_dist = 999999; - c.kf_mode = vpx_kf_mode::VPX_KF_DISABLED; // reduce bandwidth a lot + if let Some(keyframe_interval) = config.keyframe_interval { + c.kf_min_dist = 0; + c.kf_max_dist = keyframe_interval as _; + } else { + c.kf_mode = vpx_kf_mode::VPX_KF_DISABLED; // reduce bandwidth a lot + } + let (q_min, q_max, b) = Self::convert_quality(config.quality); if q_min > 0 && q_min < q_max && q_max < 64 { c.rc_min_quantizer = q_min; @@ -343,12 +347,12 @@ pub struct VpxEncoderConfig { pub width: c_uint, /// The height (in pixels). pub height: c_uint, - /// The timebase numerator and denominator (in seconds). - pub timebase: [c_int; 2], /// The image quality pub quality: Quality, /// The codec pub codec: VpxVideoCodecId, + /// keyframe interval + pub keyframe_interval: Option, } #[derive(Clone, Copy, Debug)] diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index c4e9c2eb3..1287abf34 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -174,6 +174,12 @@ pub fn session_record_screen(session_id: SessionID, start: bool, width: usize, h } } +pub fn session_record_status(session_id: SessionID, status: bool) { + if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + session.record_status(status); + } +} + pub fn session_reconnect(session_id: SessionID, force_relay: bool) { if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { session.reconnect(force_relay); diff --git a/src/server/connection.rs b/src/server/connection.rs index f3e059696..e32a4c1c3 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1907,6 +1907,10 @@ impl Connection { .lock() .unwrap() .user_auto_adjust_fps(self.inner.id(), fps), + Some(misc::Union::ClientRecordStatus(status)) => video_service::VIDEO_QOS + .lock() + .unwrap() + .user_record(self.inner.id(), status), _ => {} }, Some(message::Union::AudioFrame(frame)) => { diff --git a/src/server/video_qos.rs b/src/server/video_qos.rs index 2ebcdaa84..e9eb9dc79 100644 --- a/src/server/video_qos.rs +++ b/src/server/video_qos.rs @@ -36,6 +36,7 @@ struct UserData { quality: Option<(i64, Quality)>, // (time, quality) delay: Option, response_delayed: bool, + record: bool, } pub struct VideoQoS { @@ -114,6 +115,10 @@ impl VideoQoS { self.quality } + pub fn record(&self) -> bool { + self.users.iter().any(|u| u.1.record) + } + pub fn abr_enabled() -> bool { "N" != Config::get_option("enable-abr") } @@ -388,6 +393,12 @@ impl VideoQoS { } } + pub fn user_record(&mut self, id: i32, v: bool) { + if let Some(user) = self.users.get_mut(&id) { + user.record = v; + } + } + pub fn on_connection_close(&mut self, id: i32) { self.users.remove(&id); self.refresh(None); diff --git a/src/server/video_service.rs b/src/server/video_service.rs index bb0697409..a74211fcd 100644 --- a/src/server/video_service.rs +++ b/src/server/video_service.rs @@ -36,7 +36,7 @@ use hbb_common::{ use scrap::Capturer; use scrap::{ aom::AomEncoderConfig, - codec::{Encoder, EncoderCfg, HwEncoderConfig}, + codec::{Encoder, EncoderCfg, HwEncoderConfig, Quality}, record::{Recorder, RecorderContext}, vpxcodec::{VpxEncoderConfig, VpxVideoCodecId}, CodecName, Display, TraitCapturer, @@ -518,37 +518,13 @@ fn run(sp: GenericService) -> ResultType<()> { let mut spf; let mut quality = video_qos.quality(); let abr = VideoQoS::abr_enabled(); - drop(video_qos); log::info!("init quality={:?}, abr enabled:{}", quality, abr); - - let encoder_cfg = match Encoder::negotiated_codec() { - scrap::CodecName::H264(name) | scrap::CodecName::H265(name) => { - EncoderCfg::HW(HwEncoderConfig { - name, - width: c.width, - height: c.height, - quality, - }) - } - name @ (scrap::CodecName::VP8 | scrap::CodecName::VP9) => { - EncoderCfg::VPX(VpxEncoderConfig { - width: c.width as _, - height: c.height as _, - timebase: [1, 1000], // Output timestamp precision - quality, - codec: if name == scrap::CodecName::VP8 { - VpxVideoCodecId::VP8 - } else { - VpxVideoCodecId::VP9 - }, - }) - } - scrap::CodecName::AV1 => EncoderCfg::AOM(AomEncoderConfig { - width: c.width as _, - height: c.height as _, - quality, - }), - }; + let codec_name = Encoder::negotiated_codec(); + let recorder = get_recorder(c.width, c.height, &codec_name); + let last_recording = + (recorder.lock().unwrap().is_some() || video_qos.record()) && codec_name != CodecName::AV1; + drop(video_qos); + let encoder_cfg = get_encoder_config(&c, quality, last_recording); let mut encoder; match Encoder::new(encoder_cfg) { @@ -597,8 +573,6 @@ fn run(sp: GenericService) -> ResultType<()> { let mut try_gdi = 1; #[cfg(windows)] log::info!("gdi: {}", c.is_gdi()); - let codec_name = Encoder::negotiated_codec(); - let recorder = get_recorder(c.width, c.height, &codec_name); #[cfg(windows)] start_uac_elevation_check(); @@ -617,6 +591,11 @@ fn run(sp: GenericService) -> ResultType<()> { allow_err!(encoder.set_quality(quality)); video_qos.store_bitrate(encoder.bitrate()); } + let recording = (recorder.lock().unwrap().is_some() || video_qos.record()) + && codec_name != CodecName::AV1; + if recording != last_recording { + bail!("SWITCH"); + } drop(video_qos); if *SWITCH.lock().unwrap() { @@ -789,6 +768,41 @@ fn run(sp: GenericService) -> ResultType<()> { Ok(()) } +fn get_encoder_config(c: &CapturerInfo, quality: Quality, recording: bool) -> EncoderCfg { + // https://www.wowza.com/community/t/the-correct-keyframe-interval-in-obs-studio/95162 + let keyframe_interval = if recording { Some(240) } else { None }; + match Encoder::negotiated_codec() { + scrap::CodecName::H264(name) | scrap::CodecName::H265(name) => { + EncoderCfg::HW(HwEncoderConfig { + name, + width: c.width, + height: c.height, + quality, + keyframe_interval, + }) + } + name @ (scrap::CodecName::VP8 | scrap::CodecName::VP9) => { + EncoderCfg::VPX(VpxEncoderConfig { + width: c.width as _, + height: c.height as _, + quality, + codec: if name == scrap::CodecName::VP8 { + VpxVideoCodecId::VP8 + } else { + VpxVideoCodecId::VP9 + }, + keyframe_interval, + }) + } + scrap::CodecName::AV1 => EncoderCfg::AOM(AomEncoderConfig { + width: c.width as _, + height: c.height as _, + quality, + keyframe_interval, + }), + } +} + fn get_recorder( width: usize, height: usize, diff --git a/src/ui/header.tis b/src/ui/header.tis index 666150fb3..2adc37027 100644 --- a/src/ui/header.tis +++ b/src/ui/header.tis @@ -297,6 +297,7 @@ class Header: Reactor.Component { event click $(span#recording) (_, me) { recording = !recording; header.update(); + handler.record_status(recording); if (recording) handler.refresh_video(); else diff --git a/src/ui/remote.rs b/src/ui/remote.rs index 6826c7e54..4ec0d5a5c 100644 --- a/src/ui/remote.rs +++ b/src/ui/remote.rs @@ -451,6 +451,7 @@ impl sciter::EventHandler for SciterSession { fn save_custom_image_quality(i32); fn refresh_video(); fn record_screen(bool, i32, i32); + fn record_status(bool); fn get_toggle_option(String); fn is_privacy_mode_supported(); fn toggle_option(String); diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 704b91cf0..10e8978c9 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -240,6 +240,14 @@ impl Session { self.send(Data::RecordScreen(start, w, h, self.id.clone())); } + pub fn record_status(&self, status: bool) { + let mut misc = Misc::new(); + misc.set_client_record_status(status); + let mut msg = Message::new(); + msg.set_misc(misc); + self.send(Data::Message(msg)); + } + pub fn save_custom_image_quality(&mut self, custom_image_quality: i32) { let msg = self .lc From 6a818763fdbbe514554a99e4f50e553c0f0c6f37 Mon Sep 17 00:00:00 2001 From: Andrzej Rudnik Date: Mon, 7 Aug 2023 20:00:33 +0200 Subject: [PATCH 10/37] Update pl.rs --- src/lang/pl.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lang/pl.rs b/src/lang/pl.rs index bfe9ecb3e..79dd74071 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -518,14 +518,14 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Exit", "Wyjście"), ("Open", "Otwórz"), ("logout_tip", "Na pewno chcesz się wylogować?"), - ("Service", ""), - ("Start", ""), - ("Stop", ""), - ("exceed_max_devices", ""), - ("Sync with recent sessions", ""), - ("Sort tags", ""), - ("Separate remote windows", ""), - ("separate window", ""), - ("Move tab to new window", ""), + ("Service", "Usługa"), + ("Start", "Uruchom"), + ("Stop", "Zatrzymaj"), + ("exceed_max_devices", "Przekroczona maks. liczba urządzeń"), + ("Sync with recent sessions", "Synchronizacja z ostatnimi sesjami"), + ("Sort tags", "Znaczniki sortowania"), + ("Separate remote windows", "Oddzielne zdalne okna"), + ("separate window", "oddzielne okno"), + ("Move tab to new window", "Przenieś zakładkę do nowego okna"), ].iter().cloned().collect(); } From b6abcaee7adfeb7f36f2218e54fbf72c0be5d94b Mon Sep 17 00:00:00 2001 From: Mr-Update <37781396+Mr-Update@users.noreply.github.com> Date: Mon, 7 Aug 2023 21:38:54 +0200 Subject: [PATCH 11/37] Update install_page.dart --- flutter/lib/desktop/pages/install_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/desktop/pages/install_page.dart b/flutter/lib/desktop/pages/install_page.dart index 69cf2ac93..871030e15 100644 --- a/flutter/lib/desktop/pages/install_page.dart +++ b/flutter/lib/desktop/pages/install_page.dart @@ -282,7 +282,7 @@ class _InstallPageBodyState extends State<_InstallPageBody> title: null, content: SelectionArea( child: - msgboxContent('info', 'Warning', 'comfirm_install_cert_tip')), + msgboxContent('info', 'Warning', 'confirm_install_cert_tip')), actions: btns, onCancel: close, ), From d43af7d8ad3d400c6c89b0257cfc89653b8f6285 Mon Sep 17 00:00:00 2001 From: Mr-Update <37781396+Mr-Update@users.noreply.github.com> Date: Mon, 7 Aug 2023 21:42:42 +0200 Subject: [PATCH 12/37] Add files via upload --- src/lang/ca.rs | 2 +- src/lang/cn.rs | 2 +- src/lang/cs.rs | 2 +- src/lang/da.rs | 2 +- src/lang/de.rs | 2 +- src/lang/el.rs | 2 +- src/lang/en.rs | 2 +- src/lang/eo.rs | 2 +- src/lang/es.rs | 2 +- src/lang/fa.rs | 2 +- src/lang/fr.rs | 2 +- src/lang/hu.rs | 2 +- src/lang/id.rs | 2 +- src/lang/it.rs | 2 +- src/lang/ja.rs | 2 +- src/lang/ko.rs | 2 +- src/lang/kz.rs | 2 +- src/lang/lt.rs | 2 +- src/lang/nl.rs | 2 +- src/lang/pl.rs | 2 +- src/lang/pt_PT.rs | 2 +- src/lang/ptbr.rs | 2 +- src/lang/ro.rs | 2 +- src/lang/ru.rs | 2 +- src/lang/sk.rs | 2 +- src/lang/sl.rs | 2 +- src/lang/sq.rs | 2 +- src/lang/sr.rs | 2 +- src/lang/sv.rs | 2 +- src/lang/template.rs | 2 +- src/lang/th.rs | 2 +- src/lang/tr.rs | 2 +- src/lang/tw.rs | 2 +- src/lang/ua.rs | 2 +- src/lang/vn.rs | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 45cee7d83..a7d4c9793 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/cn.rs b/src/lang/cn.rs index d2e3ef28a..ae3723692 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "无进行中的传输"), ("Set one-time password length", "设置一次性密码长度"), ("install_cert_tip", "安装 RustDesk 证书"), - ("comfirm_install_cert_tip", "此证书为 RustDesk 测试证书,您可以信任此证书。证书将被用于信任和安装 RustDesk 驱动。"), + ("confirm_install_cert_tip", "此证书为 RustDesk 测试证书,您可以信任此证书。证书将被用于信任和安装 RustDesk 驱动。"), ("RDP Settings", "RDP 设置"), ("Sort by", "排序方式"), ("New Connection", "新连接"), diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 563f27f89..eb958733f 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/da.rs b/src/lang/da.rs index c695b164c..36dbb2229 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Ingen overførsler i gang"), ("Set one-time password length", "Sæt engangsadgangskode længde"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "RDP indstillinger"), ("Sort by", "Sortér efter"), ("New Connection", "Ny forbindelse"), diff --git a/src/lang/de.rs b/src/lang/de.rs index 3401d1517..dfe5e39d6 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Keine Übertragungen im Gange"), ("Set one-time password length", "Länge des Einmalpassworts festlegen"), ("install_cert_tip", "RustDesk-Zertifikat installieren"), - ("comfirm_install_cert_tip", "Dies ist ein RustDesk-Testzertifikat, dem vertraut werden kann. Das Zertifikat wird verwendet, um RustDesk-Treibern bei Bedarf zu vertrauen und diese zu installieren."), + ("confirm_install_cert_tip", "Dies ist ein RustDesk-Testzertifikat, dem vertraut werden kann. Das Zertifikat wird verwendet, um RustDesk-Treibern bei Bedarf zu vertrauen und diese zu installieren."), ("RDP Settings", "RDP-Einstellungen"), ("Sort by", "Sortieren nach"), ("New Connection", "Neue Verbindung"), diff --git a/src/lang/el.rs b/src/lang/el.rs index ac0539d35..e9a547dd7 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Δεν υπάρχει μεταφορά σε εξέλιξη"), ("Set one-time password length", "Μέγεθος κωδικού μιας χρήσης"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "Ρυθμίσεις RDP"), ("Sort by", "Ταξινόμηση κατά"), ("New Connection", "Νέα σύνδεση"), diff --git a/src/lang/en.rs b/src/lang/en.rs index 001d9133d..24c7192c2 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -47,7 +47,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("relay_hint_tip", "It may not be possible to connect directly; you can try connecting via relay. Additionally, if you want to use a relay on your first attempt, you can add the \"/r\" suffix to the ID or select the option \"Always connect via relay\" in the card of recent sessions if it exists."), ("No transfers in progress", ""), ("install_cert_tip", "Install RustDesk certificate"), - ("comfirm_install_cert_tip", "This is a RustDesk testing certificate, which can be trusted. The certificate will be used to trust and install RustDesk drivers when required."), + ("confirm_install_cert_tip", "This is a RustDesk testing certificate, which can be trusted. The certificate will be used to trust and install RustDesk drivers when required."), ("empty_recent_tip", "Oops, no recent sessions!\nTime to plan a new one."), ("empty_favorite_tip", "No favorite peers yet?\nLet's find someone to connect with and add it to your favorites!"), ("empty_lan_tip", "Oh no, it looks like we haven't discovered any peers yet."), diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 26a04bc55..5ad8e19a9 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/es.rs b/src/lang/es.rs index 894e8e266..97d3f61ed 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "No hay transferencias en curso"), ("Set one-time password length", "Establecer contraseña de un solo uso"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "Ajustes RDP"), ("Sort by", "Ordenar por"), ("New Connection", "Nueva conexión"), diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 448fa5bfd..ea4656257 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "هیچ انتقالی در حال انجام نیست"), ("Set one-time password length", "طول رمز یکبار مصرف را تعیین کنید"), ("install_cert_tip", "RustDesk نصب گواهی"), - ("comfirm_install_cert_tip", "استفاده خواهد شد RustDesk است و شما می توانید به این گواهی اعتماد کنید. این گواهی برای اعتماد و نصب درایورهای RustDesk این گواهینامه یک گواهی تست"), + ("confirm_install_cert_tip", "استفاده خواهد شد RustDesk است و شما می توانید به این گواهی اعتماد کنید. این گواهی برای اعتماد و نصب درایورهای RustDesk این گواهینامه یک گواهی تست"), ("RDP Settings", "RDP تنظیمات"), ("Sort by", "مرتب سازی بر اساس"), ("New Connection", "اتصال جدید"), diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 8ec1ba8de..d2a470e35 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Pas de transfert en cours"), ("Set one-time password length", "Définir la longueur du mot de passe à usage unique"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "Configuration RDP"), ("Sort by", "Trier par"), ("New Connection", "Nouvelle connexion"), diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 2ef3d2b1f..a179c3ab1 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/id.rs b/src/lang/id.rs index ddeadc116..0c4e7e35b 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/it.rs b/src/lang/it.rs index e0d79edf8..202a455d6 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Nessun trasferimento in corso"), ("Set one-time password length", "Imposta lunghezza password monouso"), ("install_cert_tip", "Installa certificato RustDesk"), - ("comfirm_install_cert_tip", "Questo è un certificato di test RustDesk, che può essere considerato attendibile.\nIl certificato verrà usato per certificarsi ed installare i driver RustDesk quando richiesto."), + ("confirm_install_cert_tip", "Questo è un certificato di test RustDesk, che può essere considerato attendibile.\nIl certificato verrà usato per certificarsi ed installare i driver RustDesk quando richiesto."), ("RDP Settings", "Impostazioni RDP"), ("Sort by", "Ordina per"), ("New Connection", "Nuova connessione"), diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 3092c9305..747d8835b 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 52604aa2e..bdb86e52b 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/kz.rs b/src/lang/kz.rs index c253ecdcd..438227aaf 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 618e554d0..7c9884dd3 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Nevyksta jokių perdavimų"), ("Set one-time password length", "Nustatyti vienkartinio slaptažodžio ilgį"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "RDP nustatymai"), ("Sort by", "Rūšiuoti pagal"), ("New Connection", "Naujas ryšys"), diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 4e47e2c11..90b6e9624 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Geen overdrachten in uitvoering"), ("Set one-time password length", "Stel de lengte van het eenmalige wachtwoord in"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "RDP Instellingen"), ("Sort by", "Sorteren op"), ("New Connection", "Nieuwe Verbinding"), diff --git a/src/lang/pl.rs b/src/lang/pl.rs index bfe9ecb3e..1d153e364 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Brak transferów w toku"), ("Set one-time password length", "Ustaw długość jednorazowego hasła"), ("install_cert_tip", "Instalacja certyfikatu RustDesk"), - ("comfirm_install_cert_tip", "To jest certyfikat testowy RustDesk, któremu można zaufać. Certyfikat jest używany do zaufania i instalowania sterowników RustDesk w razie potrzeby."), + ("confirm_install_cert_tip", "To jest certyfikat testowy RustDesk, któremu można zaufać. Certyfikat jest używany do zaufania i instalowania sterowników RustDesk w razie potrzeby."), ("RDP Settings", "Ustawienia RDP"), ("Sort by", "Sortuj wg"), ("New Connection", "Nowe połączenie"), diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 0d7d78eb9..ddf182355 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index abf3aac93..69a154503 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Nenhuma transferência em andamento"), ("Set one-time password length", "Definir comprimento de senha descartável"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "Configurações RDP"), ("Sort by", "Ordenar por"), ("New Connection", "Nova Conexão"), diff --git a/src/lang/ro.rs b/src/lang/ro.rs index b4b372275..dee9ce028 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Niciun transfer nu este în desfășurare"), ("Set one-time password length", "Definește lungimea parolei unice"), ("install_cert_tip", "Instalează certificatul RustDesk"), - ("comfirm_install_cert_tip", "Acesta este un certificat de testare RustDesk și este de încredere. Certificatul va fi utilizat pentru a acorda încredere și instala drivere RustDesk atunci când este necesar."), + ("confirm_install_cert_tip", "Acesta este un certificat de testare RustDesk și este de încredere. Certificatul va fi utilizat pentru a acorda încredere și instala drivere RustDesk atunci când este necesar."), ("RDP Settings", "Setări RDP"), ("Sort by", "Sortează după"), ("New Connection", "Conexiune nouă"), diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 4f0e693eb..a359585de 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Передача не осуществляется"), ("Set one-time password length", "Установить длину одноразового пароля"), ("install_cert_tip", "Установить сертификат RustDesk"), - ("comfirm_install_cert_tip", "Это тестовый сертификат RustDesk, которому можно доверять. Он будет использоваться только по необходимости для установки драйверов RustDesk."), + ("confirm_install_cert_tip", "Это тестовый сертификат RustDesk, которому можно доверять. Он будет использоваться только по необходимости для установки драйверов RustDesk."), ("RDP Settings", "Настройки RDP"), ("Sort by", "Сортировка"), ("New Connection", "Новое подключение"), diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 549d5acc4..04d063bc4 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/sl.rs b/src/lang/sl.rs index c92336fc6..5df824031 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/sq.rs b/src/lang/sq.rs index fc311bd37..c4305d74a 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 5b4d6a122..031750c5c 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 8b7ad3387..5d779dbf8 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/template.rs b/src/lang/template.rs index 733d45268..9bfa58414 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/th.rs b/src/lang/th.rs index c817d4fe9..7dde8febd 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/tr.rs b/src/lang/tr.rs index bab7adf31..e16679ece 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", ""), ("Set one-time password length", ""), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", ""), ("Sort by", ""), ("New Connection", ""), diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 52f10c9ba..fb4c390e1 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "沒有正在進行的傳輸"), ("Set one-time password length", "設定一次性密碼長度"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "RDP 設定"), ("Sort by", "排序方式"), ("New Connection", "新連線"), diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 307d222e3..d218dc9d3 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Наразі нічого не пересилається"), ("Set one-time password length", "Вказати довжину одноразового пароля"), ("install_cert_tip", "Додати сертифікат Rustdesk"), - ("comfirm_install_cert_tip", "Це сертифікат тестування Rustdesk, якому можна довіряти. За потреби сертифікат буде використано для погодження та встановлення драйверів Rustdesk."), + ("confirm_install_cert_tip", "Це сертифікат тестування Rustdesk, якому можна довіряти. За потреби сертифікат буде використано для погодження та встановлення драйверів Rustdesk."), ("RDP Settings", "Налаштування RDP"), ("Sort by", "Сортувати за"), ("New Connection", "Нове підключення"), diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 0c68d1c62..2b71f9592 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("No transfers in progress", "Không có tệp tin nào đang được truyền"), ("Set one-time password length", "Thiết lập độ dài mật khẩu một lần"), ("install_cert_tip", ""), - ("comfirm_install_cert_tip", ""), + ("confirm_install_cert_tip", ""), ("RDP Settings", "Cài đặt RDP"), ("Sort by", "Sắp xếp theo"), ("New Connection", "Kết nối mới"), From ac88f55f250df6020f44bbc2cf4ef18482b6c245 Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 12:12:35 +0800 Subject: [PATCH 13/37] refact, peer card menu, open in tabs or windows Signed-off-by: dignow --- flutter/lib/common.dart | 22 +++--- flutter/lib/common/widgets/peer_card.dart | 68 ++++++++++++------- flutter/lib/consts.dart | 7 +- .../lib/desktop/pages/desktop_home_page.dart | 9 +-- .../desktop/pages/desktop_setting_page.dart | 4 +- flutter/lib/desktop/pages/remote_page.dart | 2 +- flutter/lib/utils/multi_window_manager.dart | 39 +++++------ src/lang/ca.rs | 4 +- src/lang/cn.rs | 4 +- src/lang/cs.rs | 4 +- src/lang/da.rs | 4 +- src/lang/de.rs | 4 +- src/lang/el.rs | 4 +- src/lang/eo.rs | 4 +- src/lang/es.rs | 4 +- src/lang/fa.rs | 4 +- src/lang/fr.rs | 4 +- src/lang/hu.rs | 4 +- src/lang/id.rs | 4 +- src/lang/it.rs | 4 +- src/lang/ja.rs | 4 +- src/lang/ko.rs | 4 +- src/lang/kz.rs | 4 +- src/lang/lt.rs | 4 +- src/lang/nl.rs | 4 +- src/lang/pl.rs | 4 +- src/lang/pt_PT.rs | 4 +- src/lang/ptbr.rs | 4 +- src/lang/ro.rs | 4 +- src/lang/ru.rs | 4 +- src/lang/sk.rs | 4 +- src/lang/sl.rs | 4 +- src/lang/sq.rs | 4 +- src/lang/sr.rs | 4 +- src/lang/sv.rs | 4 +- src/lang/template.rs | 4 +- src/lang/th.rs | 4 +- src/lang/tr.rs | 4 +- src/lang/tw.rs | 4 +- src/lang/ua.rs | 4 +- src/lang/vn.rs | 4 +- 41 files changed, 187 insertions(+), 100 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 71fbfcdd9..17206b8ce 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1240,7 +1240,7 @@ bool option2bool(String option, String value) { option == "stop-service" || option == "direct-server" || option == "stop-rendezvous-service" || - option == "force-always-relay") { + option == kOptionForceAlwaysRelay) { res = value == "Y"; } else { assert(false); @@ -1257,7 +1257,7 @@ String bool2option(String option, bool b) { option == "stop-service" || option == "direct-server" || option == "stop-rendezvous-service" || - option == "force-always-relay") { + option == kOptionForceAlwaysRelay) { res = b ? 'Y' : ''; } else { assert(false); @@ -1288,6 +1288,14 @@ bool mainGetLocalBoolOptionSync(String key) { return option2bool(key, bind.mainGetLocalOption(key: key)); } +bool mainGetPeerBoolOptionSync(String id, String key) { + return option2bool(key, bind.mainGetPeerOptionSync(id: id, key: key)); +} + +mainSetPeerBoolOptionSync(String id, String key, bool v) { + bind.mainSetPeerOptionSync(id: id, key: key, value: bool2option(key, v)); +} + Future matchPeer(String searchText, Peer peer) async { if (searchText.isEmpty) { return true; @@ -1545,7 +1553,9 @@ Future restoreWindowPosition(WindowType type, debugPrint("no window position saved, ignoring position restoration"); return false; } - if (type == WindowType.RemoteDesktop && !isRemotePeerPos && windowId != null) { + if (type == WindowType.RemoteDesktop && + !isRemotePeerPos && + windowId != null) { if (lpos.offsetWidth != null) { lpos.offsetWidth = lpos.offsetWidth! + windowId * 20; } @@ -1801,14 +1811,13 @@ connectMainDesktop( required bool isTcpTunneling, required bool isRDP, bool? forceRelay, - bool forceSeparateWindow = false, }) async { if (isFileTransfer) { await rustDeskWinManager.newFileTransfer(id, forceRelay: forceRelay); } else if (isTcpTunneling || isRDP) { await rustDeskWinManager.newPortForward(id, isRDP, forceRelay: forceRelay); } else { - await rustDeskWinManager.newRemoteDesktop(id, forceRelay: forceRelay, forceSeparateWindow: forceSeparateWindow); + await rustDeskWinManager.newRemoteDesktop(id, forceRelay: forceRelay); } } @@ -1822,7 +1831,6 @@ connect( bool isFileTransfer = false, bool isTcpTunneling = false, bool isRDP = false, - bool forceSeparateWindow = false, }) async { if (id == '') return; id = id.replaceAll(' ', ''); @@ -1840,7 +1848,6 @@ connect( isTcpTunneling: isTcpTunneling, isRDP: isRDP, forceRelay: forceRelay, - forceSeparateWindow: forceSeparateWindow, ); } else { await rustDeskWinManager.call(WindowType.Main, kWindowConnect, { @@ -1849,7 +1856,6 @@ connect( 'isTcpTunneling': isTcpTunneling, 'isRDP': isRDP, 'forceRelay': forceRelay, - 'forceSeparateWindow': forceSeparateWindow, }); } } else { diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 61c5cb69e..936be6c20 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -404,7 +404,6 @@ abstract class BasePeerCard extends StatelessWidget { bool isFileTransfer = false, bool isTcpTunneling = false, bool isRDP = false, - bool forceSeparateWindow = false, }) { return MenuEntryButton( childBuilder: (TextStyle? style) => Text( @@ -418,7 +417,6 @@ abstract class BasePeerCard extends StatelessWidget { isFileTransfer: isFileTransfer, isTcpTunneling: isTcpTunneling, isRDP: isRDP, - forceSeparateWindow: forceSeparateWindow, ); }, padding: menuPadding, @@ -427,25 +425,13 @@ abstract class BasePeerCard extends StatelessWidget { } @protected - List> _connectActions(BuildContext context, Peer peer) { - final actions = [_connectAction(context, peer, false)]; - if (!mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow)) { - actions.add(_connectAction(context, peer, true)); - } - return actions; - } - - @protected - MenuEntryBase _connectAction( - BuildContext context, Peer peer, bool forceSeparateWindow) { + MenuEntryBase _connectAction(BuildContext context, Peer peer) { return _connectCommonAction( context, peer.id, (peer.alias.isEmpty - ? translate('Connect') - : '${translate('Connect')} ${peer.id}') + - (forceSeparateWindow ? ' (${translate('separate window')})' : ''), - forceSeparateWindow: forceSeparateWindow, + ? translate('Connect') + : '${translate('Connect')} ${peer.id}'), ); } @@ -538,15 +524,40 @@ abstract class BasePeerCard extends StatelessWidget { ); } + Future> _openNewConnInAction( + String id, String label, String key) async { + return MenuEntrySwitch( + switchType: SwitchType.scheckbox, + text: translate(label), + getter: () async => mainGetPeerBoolOptionSync(id, key), + setter: (bool v) async { + await bind.mainSetPeerOption( + id: id, key: key, value: bool2option(key, v)); + }, + padding: menuPadding, + dismissOnClicked: true, + ); + } + + _openInTabsAction(String id) async => + await _openNewConnInAction(id, 'Open in Tabs', kOptionOpenInTabs); + + _openInWindowsAction(String id) async => + await _openNewConnInAction(id, 'Open in windows', kOptionOpenInWindows); + + _openNewConnInOptAction(String id) async => + mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs) + ? await _openInWindowsAction(id) + : await _openInTabsAction(id); + @protected Future _isForceAlwaysRelay(String id) async { - return (await bind.mainGetPeerOption(id: id, key: 'force-always-relay')) + return (await bind.mainGetPeerOption(id: id, key: kOptionForceAlwaysRelay)) .isNotEmpty; } @protected Future> _forceAlwaysRelayAction(String id) async { - const option = 'force-always-relay'; return MenuEntrySwitch( switchType: SwitchType.scheckbox, text: translate('Always connect via relay'), @@ -555,7 +566,9 @@ abstract class BasePeerCard extends StatelessWidget { }, setter: (bool v) async { await bind.mainSetPeerOption( - id: id, key: option, value: bool2option(option, v)); + id: id, + key: kOptionForceAlwaysRelay, + value: bool2option(kOptionForceAlwaysRelay, v)); }, padding: menuPadding, dismissOnClicked: true, @@ -813,7 +826,7 @@ class RecentPeerCard extends BasePeerCard { Future>> _buildMenuItems( BuildContext context) async { final List> menuItems = [ - ..._connectActions(context, peer), + _connectAction(context, peer), _transferFileAction(context, peer.id), ]; @@ -822,6 +835,7 @@ class RecentPeerCard extends BasePeerCard { if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } + menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -869,12 +883,13 @@ class FavoritePeerCard extends BasePeerCard { Future>> _buildMenuItems( BuildContext context) async { final List> menuItems = [ - ..._connectActions(context, peer), + _connectAction(context, peer), _transferFileAction(context, peer.id), ]; if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } + menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -919,7 +934,7 @@ class DiscoveredPeerCard extends BasePeerCard { Future>> _buildMenuItems( BuildContext context) async { final List> menuItems = [ - ..._connectActions(context, peer), + _connectAction(context, peer), _transferFileAction(context, peer.id), ]; @@ -928,6 +943,7 @@ class DiscoveredPeerCard extends BasePeerCard { if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } + menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -971,12 +987,13 @@ class AddressBookPeerCard extends BasePeerCard { Future>> _buildMenuItems( BuildContext context) async { final List> menuItems = [ - ..._connectActions(context, peer), + _connectAction(context, peer), _transferFileAction(context, peer.id), ]; if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } + menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -1033,12 +1050,13 @@ class MyGroupPeerCard extends BasePeerCard { Future>> _buildMenuItems( BuildContext context) async { final List> menuItems = [ - ..._connectActions(context, peer), + _connectAction(context, peer), _transferFileAction(context, peer.id), ]; if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } + menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 99a87362e..5376196e4 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -22,8 +22,6 @@ const String kAppTypeDesktopRemote = "remote"; const String kAppTypeDesktopFileTransfer = "file transfer"; const String kAppTypeDesktopPortForward = "port forward"; -const bool kCloseMultiWindowByHide = true; - const String kWindowMainWindowOnTop = "main_window_on_top"; const String kWindowGetWindowInfo = "get_window_info"; const String kWindowDisableGrabKeyboard = "disable_grab_keyboard"; @@ -42,7 +40,10 @@ const String kWindowEventGetSessionIdList = "get_session_id_list"; const String kWindowEventMoveTabToNewWindow = "move_tab_to_new_window"; const String kWindowEventCloseForSeparateWindow = "close_for_separate_window"; -const String kOptionSeparateRemoteWindow = "allow-separate-remote-window"; +const String kOptionOpenNewConnInTabs = "enable-open-new-connections-in-tabs"; +const String kOptionOpenInTabs = "allow-open-in-tabs"; +const String kOptionOpenInWindows = "allow-open-in-windows"; +const String kOptionForceAlwaysRelay = "force-always-relay"; const String kUniLinksPrefix = "rustdesk://"; const String kUrlActionClose = "close"; diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index b87820b97..7bf303a68 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -554,13 +554,7 @@ class _DesktopHomePageState extends State } else if (call.method == kWindowEventShow) { await rustDeskWinManager.registerActiveWindow(call.arguments["id"]); } else if (call.method == kWindowEventHide) { - final wId = call.arguments['id']; - final isSeparateWindowEnabled = - mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow); - if (isSeparateWindowEnabled && !kCloseMultiWindowByHide) { - await rustDeskWinManager.destroyWindow(wId); - } - await rustDeskWinManager.unregisterActiveWindow(wId); + await rustDeskWinManager.unregisterActiveWindow(call.arguments['id']); } else if (call.method == kWindowConnect) { await connectMainDesktop( call.arguments['id'], @@ -568,7 +562,6 @@ class _DesktopHomePageState extends State isTcpTunneling: call.arguments['isTcpTunneling'], isRDP: call.arguments['isRDP'], forceRelay: call.arguments['forceRelay'], - forceSeparateWindow: call.arguments['forceSeparateWindow'], ); } else if (call.method == kWindowEventMoveTabToNewWindow) { final args = call.arguments.split(','); diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 4a4992c58..33b0a2e43 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -319,8 +319,8 @@ class _GeneralState extends State<_General> { _OptionCheckBox(context, 'Adaptive bitrate', 'enable-abr'), _OptionCheckBox( context, - 'Separate remote windows', - kOptionSeparateRemoteWindow, + 'Open new connections in tabs', + kOptionOpenNewConnInTabs, isServer: false, ), ]; diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 32faf08ae..35d20a263 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -116,7 +116,7 @@ class _RemotePageState extends State Wakelock.enable(); } // Register texture. - if (mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow)) { + if (mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)) { _renderTexture = renderTexture; } else { _renderTexture = RenderTexture(); diff --git a/flutter/lib/utils/multi_window_manager.dart b/flutter/lib/utils/multi_window_manager.dart index 0a1858c2c..abd76238e 100644 --- a/flutter/lib/utils/multi_window_manager.dart +++ b/flutter/lib/utils/multi_window_manager.dart @@ -81,19 +81,24 @@ class RustDeskMultiWindowManager { } _newSession( - bool separateWindow, + bool openInTabs, WindowType type, String methodName, String remoteId, List windows, String msg, ) async { - if (separateWindow) { - if (kCloseMultiWindowByHide && _inactiveWindows.isNotEmpty) { + if (openInTabs) { + if (windows.isEmpty) { + await newSessionWindow(type, remoteId, msg, windows); + } else { + call(type, methodName, msg); + } + } else { + if (_inactiveWindows.isNotEmpty) { for (final windowId in windows) { if (_inactiveWindows.contains(windowId)) { - await DesktopMultiWindow.invokeMethod( - windowId, methodName, msg); + await DesktopMultiWindow.invokeMethod(windowId, methodName, msg); WindowController.fromWindowId(windowId).show(); registerActiveWindow(windowId); return; @@ -101,12 +106,6 @@ class RustDeskMultiWindowManager { } } await newSessionWindow(type, remoteId, msg, windows); - } else { - if (windows.isEmpty) { - await newSessionWindow(type, remoteId, msg, windows); - } else { - call(type, methodName, msg); - } } } @@ -119,7 +118,6 @@ class RustDeskMultiWindowManager { bool? forceRelay, String? switchUuid, bool? isRDP, - bool forceSeparateWindow = false, }) async { var params = { "type": type.index, @@ -136,11 +134,16 @@ class RustDeskMultiWindowManager { final msg = jsonEncode(params); // separate window for file transfer is not supported - bool separateWindow = forceSeparateWindow || - (type != WindowType.FileTransfer && - mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow)); + bool openInTabs = false; + if (type == WindowType.RemoteDesktop) { + if (mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)) { + openInTabs = !mainGetPeerBoolOptionSync(remoteId, kOptionOpenInWindows); + } else { + openInTabs = mainGetPeerBoolOptionSync(remoteId, kOptionOpenInTabs); + } + } - if (windows.length > 1 || separateWindow) { + if (windows.length > 1 || !openInTabs) { for (final windowId in windows) { if (await DesktopMultiWindow.invokeMethod( windowId, kWindowEventActiveSession, remoteId)) { @@ -149,7 +152,7 @@ class RustDeskMultiWindowManager { } } - await _newSession(separateWindow, type, methodName, remoteId, windows, msg); + await _newSession(openInTabs, type, methodName, remoteId, windows, msg); } Future newRemoteDesktop( @@ -157,7 +160,6 @@ class RustDeskMultiWindowManager { String? password, String? switchUuid, bool? forceRelay, - bool forceSeparateWindow = false, }) async { return await newSession( WindowType.RemoteDesktop, @@ -167,7 +169,6 @@ class RustDeskMultiWindowManager { password: password, forceRelay: forceRelay, switchUuid: switchUuid, - forceSeparateWindow: forceSeparateWindow, ); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index a7d4c9793..2a38db38f 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/cn.rs b/src/lang/cn.rs index ae3723692..f8f191f66 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "管理的设备数已达到最大值"), ("Sync with recent sessions", "同步最近会话"), ("Sort tags", "对标签进行排序"), - ("Separate remote windows", "使用独立远程窗口"), + ("Open new connections in tabs", "在选项卡中打开新连接"), + ("Open in tabs", "在选项卡中打开"), + ("Open in windows", "在新窗口中打开"), ("separate window", "独立窗口"), ("Move tab to new window", "将标签页移至新窗口"), ].iter().cloned().collect(); diff --git a/src/lang/cs.rs b/src/lang/cs.rs index eb958733f..6160a0e87 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/da.rs b/src/lang/da.rs index 36dbb2229..7f7acda4a 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/de.rs b/src/lang/de.rs index dfe5e39d6..3e3f258dc 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Sie haben die maximale Anzahl der verwalteten Geräte erreicht."), ("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"), ("Sort tags", "Tags sortieren"), - ("Separate remote windows", "Separate entfernte Fenster"), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", "Separates Fenster"), ("Move tab to new window", "Tab in neues Fenster verschieben"), ].iter().cloned().collect(); diff --git a/src/lang/el.rs b/src/lang/el.rs index e9a547dd7..93ead4c88 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 5ad8e19a9..a966e2260 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/es.rs b/src/lang/es.rs index 97d3f61ed..a7856d93b 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Has alcanzado el máximo número de dispositivos administrados."), ("Sync with recent sessions", "Sincronizar con sesiones recientes"), ("Sort tags", "Ordenar etiquetas"), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fa.rs b/src/lang/fa.rs index ea4656257..819ebac61 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fr.rs b/src/lang/fr.rs index d2a470e35..8d614c1b6 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/hu.rs b/src/lang/hu.rs index a179c3ab1..6f5939e63 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/id.rs b/src/lang/id.rs index 0c4e7e35b..d0dc47e82 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/it.rs b/src/lang/it.rs index 202a455d6..d6ca7a42b 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Hai raggiunto il numero massimo di dispositivi gestibili."), ("Sync with recent sessions", "Sincronizza con le sessioni recenti"), ("Sort tags", "Ordina etichette"), - ("Separate remote windows", "Separa finestre remote"), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", "Separa finestra"), ("Move tab to new window", "Sposta scheda nella finestra successiva"), ].iter().cloned().collect(); diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 747d8835b..165f30ade 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ko.rs b/src/lang/ko.rs index bdb86e52b..13075b9ff 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 438227aaf..5907f44f6 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 7c9884dd3..cacd8daf2 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 90b6e9624..9399062b2 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Het maximum aantal gecontroleerde apparaten is bereikt."), ("Sync with recent sessions", "Recente sessies synchroniseren"), ("Sort tags", "Labels sorteren"), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 733a607cc..8c12cfea0 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Przekroczona maks. liczba urządzeń"), ("Sync with recent sessions", "Synchronizacja z ostatnimi sesjami"), ("Sort tags", "Znaczniki sortowania"), - ("Separate remote windows", "Oddzielne zdalne okna"), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", "oddzielne okno"), ("Move tab to new window", "Przenieś zakładkę do nowego okna"), ].iter().cloned().collect(); diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index ddf182355..b0ec7d50d 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 69a154503..b3c2debe0 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ro.rs b/src/lang/ro.rs index dee9ce028..91f5990d0 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ru.rs b/src/lang/ru.rs index a359585de..ee4a7cdee 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Достигнуто максимальне количество управляемых устройств."), ("Sync with recent sessions", "Синхронизация последних сессий"), ("Sort tags", "Сортировка меток"), - ("Separate remote windows", "Отдельные удалённые окна"), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", "отдельное окно"), ("Move tab to new window", "Переместить вкладку в отдельное окно"), ].iter().cloned().collect(); diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 04d063bc4..01b671ce0 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 5df824031..02b8d622e 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sq.rs b/src/lang/sq.rs index c4305d74a..f9f6434e2 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 031750c5c..91e0fc778 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 5d779dbf8..1e899e008 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/template.rs b/src/lang/template.rs index 9bfa58414..372289819 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/th.rs b/src/lang/th.rs index 7dde8febd..a4d166036 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tr.rs b/src/lang/tr.rs index e16679ece..4e29f041d 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tw.rs b/src/lang/tw.rs index fb4c390e1..fc656208d 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ua.rs b/src/lang/ua.rs index d218dc9d3..db04a7740 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 2b71f9592..ca99323fa 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -524,7 +524,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Separate remote windows", ""), + ("Open new connections in tabs", ""), + ("Open in tabs", ""), + ("Open in windows", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); From b5679df7f9264a59b3ab70084ae97621d0d8eac8 Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 13:50:29 +0800 Subject: [PATCH 14/37] refact, peer card menu, open in tabs action Signed-off-by: dignow --- flutter/lib/common/widgets/peer_card.dart | 2 +- src/lang/ca.rs | 4 ++-- src/lang/cn.rs | 4 ++-- src/lang/cs.rs | 4 ++-- src/lang/da.rs | 4 ++-- src/lang/de.rs | 4 ++-- src/lang/el.rs | 4 ++-- src/lang/en.rs | 1 + src/lang/eo.rs | 4 ++-- src/lang/es.rs | 4 ++-- src/lang/fa.rs | 4 ++-- src/lang/fr.rs | 4 ++-- src/lang/hu.rs | 4 ++-- src/lang/id.rs | 4 ++-- src/lang/it.rs | 4 ++-- src/lang/ja.rs | 4 ++-- src/lang/ko.rs | 4 ++-- src/lang/kz.rs | 4 ++-- src/lang/lt.rs | 4 ++-- src/lang/nl.rs | 4 ++-- src/lang/pl.rs | 4 ++-- src/lang/pt_PT.rs | 4 ++-- src/lang/ptbr.rs | 4 ++-- src/lang/ro.rs | 4 ++-- src/lang/ru.rs | 4 ++-- src/lang/sk.rs | 4 ++-- src/lang/sl.rs | 4 ++-- src/lang/sq.rs | 4 ++-- src/lang/sr.rs | 4 ++-- src/lang/sv.rs | 4 ++-- src/lang/template.rs | 4 ++-- src/lang/th.rs | 4 ++-- src/lang/tr.rs | 4 ++-- src/lang/tw.rs | 4 ++-- src/lang/ua.rs | 4 ++-- src/lang/vn.rs | 4 ++-- 36 files changed, 70 insertions(+), 69 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 936be6c20..dc8b9a667 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -543,7 +543,7 @@ abstract class BasePeerCard extends StatelessWidget { await _openNewConnInAction(id, 'Open in Tabs', kOptionOpenInTabs); _openInWindowsAction(String id) async => - await _openNewConnInAction(id, 'Open in windows', kOptionOpenInWindows); + await _openNewConnInAction(id, 'Open with New window', kOptionOpenInWindows); _openNewConnInOptAction(String id) async => mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs) diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 2a38db38f..02b366fd6 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/cn.rs b/src/lang/cn.rs index f8f191f66..a524997b2 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "同步最近会话"), ("Sort tags", "对标签进行排序"), ("Open new connections in tabs", "在选项卡中打开新连接"), - ("Open in tabs", "在选项卡中打开"), - ("Open in windows", "在新窗口中打开"), + ("Open in Tabs", "在选项卡中打开"), + ("Open with New window", "在新窗口中打开"), ("separate window", "独立窗口"), ("Move tab to new window", "将标签页移至新窗口"), ].iter().cloned().collect(); diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 6160a0e87..1103c86ab 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/da.rs b/src/lang/da.rs index 7f7acda4a..ac00a4569 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/de.rs b/src/lang/de.rs index 3e3f258dc..17a1a8a76 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"), ("Sort tags", "Tags sortieren"), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", "Separates Fenster"), ("Move tab to new window", "Tab in neues Fenster verschieben"), ].iter().cloned().collect(); diff --git a/src/lang/el.rs b/src/lang/el.rs index 93ead4c88..0e1af3967 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/en.rs b/src/lang/en.rs index 24c7192c2..2a9b40568 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -12,6 +12,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("not_close_tcp_tip", "Don't close this window while you are using the tunnel"), ("setup_server_tip", "For faster connection, please set up your own server"), ("Auto Login", "Auto Login (Only valid if you set \"Lock after session end\")"), + ("Always connect via relay", "Always Connect via Relay"), ("whitelist_tip", "Only whitelisted IP can access me"), ("whitelist_sep", "Separated by comma, semicolon, spaces or new line"), ("Wrong credentials", "Wrong username or password"), diff --git a/src/lang/eo.rs b/src/lang/eo.rs index a966e2260..10ffff3a7 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/es.rs b/src/lang/es.rs index a7856d93b..afd231960 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Sincronizar con sesiones recientes"), ("Sort tags", "Ordenar etiquetas"), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 819ebac61..9ccfa7e9a 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 8d614c1b6..75b3ef275 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 6f5939e63..52580db9b 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/id.rs b/src/lang/id.rs index d0dc47e82..513325aef 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/it.rs b/src/lang/it.rs index d6ca7a42b..0385b300e 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Sincronizza con le sessioni recenti"), ("Sort tags", "Ordina etichette"), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", "Separa finestra"), ("Move tab to new window", "Sposta scheda nella finestra successiva"), ].iter().cloned().collect(); diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 165f30ade..e2a89f803 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 13075b9ff..0e0160527 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 5907f44f6..09eb5c2b6 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/lt.rs b/src/lang/lt.rs index cacd8daf2..a1a14578a 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 9399062b2..3ef4c733e 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Recente sessies synchroniseren"), ("Sort tags", "Labels sorteren"), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 8c12cfea0..76c2766b0 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Synchronizacja z ostatnimi sesjami"), ("Sort tags", "Znaczniki sortowania"), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", "oddzielne okno"), ("Move tab to new window", "Przenieś zakładkę do nowego okna"), ].iter().cloned().collect(); diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index b0ec7d50d..2ec34dc9a 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index b3c2debe0..f749479aa 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 91f5990d0..c784a6aa3 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ru.rs b/src/lang/ru.rs index ee4a7cdee..6b86ea756 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Синхронизация последних сессий"), ("Sort tags", "Сортировка меток"), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", "отдельное окно"), ("Move tab to new window", "Переместить вкладку в отдельное окно"), ].iter().cloned().collect(); diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 01b671ce0..ced5b01b6 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 02b8d622e..c9a11e7c4 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sq.rs b/src/lang/sq.rs index f9f6434e2..3d1d22d20 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 91e0fc778..e9601d933 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 1e899e008..3588733f0 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/template.rs b/src/lang/template.rs index 372289819..54095748e 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/th.rs b/src/lang/th.rs index a4d166036..6cb00c453 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 4e29f041d..b7362205f 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tw.rs b/src/lang/tw.rs index fc656208d..6bbac0463 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ua.rs b/src/lang/ua.rs index db04a7740..b65b3068b 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/vn.rs b/src/lang/vn.rs index ca99323fa..d3ca91ccc 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -525,8 +525,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in tabs", ""), - ("Open in windows", ""), + ("Open in Tabs", ""), + ("Open with New window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); From 836a2b0fbd1235fb1c8cc117f962d78fcb7ffa22 Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 14:07:40 +0800 Subject: [PATCH 15/37] fix label Signed-off-by: dignow --- flutter/lib/common/widgets/peer_card.dart | 2 +- src/lang/ca.rs | 2 +- src/lang/cn.rs | 2 +- src/lang/cs.rs | 2 +- src/lang/da.rs | 2 +- src/lang/de.rs | 2 +- src/lang/el.rs | 2 +- src/lang/eo.rs | 2 +- src/lang/es.rs | 2 +- src/lang/fa.rs | 2 +- src/lang/fr.rs | 2 +- src/lang/hu.rs | 2 +- src/lang/id.rs | 2 +- src/lang/it.rs | 2 +- src/lang/ja.rs | 2 +- src/lang/ko.rs | 2 +- src/lang/kz.rs | 2 +- src/lang/lt.rs | 2 +- src/lang/nl.rs | 2 +- src/lang/pl.rs | 2 +- src/lang/pt_PT.rs | 2 +- src/lang/ptbr.rs | 2 +- src/lang/ro.rs | 2 +- src/lang/ru.rs | 2 +- src/lang/sk.rs | 2 +- src/lang/sl.rs | 2 +- src/lang/sq.rs | 2 +- src/lang/sr.rs | 2 +- src/lang/sv.rs | 2 +- src/lang/template.rs | 2 +- src/lang/th.rs | 2 +- src/lang/tr.rs | 2 +- src/lang/tw.rs | 2 +- src/lang/ua.rs | 2 +- src/lang/vn.rs | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index dc8b9a667..a1c800c8a 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -543,7 +543,7 @@ abstract class BasePeerCard extends StatelessWidget { await _openNewConnInAction(id, 'Open in Tabs', kOptionOpenInTabs); _openInWindowsAction(String id) async => - await _openNewConnInAction(id, 'Open with New window', kOptionOpenInWindows); + await _openNewConnInAction(id, 'Open with New Window', kOptionOpenInWindows); _openNewConnInOptAction(String id) async => mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs) diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 02b366fd6..0bf0bb3e4 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/cn.rs b/src/lang/cn.rs index a524997b2..d13914094 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "对标签进行排序"), ("Open new connections in tabs", "在选项卡中打开新连接"), ("Open in Tabs", "在选项卡中打开"), - ("Open with New window", "在新窗口中打开"), + ("Open with New Window", "在新窗口中打开"), ("separate window", "独立窗口"), ("Move tab to new window", "将标签页移至新窗口"), ].iter().cloned().collect(); diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 1103c86ab..c857c1a60 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/da.rs b/src/lang/da.rs index ac00a4569..26d35390a 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/de.rs b/src/lang/de.rs index 17a1a8a76..5dbaaac12 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Tags sortieren"), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", "Separates Fenster"), ("Move tab to new window", "Tab in neues Fenster verschieben"), ].iter().cloned().collect(); diff --git a/src/lang/el.rs b/src/lang/el.rs index 0e1af3967..3a6bda3f9 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 10ffff3a7..c0259aff0 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/es.rs b/src/lang/es.rs index afd231960..da98bcb43 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Ordenar etiquetas"), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 9ccfa7e9a..bb61497f0 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 75b3ef275..e1c79e528 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 52580db9b..4fea28276 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/id.rs b/src/lang/id.rs index 513325aef..3549da2b6 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/it.rs b/src/lang/it.rs index 0385b300e..ded2e5a01 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Ordina etichette"), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", "Separa finestra"), ("Move tab to new window", "Sposta scheda nella finestra successiva"), ].iter().cloned().collect(); diff --git a/src/lang/ja.rs b/src/lang/ja.rs index e2a89f803..334e99bda 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 0e0160527..6cc4170f5 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 09eb5c2b6..59ef40dcd 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/lt.rs b/src/lang/lt.rs index a1a14578a..3f8bbdc5e 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 3ef4c733e..9ef86b6ca 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Labels sorteren"), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 76c2766b0..e77f64367 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Znaczniki sortowania"), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", "oddzielne okno"), ("Move tab to new window", "Przenieś zakładkę do nowego okna"), ].iter().cloned().collect(); diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 2ec34dc9a..7f54d1667 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index f749479aa..7f55d2597 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ro.rs b/src/lang/ro.rs index c784a6aa3..3ce0446f5 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 6b86ea756..a23030e1d 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Сортировка меток"), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", "отдельное окно"), ("Move tab to new window", "Переместить вкладку в отдельное окно"), ].iter().cloned().collect(); diff --git a/src/lang/sk.rs b/src/lang/sk.rs index ced5b01b6..5f74a0721 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sl.rs b/src/lang/sl.rs index c9a11e7c4..f4a7946ca 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 3d1d22d20..dfaad1051 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sr.rs b/src/lang/sr.rs index e9601d933..be85ffcba 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 3588733f0..e8ef6c476 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/template.rs b/src/lang/template.rs index 54095748e..c76b3b226 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/th.rs b/src/lang/th.rs index 6cb00c453..056d0ca06 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tr.rs b/src/lang/tr.rs index b7362205f..39dab06cf 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 6bbac0463..d58f7e8fe 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ua.rs b/src/lang/ua.rs index b65b3068b..13e6cb1d0 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/vn.rs b/src/lang/vn.rs index d3ca91ccc..18c81f29b 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -526,7 +526,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Open new connections in tabs", ""), ("Open in Tabs", ""), - ("Open with New window", ""), + ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); From 9b614c8b3233467b083691d521d24b28f863bd3b Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 14:22:32 +0800 Subject: [PATCH 16/37] remove peer card menu Signed-off-by: dignow --- flutter/lib/common/widgets/peer_card.dart | 10 +++++----- flutter/lib/utils/multi_window_manager.dart | 10 ++-------- src/lang/ca.rs | 2 -- src/lang/cn.rs | 2 -- src/lang/cs.rs | 2 -- src/lang/da.rs | 2 -- src/lang/de.rs | 2 -- src/lang/el.rs | 2 -- src/lang/eo.rs | 2 -- src/lang/es.rs | 2 -- src/lang/fa.rs | 2 -- src/lang/fr.rs | 2 -- src/lang/hu.rs | 2 -- src/lang/id.rs | 2 -- src/lang/it.rs | 2 -- src/lang/ja.rs | 2 -- src/lang/ko.rs | 2 -- src/lang/kz.rs | 2 -- src/lang/lt.rs | 2 -- src/lang/nl.rs | 2 -- src/lang/pl.rs | 2 -- src/lang/pt_PT.rs | 2 -- src/lang/ptbr.rs | 2 -- src/lang/ro.rs | 2 -- src/lang/ru.rs | 2 -- src/lang/sk.rs | 2 -- src/lang/sl.rs | 2 -- src/lang/sq.rs | 2 -- src/lang/sr.rs | 2 -- src/lang/sv.rs | 2 -- src/lang/template.rs | 2 -- src/lang/th.rs | 2 -- src/lang/tr.rs | 2 -- src/lang/tw.rs | 2 -- src/lang/ua.rs | 2 -- src/lang/vn.rs | 2 -- 36 files changed, 7 insertions(+), 81 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index a1c800c8a..50beda75c 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -835,7 +835,7 @@ class RecentPeerCard extends BasePeerCard { if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } - menuItems.add(await _openNewConnInOptAction(peer.id)); + // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -889,7 +889,7 @@ class FavoritePeerCard extends BasePeerCard { if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } - menuItems.add(await _openNewConnInOptAction(peer.id)); + // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -943,7 +943,7 @@ class DiscoveredPeerCard extends BasePeerCard { if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } - menuItems.add(await _openNewConnInOptAction(peer.id)); + // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -993,7 +993,7 @@ class AddressBookPeerCard extends BasePeerCard { if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } - menuItems.add(await _openNewConnInOptAction(peer.id)); + // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); @@ -1056,7 +1056,7 @@ class MyGroupPeerCard extends BasePeerCard { if (isDesktop && peer.platform != 'Android') { menuItems.add(_tcpTunnelingAction(context, peer.id)); } - menuItems.add(await _openNewConnInOptAction(peer.id)); + // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); if (peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); diff --git a/flutter/lib/utils/multi_window_manager.dart b/flutter/lib/utils/multi_window_manager.dart index abd76238e..e87551d6b 100644 --- a/flutter/lib/utils/multi_window_manager.dart +++ b/flutter/lib/utils/multi_window_manager.dart @@ -134,14 +134,8 @@ class RustDeskMultiWindowManager { final msg = jsonEncode(params); // separate window for file transfer is not supported - bool openInTabs = false; - if (type == WindowType.RemoteDesktop) { - if (mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)) { - openInTabs = !mainGetPeerBoolOptionSync(remoteId, kOptionOpenInWindows); - } else { - openInTabs = mainGetPeerBoolOptionSync(remoteId, kOptionOpenInTabs); - } - } + bool openInTabs = type != WindowType.RemoteDesktop || + mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs); if (windows.length > 1 || !openInTabs) { for (final windowId in windows) { diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 0bf0bb3e4..c88e07198 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/cn.rs b/src/lang/cn.rs index d13914094..644882b64 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "同步最近会话"), ("Sort tags", "对标签进行排序"), ("Open new connections in tabs", "在选项卡中打开新连接"), - ("Open in Tabs", "在选项卡中打开"), - ("Open with New Window", "在新窗口中打开"), ("separate window", "独立窗口"), ("Move tab to new window", "将标签页移至新窗口"), ].iter().cloned().collect(); diff --git a/src/lang/cs.rs b/src/lang/cs.rs index c857c1a60..2c0f62a8a 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/da.rs b/src/lang/da.rs index 26d35390a..0da788f32 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/de.rs b/src/lang/de.rs index 5dbaaac12..e177ccd14 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"), ("Sort tags", "Tags sortieren"), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", "Separates Fenster"), ("Move tab to new window", "Tab in neues Fenster verschieben"), ].iter().cloned().collect(); diff --git a/src/lang/el.rs b/src/lang/el.rs index 3a6bda3f9..c98065d55 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/eo.rs b/src/lang/eo.rs index c0259aff0..2959f8224 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/es.rs b/src/lang/es.rs index da98bcb43..40b0f8aa2 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Sincronizar con sesiones recientes"), ("Sort tags", "Ordenar etiquetas"), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fa.rs b/src/lang/fa.rs index bb61497f0..d7ffcba2d 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/fr.rs b/src/lang/fr.rs index e1c79e528..d5d2bf162 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 4fea28276..b4a51e1ca 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/id.rs b/src/lang/id.rs index 3549da2b6..0be40ee12 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/it.rs b/src/lang/it.rs index ded2e5a01..f0091ec0f 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Sincronizza con le sessioni recenti"), ("Sort tags", "Ordina etichette"), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", "Separa finestra"), ("Move tab to new window", "Sposta scheda nella finestra successiva"), ].iter().cloned().collect(); diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 334e99bda..5cb55777a 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 6cc4170f5..0e3a3b614 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 59ef40dcd..378466334 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 3f8bbdc5e..e1ff74feb 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 9ef86b6ca..4c6b7cc05 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Recente sessies synchroniseren"), ("Sort tags", "Labels sorteren"), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/pl.rs b/src/lang/pl.rs index e77f64367..21deb87a8 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Synchronizacja z ostatnimi sesjami"), ("Sort tags", "Znaczniki sortowania"), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", "oddzielne okno"), ("Move tab to new window", "Przenieś zakładkę do nowego okna"), ].iter().cloned().collect(); diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 7f54d1667..40653dc67 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 7f55d2597..4544bbe3a 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 3ce0446f5..eca9f0263 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ru.rs b/src/lang/ru.rs index a23030e1d..13164a4dc 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Синхронизация последних сессий"), ("Sort tags", "Сортировка меток"), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", "отдельное окно"), ("Move tab to new window", "Переместить вкладку в отдельное окно"), ].iter().cloned().collect(); diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 5f74a0721..b27b28863 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sl.rs b/src/lang/sl.rs index f4a7946ca..99eb2371b 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sq.rs b/src/lang/sq.rs index dfaad1051..251e11a29 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sr.rs b/src/lang/sr.rs index be85ffcba..d213cd277 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/sv.rs b/src/lang/sv.rs index e8ef6c476..636423607 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/template.rs b/src/lang/template.rs index c76b3b226..52cbcd172 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/th.rs b/src/lang/th.rs index 056d0ca06..57363dacf 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 39dab06cf..c6c7fcc29 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/tw.rs b/src/lang/tw.rs index d58f7e8fe..2390835ca 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 13e6cb1d0..d782bb26d 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 18c81f29b..041d056a0 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -525,8 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("Open in Tabs", ""), - ("Open with New Window", ""), ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); From 772548dbf997c7901cffb1b827dd4a76427bb95f Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 14:34:45 +0800 Subject: [PATCH 17/37] remove unused translation Signed-off-by: dignow --- src/lang/ca.rs | 1 - src/lang/cn.rs | 1 - src/lang/cs.rs | 1 - src/lang/da.rs | 1 - src/lang/de.rs | 1 - src/lang/el.rs | 1 - src/lang/eo.rs | 1 - src/lang/es.rs | 1 - src/lang/fa.rs | 1 - src/lang/fr.rs | 1 - src/lang/hu.rs | 1 - src/lang/id.rs | 1 - src/lang/it.rs | 1 - src/lang/ja.rs | 1 - src/lang/ko.rs | 1 - src/lang/kz.rs | 1 - src/lang/lt.rs | 1 - src/lang/nl.rs | 1 - src/lang/pl.rs | 1 - src/lang/pt_PT.rs | 1 - src/lang/ptbr.rs | 1 - src/lang/ro.rs | 1 - src/lang/ru.rs | 1 - src/lang/sk.rs | 1 - src/lang/sl.rs | 1 - src/lang/sq.rs | 1 - src/lang/sr.rs | 1 - src/lang/sv.rs | 1 - src/lang/template.rs | 1 - src/lang/th.rs | 1 - src/lang/tr.rs | 1 - src/lang/tw.rs | 1 - src/lang/ua.rs | 1 - src/lang/vn.rs | 1 - 34 files changed, 34 deletions(-) diff --git a/src/lang/ca.rs b/src/lang/ca.rs index c88e07198..fb0eeff43 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 644882b64..66c444597 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "同步最近会话"), ("Sort tags", "对标签进行排序"), ("Open new connections in tabs", "在选项卡中打开新连接"), - ("separate window", "独立窗口"), ("Move tab to new window", "将标签页移至新窗口"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 2c0f62a8a..c0c075b14 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 0da788f32..ffb79043a 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index e177ccd14..0eb92ea77 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"), ("Sort tags", "Tags sortieren"), ("Open new connections in tabs", ""), - ("separate window", "Separates Fenster"), ("Move tab to new window", "Tab in neues Fenster verschieben"), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index c98065d55..0164dc335 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 2959f8224..915020fc9 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 40b0f8aa2..c645654c9 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Sincronizar con sesiones recientes"), ("Sort tags", "Ordenar etiquetas"), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index d7ffcba2d..b491a9a07 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index d5d2bf162..655f5aa41 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index b4a51e1ca..f32cdea23 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 0be40ee12..c33616ad5 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index f0091ec0f..152b364ca 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Sincronizza con le sessioni recenti"), ("Sort tags", "Ordina etichette"), ("Open new connections in tabs", ""), - ("separate window", "Separa finestra"), ("Move tab to new window", "Sposta scheda nella finestra successiva"), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 5cb55777a..63a1d5853 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 0e3a3b614..790dc03d7 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 378466334..bbaaccfd9 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index e1ff74feb..1af0f78b8 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 4c6b7cc05..9619bc1b4 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Recente sessies synchroniseren"), ("Sort tags", "Labels sorteren"), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 21deb87a8..114deccb7 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Synchronizacja z ostatnimi sesjami"), ("Sort tags", "Znaczniki sortowania"), ("Open new connections in tabs", ""), - ("separate window", "oddzielne okno"), ("Move tab to new window", "Przenieś zakładkę do nowego okna"), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 40653dc67..83079e2c4 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 4544bbe3a..f9e8bc0cc 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index eca9f0263..e89e499eb 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 13164a4dc..1f8345d18 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", "Синхронизация последних сессий"), ("Sort tags", "Сортировка меток"), ("Open new connections in tabs", ""), - ("separate window", "отдельное окно"), ("Move tab to new window", "Переместить вкладку в отдельное окно"), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index b27b28863..ed89f6188 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 99eb2371b..ac5283d6a 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 251e11a29..cc2851aab 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index d213cd277..d54090949 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 636423607..8422c9818 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 52cbcd172..2cf0d0e39 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 57363dacf..77b8f24eb 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index c6c7fcc29..97daefc8a 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 2390835ca..6b0643fa7 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index d782bb26d..6fa9cf72d 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 041d056a0..6039b75f1 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -525,7 +525,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sync with recent sessions", ""), ("Sort tags", ""), ("Open new connections in tabs", ""), - ("separate window", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } From 8c8b5cbb1c1dbded2abcfa07a5c6b86a6e6aff1b Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 8 Aug 2023 14:45:58 +0800 Subject: [PATCH 18/37] fix words --- flutter/lib/common/widgets/peer_card.dart | 4 ++-- src/lang/ca.rs | 2 +- src/lang/cn.rs | 2 +- src/lang/cs.rs | 2 +- src/lang/da.rs | 2 +- src/lang/de.rs | 2 +- src/lang/el.rs | 2 +- src/lang/eo.rs | 2 +- src/lang/es.rs | 2 +- src/lang/fa.rs | 2 +- src/lang/fr.rs | 2 +- src/lang/hu.rs | 2 +- src/lang/id.rs | 2 +- src/lang/it.rs | 2 +- src/lang/ja.rs | 2 +- src/lang/ko.rs | 2 +- src/lang/kz.rs | 2 +- src/lang/lt.rs | 2 +- src/lang/nl.rs | 2 +- src/lang/pl.rs | 2 +- src/lang/pt_PT.rs | 2 +- src/lang/ptbr.rs | 2 +- src/lang/ro.rs | 2 +- src/lang/ru.rs | 2 +- src/lang/sk.rs | 2 +- src/lang/sl.rs | 2 +- src/lang/sq.rs | 2 +- src/lang/sr.rs | 2 +- src/lang/sv.rs | 2 +- src/lang/template.rs | 2 +- src/lang/th.rs | 2 +- src/lang/tr.rs | 2 +- src/lang/tw.rs | 2 +- src/lang/ua.rs | 2 +- src/lang/vn.rs | 2 +- 35 files changed, 36 insertions(+), 36 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 50beda75c..ee3f8d830 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -540,10 +540,10 @@ abstract class BasePeerCard extends StatelessWidget { } _openInTabsAction(String id) async => - await _openNewConnInAction(id, 'Open in Tabs', kOptionOpenInTabs); + await _openNewConnInAction(id, 'Open in New Tab', kOptionOpenInTabs); _openInWindowsAction(String id) async => - await _openNewConnInAction(id, 'Open with New Window', kOptionOpenInWindows); + await _openNewConnInAction(id, 'Open in New Window', kOptionOpenInWindows); _openNewConnInOptAction(String id) async => mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs) diff --git a/src/lang/ca.rs b/src/lang/ca.rs index fb0eeff43..b3d913b62 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 66c444597..83060c6af 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "管理的设备数已达到最大值"), ("Sync with recent sessions", "同步最近会话"), ("Sort tags", "对标签进行排序"), - ("Open new connections in tabs", "在选项卡中打开新连接"), + ("Open connection in new tab", "在选项卡中打开新连接"), ("Move tab to new window", "将标签页移至新窗口"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index c0c075b14..2d7a7ce16 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index ffb79043a..0a10551d3 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 0eb92ea77..1dc63b20b 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Sie haben die maximale Anzahl der verwalteten Geräte erreicht."), ("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"), ("Sort tags", "Tags sortieren"), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", "Tab in neues Fenster verschieben"), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 0164dc335..33f4d74b8 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 915020fc9..8b29e418e 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index c645654c9..27752e989 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Has alcanzado el máximo número de dispositivos administrados."), ("Sync with recent sessions", "Sincronizar con sesiones recientes"), ("Sort tags", "Ordenar etiquetas"), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index b491a9a07..0b56e073f 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 655f5aa41..8a2baef55 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index f32cdea23..36c43fec9 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index c33616ad5..c65eee87d 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 152b364ca..ee0764514 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Hai raggiunto il numero massimo di dispositivi gestibili."), ("Sync with recent sessions", "Sincronizza con le sessioni recenti"), ("Sort tags", "Ordina etichette"), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", "Sposta scheda nella finestra successiva"), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 63a1d5853..6ece9d5c9 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 790dc03d7..6ea9b94ea 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index bbaaccfd9..e5d035b03 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 1af0f78b8..47b70acfd 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 9619bc1b4..08934cea0 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Het maximum aantal gecontroleerde apparaten is bereikt."), ("Sync with recent sessions", "Recente sessies synchroniseren"), ("Sort tags", "Labels sorteren"), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 114deccb7..84f13c617 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Przekroczona maks. liczba urządzeń"), ("Sync with recent sessions", "Synchronizacja z ostatnimi sesjami"), ("Sort tags", "Znaczniki sortowania"), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", "Przenieś zakładkę do nowego okna"), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 83079e2c4..b9e155364 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index f9e8bc0cc..81fd68ac6 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index e89e499eb..ddd141fa4 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 1f8345d18..f8349b12d 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Достигнуто максимальне количество управляемых устройств."), ("Sync with recent sessions", "Синхронизация последних сессий"), ("Sort tags", "Сортировка меток"), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", "Переместить вкладку в отдельное окно"), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index ed89f6188..afe52f4ad 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index ac5283d6a..dc79f9e44 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index cc2851aab..86f3f3544 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index d54090949..06667f4c5 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 8422c9818..2e8ea8713 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 2cf0d0e39..ed3f41efc 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 77b8f24eb..09ade050f 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 97daefc8a..629a144fd 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 6b0643fa7..a86613651 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 6fa9cf72d..a12e2fd10 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 6039b75f1..0db48584e 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", ""), ("Sync with recent sessions", ""), ("Sort tags", ""), - ("Open new connections in tabs", ""), + ("Open connection in new tab", ""), ("Move tab to new window", ""), ].iter().cloned().collect(); } From c9c1ad5829b288d378b4c88b5ad25ff8f812764f Mon Sep 17 00:00:00 2001 From: solokot Date: Tue, 8 Aug 2023 09:53:53 +0300 Subject: [PATCH 19/37] Update ru.rs --- src/lang/ru.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/ru.rs b/src/lang/ru.rs index f8349b12d..c0f129ab0 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -299,7 +299,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Help", "Помощь"), ("Failed", "Не выполнено"), ("Succeeded", "Выполнено"), - ("Someone turns on privacy mode, exit", "Кто-то включает режим конфиденциальности, выход"), + ("Someone turns on privacy mode, exit", "Кто-то включил режим конфиденциальности, выход"), ("Unsupported", "Не поддерживается"), ("Peer denied", "Отклонено удалённым узлом"), ("Please install plugins", "Установите плагины"), @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Достигнуто максимальне количество управляемых устройств."), ("Sync with recent sessions", "Синхронизация последних сессий"), ("Sort tags", "Сортировка меток"), - ("Open connection in new tab", ""), + ("Open connection in new tab", "Открыть подключение в новой вкладке"), ("Move tab to new window", "Переместить вкладку в отдельное окно"), ].iter().cloned().collect(); } From db2ec7df8fba8e196c87aa60c9b77721153bf59c Mon Sep 17 00:00:00 2001 From: bovirus <1262554+bovirus@users.noreply.github.com> Date: Tue, 8 Aug 2023 10:24:46 +0200 Subject: [PATCH 20/37] Update italian language --- src/lang/it.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/it.rs b/src/lang/it.rs index ee0764514..5a655ce5a 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Hai raggiunto il numero massimo di dispositivi gestibili."), ("Sync with recent sessions", "Sincronizza con le sessioni recenti"), ("Sort tags", "Ordina etichette"), - ("Open connection in new tab", ""), + ("Open connection in new tab", "Apri connessione in una nuova scheda"), ("Move tab to new window", "Sposta scheda nella finestra successiva"), ].iter().cloned().collect(); } From bebe2b5282bd725a3dd0d796eb4a6d31f524452a Mon Sep 17 00:00:00 2001 From: Mr-Update <37781396+Mr-Update@users.noreply.github.com> Date: Tue, 8 Aug 2023 10:31:09 +0200 Subject: [PATCH 21/37] Update de.rs --- src/lang/de.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/de.rs b/src/lang/de.rs index 1dc63b20b..ffb62a45f 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -506,7 +506,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Enable", "Aktivieren"), ("Disable", "Deaktivieren"), ("Options", "Einstellungen"), - ("resolution_original_tip", "Originalauflösung"), + ("resolution_original_tip", "Originale Auflösung"), ("resolution_fit_local_tip", "Lokale Auflösung anpassen"), ("resolution_custom_tip", "Benutzerdefinierte Auflösung"), ("Collapse toolbar", "Symbolleiste einklappen"), @@ -524,7 +524,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("exceed_max_devices", "Sie haben die maximale Anzahl der verwalteten Geräte erreicht."), ("Sync with recent sessions", "Synchronisierung mit den letzten Sitzungen"), ("Sort tags", "Tags sortieren"), - ("Open connection in new tab", ""), + ("Open connection in new tab", "Verbindung in neuem Tab öffnen"), ("Move tab to new window", "Tab in neues Fenster verschieben"), ].iter().cloned().collect(); } From 32fe330946e0db45252cb6dd3147b1eb551564ea Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 18:14:01 +0800 Subject: [PATCH 22/37] restore window pos Signed-off-by: dignow --- flutter/lib/common.dart | 9 +++++++-- flutter/lib/utils/multi_window_manager.dart | 2 ++ src/flutter_ffi.rs | 4 ++++ src/ui_interface.rs | 7 +++++++ src/ui_session_interface.rs | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 17206b8ce..7096c1589 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1542,8 +1542,13 @@ Future restoreWindowPosition(WindowType type, bool isRemotePeerPos = false; String? pos; if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) { - pos = await bind.sessionGetFlutterConfigByPeerId( - id: peerId, k: kWindowPrefix); + if (desktopType == DesktopType.main) { + pos = bind.mainGetPeerFlutterConfigSync( + id: peerId, k: kWindowPrefix + type.name); + } else { + pos = await bind.sessionGetFlutterConfigByPeerId( + id: peerId, k: kWindowPrefix); + } isRemotePeerPos = pos != null; } pos ??= bind.getLocalFlutterConfig(k: kWindowPrefix + type.name); diff --git a/flutter/lib/utils/multi_window_manager.dart b/flutter/lib/utils/multi_window_manager.dart index e87551d6b..187b03161 100644 --- a/flutter/lib/utils/multi_window_manager.dart +++ b/flutter/lib/utils/multi_window_manager.dart @@ -99,6 +99,8 @@ class RustDeskMultiWindowManager { for (final windowId in windows) { if (_inactiveWindows.contains(windowId)) { await DesktopMultiWindow.invokeMethod(windowId, methodName, msg); + await restoreWindowPosition(type, + windowId: windowId, peerId: remoteId); WindowController.fromWindowId(windowId).show(); registerActiveWindow(windowId); return; diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 1287abf34..d0106ae54 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -806,6 +806,10 @@ pub fn main_get_peer_option_sync(id: String, key: String) -> SyncReturn SyncReturn(get_peer_option(id, key)) } +pub fn main_get_peer_flutter_config_sync(id: String, k: String) -> SyncReturn { + SyncReturn(get_peer_flutter_config(id, k)) +} + pub fn main_set_peer_option(id: String, key: String, value: String) { set_peer_option(id, key, value) } diff --git a/src/ui_interface.rs b/src/ui_interface.rs index 2979f4ceb..246e3aaff 100644 --- a/src/ui_interface.rs +++ b/src/ui_interface.rs @@ -201,6 +201,13 @@ pub fn get_peer_option(id: String, name: String) -> String { c.options.get(&name).unwrap_or(&"".to_owned()).to_owned() } +#[inline] +#[cfg(feature = "flutter")] +pub fn get_peer_flutter_config(id: String, name: String) -> String { + let c = PeerConfig::load(&id); + c.ui_flutter.get(&name).unwrap_or(&"".to_owned()).to_owned() +} + #[inline] pub fn set_peer_option(id: String, name: String, value: String) { let mut c = PeerConfig::load(&id); diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 10e8978c9..7ffcaac6d 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -202,7 +202,7 @@ impl Session { } pub fn get_flutter_config(&self, k: String) -> String { - self.lc.write().unwrap().get_ui_flutter(&k) + self.lc.read().unwrap().get_ui_flutter(&k) } pub fn toggle_option(&mut self, name: String) { From a926cc0dce4c343f4aa61d4574136dd09ccd37c5 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 8 Aug 2023 18:41:38 +0800 Subject: [PATCH 23/37] opt auth svg --- flutter/assets/auth-apple.svg | 2 +- flutter/assets/auth-auth0.svg | 2 +- flutter/assets/auth-azure.svg | 2 +- flutter/assets/auth-default.svg | 15 +-------------- flutter/assets/auth-facebook.svg | 2 +- flutter/assets/auth-github.svg | 2 +- flutter/assets/auth-google.svg | 2 +- 7 files changed, 7 insertions(+), 20 deletions(-) diff --git a/flutter/assets/auth-apple.svg b/flutter/assets/auth-apple.svg index a3c2e871d..6933fbc3b 100644 --- a/flutter/assets/auth-apple.svg +++ b/flutter/assets/auth-apple.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/flutter/assets/auth-auth0.svg b/flutter/assets/auth-auth0.svg index e8c7557e7..dbe3ed236 100644 --- a/flutter/assets/auth-auth0.svg +++ b/flutter/assets/auth-auth0.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/flutter/assets/auth-azure.svg b/flutter/assets/auth-azure.svg index 0482b22e6..b7435604d 100644 --- a/flutter/assets/auth-azure.svg +++ b/flutter/assets/auth-azure.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/flutter/assets/auth-default.svg b/flutter/assets/auth-default.svg index 905c9ca9b..bf5fa9073 100644 --- a/flutter/assets/auth-default.svg +++ b/flutter/assets/auth-default.svg @@ -1,14 +1 @@ - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/flutter/assets/auth-facebook.svg b/flutter/assets/auth-facebook.svg index d921a6716..f58725000 100644 --- a/flutter/assets/auth-facebook.svg +++ b/flutter/assets/auth-facebook.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/flutter/assets/auth-github.svg b/flutter/assets/auth-github.svg index 1ba71c98b..778b7b341 100644 --- a/flutter/assets/auth-github.svg +++ b/flutter/assets/auth-github.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/flutter/assets/auth-google.svg b/flutter/assets/auth-google.svg index f9ab170e6..18970f31a 100644 --- a/flutter/assets/auth-google.svg +++ b/flutter/assets/auth-google.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 7defb54f15fae012b898f246b5b3a5abe8f9316b Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 19:58:30 +0800 Subject: [PATCH 24/37] save window pos Signed-off-by: dignow --- flutter/lib/common.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 7096c1589..f5ebca3b7 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1424,17 +1424,18 @@ Future saveWindowPosition(WindowType type, {int? windowId}) async { k: kWindowPrefix + type.name, v: pos.toString()); if (type == WindowType.RemoteDesktop && windowId != null) { - await _saveSessionWindowPosition(windowId, pos); + await _saveSessionWindowPosition(type, windowId, pos); } } -Future _saveSessionWindowPosition(int windowId, LastWindowPosition pos) async { +Future _saveSessionWindowPosition( + WindowType windowType, int windowId, LastWindowPosition pos) async { final remoteList = await DesktopMultiWindow.invokeMethod( windowId, kWindowEventGetRemoteList, null); if (remoteList != null) { for (final peerId in remoteList.split(',')) { bind.sessionSetFlutterConfigByPeerId( - id: peerId, k: kWindowPrefix, v: pos.toString()); + id: peerId, k: kWindowPrefix + windowType.name, v: pos.toString()); } } } @@ -1547,7 +1548,7 @@ Future restoreWindowPosition(WindowType type, id: peerId, k: kWindowPrefix + type.name); } else { pos = await bind.sessionGetFlutterConfigByPeerId( - id: peerId, k: kWindowPrefix); + id: peerId, k: kWindowPrefix + type.name); } isRemotePeerPos = pos != null; } From 21cf2a01c74b00a0cad79831113c79706a8f6ede Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 8 Aug 2023 17:22:25 +0800 Subject: [PATCH 25/37] update idController when create new connection Signed-off-by: 21pages --- flutter/lib/common.dart | 9 +++++++++ flutter/lib/common/formatter/id_formatter.dart | 7 ++++++- flutter/lib/desktop/pages/connection_page.dart | 1 + flutter/lib/mobile/pages/connection_page.dart | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 17206b8ce..231a91800 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -11,6 +11,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_hbb/common/formatter/id_formatter.dart'; import 'package:flutter_hbb/desktop/widgets/refresh_wrapper.dart'; import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart'; import 'package:flutter_hbb/main.dart'; @@ -1833,6 +1834,14 @@ connect( bool isRDP = false, }) async { if (id == '') return; + if (!isDesktop || desktopType == DesktopType.main) { + try { + if (Get.isRegistered()) { + final idController = Get.find(); + idController.text = formatID(id); + } + } catch (_) {} + } id = id.replaceAll(' ', ''); final oldId = id; id = await bind.mainHandleRelayId(id: id); diff --git a/flutter/lib/common/formatter/id_formatter.dart b/flutter/lib/common/formatter/id_formatter.dart index bd7f76666..c2329d53f 100644 --- a/flutter/lib/common/formatter/id_formatter.dart +++ b/flutter/lib/common/formatter/id_formatter.dart @@ -35,6 +35,11 @@ class IDTextInputFormatter extends TextInputFormatter { String formatID(String id) { String id2 = id.replaceAll(' ', ''); + String suffix = ''; + if (id2.endsWith(r'\r') || id2.endsWith(r'/r')) { + suffix = id2.substring(id2.length - 2, id2.length); + id2 = id2.substring(0, id2.length - 2); + } if (int.tryParse(id2) == null) return id; String newID = ''; if (id2.length <= 3) { @@ -47,7 +52,7 @@ String formatID(String id) { newID += " ${id2.substring(i, i + 3)}"; } } - return newID; + return newID + suffix; } String trimID(String id) { diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 45181c4a3..e24b9c954 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -68,6 +68,7 @@ class _ConnectionPageState extends State _idController.selection = TextSelection( baseOffset: 0, extentOffset: _idController.value.text.length); }); + Get.put(_idController); windowManager.addListener(this); } diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 48c56e6a5..25812e8c2 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -66,6 +66,7 @@ class _ConnectionPageState extends State { _idController.addListener(() { _idEmpty.value = _idController.text.isEmpty; }); + Get.put(_idController); } @override From 312c6324d204b6e144dd9c3f072d1cfa11fd995d Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 8 Aug 2023 18:06:31 +0800 Subject: [PATCH 26/37] opt delete dialog title Signed-off-by: 21pages --- flutter/lib/common/widgets/dialog.dart | 8 +++++--- flutter/lib/common/widgets/peer_card.dart | 7 ++++--- flutter/lib/common/widgets/peer_tab_page.dart | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index 05a105e68..77307418a 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -1352,7 +1352,7 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async { msgBoxCommon(ffi.dialogManager, 'Custom Image Quality', content, [btnClose]); } -void deletePeerConfirmDialog(Function onSubmit) async { +void deletePeerConfirmDialog(Function onSubmit, String title) async { gFFI.dialogManager.show( (setState, close, context) { submit() async { @@ -1368,8 +1368,10 @@ void deletePeerConfirmDialog(Function onSubmit) async { Icons.delete_rounded, color: Colors.red, ), - Text(translate('Delete')).paddingOnly( - left: 10, + Expanded( + child: Text(title, overflow: TextOverflow.ellipsis).paddingOnly( + left: 10, + ), ), ], ), diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index ee3f8d830..a88bb4930 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -542,8 +542,8 @@ abstract class BasePeerCard extends StatelessWidget { _openInTabsAction(String id) async => await _openNewConnInAction(id, 'Open in New Tab', kOptionOpenInTabs); - _openInWindowsAction(String id) async => - await _openNewConnInAction(id, 'Open in New Window', kOptionOpenInWindows); + _openInWindowsAction(String id) async => await _openNewConnInAction( + id, 'Open in New Window', kOptionOpenInWindows); _openNewConnInOptAction(String id) async => mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs) @@ -636,7 +636,8 @@ abstract class BasePeerCard extends StatelessWidget { } } - deletePeerConfirmDialog(onSubmit); + deletePeerConfirmDialog(onSubmit, + '${translate('Delete')} "${peer.alias.isEmpty ? formatID(peer.id) : peer.alias}"?'); }, padding: menuPadding, dismissOnClicked: true, diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index f2de21dc7..e8cbd2619 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -312,7 +312,7 @@ class _PeerTabPageState extends State showToast(translate('Successful')); } - deletePeerConfirmDialog(onSubmit); + deletePeerConfirmDialog(onSubmit, translate('Delete')); }, child: Tooltip( message: translate('Delete'), From 6a500f2ede213dcdafd655af9e4b4361cfc7e6f8 Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 21:25:44 +0800 Subject: [PATCH 27/37] oidc does not use api server cache & fix logout after changing server Signed-off-by: dignow --- .../desktop/pages/desktop_setting_page.dart | 11 +++-- src/hbbs_http/account.rs | 41 ++++++++++++------- src/ui_interface.rs | 2 +- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 33b0a2e43..422cc8fdc 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -995,16 +995,19 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin { return false; } } - final old = await bind.mainGetOption(key: 'custom-rendezvous-server'); - if (old.isNotEmpty && old != idServer) { - await gFFI.userModel.logOut(); - } + final oldApiServer = await bind.mainGetApiServer(); + // should set one by one await bind.mainSetOption( key: 'custom-rendezvous-server', value: idServer); await bind.mainSetOption(key: 'relay-server', value: relayServer); await bind.mainSetOption(key: 'api-server', value: apiServer); await bind.mainSetOption(key: 'key', value: key); + + final newApiServer = await bind.mainGetApiServer(); + if (oldApiServer.isNotEmpty && oldApiServer != newApiServer) { + await gFFI.userModel.logOut(); + } return true; } diff --git a/src/hbbs_http/account.rs b/src/hbbs_http/account.rs index bc078440a..2afd4b83e 100644 --- a/src/hbbs_http/account.rs +++ b/src/hbbs_http/account.rs @@ -1,8 +1,5 @@ use super::HbbHttpResponse; -use hbb_common::{ - config::{Config, LocalConfig}, - log, ResultType, -}; +use hbb_common::{config::LocalConfig, log, ResultType}; use reqwest::blocking::Client; use serde_derive::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; @@ -14,8 +11,6 @@ use std::{ use url::Url; lazy_static::lazy_static! { - static ref API_SERVER: String = crate::get_api_server( - Config::get_option("api-server"), Config::get_option("custom-rendezvous-server")); static ref OIDC_SESSION: Arc> = Arc::new(RwLock::new(OidcSession::new())); } @@ -142,20 +137,30 @@ impl OidcSession { } } - fn auth(op: &str, id: &str, uuid: &str) -> ResultType> { + fn auth( + api_server: &str, + op: &str, + id: &str, + uuid: &str, + ) -> ResultType> { Ok(OIDC_SESSION .read() .unwrap() .client - .post(format!("{}/api/oidc/auth", *API_SERVER)) + .post(format!("{}/api/oidc/auth", api_server)) .json(&HashMap::from([("op", op), ("id", id), ("uuid", uuid)])) .send()? .try_into()?) } - fn query(code: &str, id: &str, uuid: &str) -> ResultType> { + fn query( + api_server: &str, + code: &str, + id: &str, + uuid: &str, + ) -> ResultType> { let url = reqwest::Url::parse_with_params( - &format!("{}/api/oidc/auth-query", *API_SERVER), + &format!("{}/api/oidc/auth-query", api_server), &[("code", code), ("id", id), ("uuid", uuid)], )?; Ok(OIDC_SESSION @@ -189,8 +194,8 @@ impl OidcSession { std::thread::sleep(std::time::Duration::from_secs_f32(secs)); } - fn auth_task(op: String, id: String, uuid: String, remember_me: bool) { - let auth_request_res = Self::auth(&op, &id, &uuid); + fn auth_task(api_server: String, op: String, id: String, uuid: String, remember_me: bool) { + let auth_request_res = Self::auth(&api_server, &op, &id, &uuid); log::info!("Request oidc auth result: {:?}", &auth_request_res); let code_url = match auth_request_res { Ok(HbbHttpResponse::<_>::Data(code_url)) => code_url, @@ -226,7 +231,7 @@ impl OidcSession { let begin = Instant::now(); let query_timeout = OIDC_SESSION.read().unwrap().query_timeout; while OIDC_SESSION.read().unwrap().keep_querying && begin.elapsed() < query_timeout { - match Self::query(&code_url.code, &id, &uuid) { + match Self::query(&api_server, &code_url.code, &id, &uuid) { Ok(HbbHttpResponse::<_>::Data(auth_body)) => { if remember_me { LocalConfig::set_option( @@ -289,12 +294,18 @@ impl OidcSession { } } - pub fn account_auth(op: String, id: String, uuid: String, remember_me: bool) { + pub fn account_auth( + api_server: String, + op: String, + id: String, + uuid: String, + remember_me: bool, + ) { Self::auth_cancel(); Self::wait_stop_querying(); OIDC_SESSION.write().unwrap().before_task(); std::thread::spawn(move || { - Self::auth_task(op, id, uuid, remember_me); + Self::auth_task(api_server, op, id, uuid, remember_me); OIDC_SESSION.write().unwrap().after_task(); }); } diff --git a/src/ui_interface.rs b/src/ui_interface.rs index 2979f4ceb..39a6b264d 100644 --- a/src/ui_interface.rs +++ b/src/ui_interface.rs @@ -912,7 +912,7 @@ fn check_connect_status(reconnect: bool) -> mpsc::UnboundedSender { #[cfg(feature = "flutter")] pub fn account_auth(op: String, id: String, uuid: String, remember_me: bool) { - account::OidcSession::account_auth(op, id, uuid, remember_me); + account::OidcSession::account_auth(get_api_server(), op, id, uuid, remember_me); } #[cfg(feature = "flutter")] From dcad52cf52053c754f33fabe1c758dab6c188a37 Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 21:34:46 +0800 Subject: [PATCH 28/37] add comments Signed-off-by: dignow --- flutter/lib/common.dart | 3 +++ src/flutter_ffi.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index f5ebca3b7..d3d94baa2 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1543,6 +1543,9 @@ Future restoreWindowPosition(WindowType type, bool isRemotePeerPos = false; String? pos; if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) { + // If the restore position is called by main window, and the peer id is not null + // then we may need to get the position by reading the peer config. + // Because the session may not be read at this time. if (desktopType == DesktopType.main) { pos = bind.mainGetPeerFlutterConfigSync( id: peerId, k: kWindowPrefix + type.name); diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index d0106ae54..4a12ee19f 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -806,6 +806,8 @@ pub fn main_get_peer_option_sync(id: String, key: String) -> SyncReturn SyncReturn(get_peer_option(id, key)) } +// Sometimes we need to get the flutter config of a peer by reading the file. +// Because the session may not be established yet. pub fn main_get_peer_flutter_config_sync(id: String, k: String) -> SyncReturn { SyncReturn(get_peer_flutter_config(id, k)) } From 7692dcd629e1c1598adeac5e100c57f8eee022b3 Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 8 Aug 2023 21:37:34 +0800 Subject: [PATCH 29/37] fix logout Signed-off-by: dignow --- flutter/lib/desktop/pages/desktop_setting_page.dart | 2 +- flutter/lib/models/user_model.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 422cc8fdc..591efd4c7 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -1006,7 +1006,7 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin { final newApiServer = await bind.mainGetApiServer(); if (oldApiServer.isNotEmpty && oldApiServer != newApiServer) { - await gFFI.userModel.logOut(); + await gFFI.userModel.logOut(apiServer: oldApiServer); } return true; } diff --git a/flutter/lib/models/user_model.dart b/flutter/lib/models/user_model.dart index ebed47587..003577ba0 100644 --- a/flutter/lib/models/user_model.dart +++ b/flutter/lib/models/user_model.dart @@ -101,10 +101,10 @@ class UserModel { await Future.wait([gFFI.abModel.pullAb(), gFFI.groupModel.pull()]); } - Future logOut() async { + Future logOut({String? apiServer}) async { final tag = gFFI.dialogManager.showLoading(translate('Waiting')); try { - final url = await bind.mainGetApiServer(); + final url = apiServer ?? await bind.mainGetApiServer(); final authHeaders = getHttpHeaders(); authHeaders['Content-Type'] = "application/json"; await http From e830a59c2a449316e610263f906a3a9b567f2148 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 9 Aug 2023 07:42:22 +0800 Subject: [PATCH 30/37] skip PeerConfig saving when not receiving peerinfo to keep peercard order Signed-off-by: 21pages --- src/client.rs | 4 ++++ src/client/io_loop.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/client.rs b/src/client.rs index dfd73455c..9c039464c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1209,6 +1209,10 @@ impl LoginConfigHandler { /// * `k` - key of option /// * `v` - value of option pub fn save_ui_flutter(&mut self, k: String, v: String) { + if self.version == 0 && k == "wm_" { + log::info!("skip saving {k}"); + return; + } let mut config = self.load_config(); config.ui_flutter.insert(k, v); self.save_config(config); diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index c24d0f54c..f8cdb3ea0 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -850,6 +850,11 @@ impl Remote { } pub async fn sync_jobs_status_to_local(&mut self) -> bool { + let peer_version = self.handler.lc.read().unwrap().version; + if peer_version == 0 { + log::info!("skip saving job status"); + return false; + } log::info!("sync transfer job status"); let mut config: PeerConfig = self.handler.load_config(); let mut transfer_metas = TransferSerde::default(); From 3ecf0cc68551cbf8347124bbb2ed8ef0326c2feb Mon Sep 17 00:00:00 2001 From: dignow Date: Wed, 9 Aug 2023 12:29:53 +0800 Subject: [PATCH 31/37] fix session render texture instance Signed-off-by: dignow --- flutter/lib/desktop/pages/remote_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 35d20a263..b39b1a927 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -117,9 +117,9 @@ class _RemotePageState extends State } // Register texture. if (mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)) { - _renderTexture = renderTexture; - } else { _renderTexture = RenderTexture(); + } else { + _renderTexture = renderTexture; } _renderTexture.create(sessionId); From 9a7a6004070587178bb8e268268f08917c14588a Mon Sep 17 00:00:00 2001 From: dignow Date: Wed, 9 Aug 2023 12:46:12 +0800 Subject: [PATCH 32/37] remove global render texture instance Signed-off-by: dignow --- flutter/lib/desktop/pages/remote_page.dart | 6 +----- flutter/lib/desktop/widgets/tabbar_widget.dart | 2 -- flutter/lib/models/desktop_render_texture.dart | 5 ----- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index b39b1a927..28212e4ca 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -116,11 +116,7 @@ class _RemotePageState extends State Wakelock.enable(); } // Register texture. - if (mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs)) { - _renderTexture = RenderTexture(); - } else { - _renderTexture = renderTexture; - } + _renderTexture = RenderTexture(); _renderTexture.create(sessionId); _ffi.ffiModel.updateEventListener(sessionId, widget.id); diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart index 2a7d1452e..2645ea0f2 100644 --- a/flutter/lib/desktop/widgets/tabbar_widget.dart +++ b/flutter/lib/desktop/widgets/tabbar_widget.dart @@ -582,8 +582,6 @@ class WindowActionPanelState extends State } await windowManager.hide(); } else { - renderTexture.destroy(); - // it's safe to hide the subwindow final controller = WindowController.fromWindowId(kWindowId!); if (Platform.isMacOS && await controller.isFullScreen()) { diff --git a/flutter/lib/models/desktop_render_texture.dart b/flutter/lib/models/desktop_render_texture.dart index 37d387eb2..f59373623 100644 --- a/flutter/lib/models/desktop_render_texture.dart +++ b/flutter/lib/models/desktop_render_texture.dart @@ -38,9 +38,4 @@ class RenderTexture { _textureKey = -1; } } - - static final RenderTexture instance = RenderTexture(); } - -// Global instance for separate texture -final renderTexture = RenderTexture.instance; From fbde794d39a153430e53c975f6859d2ca4d77ba2 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 9 Aug 2023 13:54:09 +0800 Subject: [PATCH 33/37] add missing Get.delete, android can update id controller Signed-off-by: 21pages --- flutter/lib/desktop/pages/connection_page.dart | 3 +++ flutter/lib/mobile/pages/connection_page.dart | 3 +++ 2 files changed, 6 insertions(+) diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index e24b9c954..de87317b3 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -77,6 +77,9 @@ class _ConnectionPageState extends State _idController.dispose(); _updateTimer?.cancel(); windowManager.removeListener(this); + if (Get.isRegistered()) { + Get.delete(); + } super.dispose(); } diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 25812e8c2..c99462166 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -196,6 +196,9 @@ class _ConnectionPageState extends State { @override void dispose() { _idController.dispose(); + if (Get.isRegistered()) { + Get.delete(); + } super.dispose(); } } From 52bffd4030f74e0869b01f04476f4cf0483ee989 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 9 Aug 2023 14:59:52 +0800 Subject: [PATCH 34/37] fix waiting for image, should not await dialogManager.show Signed-off-by: 21pages --- flutter/lib/models/model.dart | 27 +++++++++++++-------------- src/flutter.rs | 8 ++++++++ src/flutter_ffi.rs | 6 ++++++ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 9fa73e1b7..e54bc0d07 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -425,19 +425,18 @@ class FfiModel with ChangeNotifier { closeConnection(); } - Future.delayed(Duration.zero, () async { - await dialogManager.show( - (setState, close, context) => CustomAlertDialog( - title: null, - content: SelectionArea(child: msgboxContent(type, title, text)), - actions: [ - dialogButton("Cancel", onPressed: onClose, isOutline: true) - ], - onCancel: onClose), - tag: '$sessionId-waiting-for-image', - ); - _waitForImageDialogShow[sessionId] = true; - }); + dialogManager.show( + (setState, close, context) => CustomAlertDialog( + title: null, + content: SelectionArea(child: msgboxContent(type, title, text)), + actions: [ + dialogButton("Cancel", onPressed: onClose, isOutline: true) + ], + onCancel: onClose), + tag: '$sessionId-waiting-for-image', + ); + _waitForImageDialogShow[sessionId] = true; + bind.sessionOnWaitingForImageDialogShow(sessionId: sessionId); } _updateSessionWidthHeight(SessionID sessionId) { @@ -1902,7 +1901,7 @@ Future initializeCursorAndCanvas(FFI ffi) async { } clearWaitingForImage(OverlayDialogManager? dialogManager, SessionID sessionId) { - final durations = [100, 500, 1000, 2000]; + final durations = [0, 100, 500, 1000, 2000]; for (var duration in durations) { Future.delayed(Duration(milliseconds: duration), () { dialogManager?.dismissByTag('$sessionId-waiting-for-image'); diff --git a/src/flutter.rs b/src/flutter.rs index 88290897d..52190ce2e 100644 --- a/src/flutter.rs +++ b/src/flutter.rs @@ -345,6 +345,14 @@ impl FlutterHandler { *self.notify_rendered.write().unwrap() = false; self.renderer.write().unwrap().set_size(width, height); } + + pub fn on_waiting_for_image_dialog_show(&self) { + #[cfg(any(feature = "flutter_texture_render"))] + { + *self.notify_rendered.write().unwrap() = false; + } + // rgba array render will notify every frame + } } impl InvokeUiSession for FlutterHandler { diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 4a12ee19f..122af0c2b 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -1266,6 +1266,12 @@ pub fn session_change_prefer_codec(session_id: SessionID) { } } +pub fn session_on_waiting_for_image_dialog_show(session_id: SessionID) { + if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + session.ui_handler.on_waiting_for_image_dialog_show(); + } +} + pub fn main_set_home_dir(_home: String) { #[cfg(any(target_os = "android", target_os = "ios"))] { From de85c9448aa3659fa0724af123ef4eea8de39d60 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 9 Aug 2023 15:32:51 +0800 Subject: [PATCH 35/37] remove extra dismiss waiting for image Signed-off-by: 21pages --- flutter/lib/models/model.dart | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index e54bc0d07..9c4ff281c 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -1901,10 +1901,5 @@ Future initializeCursorAndCanvas(FFI ffi) async { } clearWaitingForImage(OverlayDialogManager? dialogManager, SessionID sessionId) { - final durations = [0, 100, 500, 1000, 2000]; - for (var duration in durations) { - Future.delayed(Duration(milliseconds: duration), () { - dialogManager?.dismissByTag('$sessionId-waiting-for-image'); - }); - } + dialogManager?.dismissByTag('$sessionId-waiting-for-image'); } From 0d16f54c2f2e7b7af9a69cbc969b83872aa4c9a5 Mon Sep 17 00:00:00 2001 From: dignow Date: Wed, 9 Aug 2023 17:17:18 +0800 Subject: [PATCH 36/37] fix move tab to new window Signed-off-by: dignow --- flutter/lib/utils/multi_window_manager.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/utils/multi_window_manager.dart b/flutter/lib/utils/multi_window_manager.dart index 187b03161..4bd8a46e9 100644 --- a/flutter/lib/utils/multi_window_manager.dart +++ b/flutter/lib/utils/multi_window_manager.dart @@ -50,7 +50,7 @@ class RustDeskMultiWindowManager { 'session_id': sessionId, }; await _newSession( - true, + false, WindowType.RemoteDesktop, kWindowEventNewRemoteDesktop, peerId, From 28cbe0f4641e53789ad8ef4935ddea0c3285c147 Mon Sep 17 00:00:00 2001 From: dignow Date: Wed, 9 Aug 2023 18:37:09 +0800 Subject: [PATCH 37/37] fix, set window position before show when reusing window Signed-off-by: dignow --- flutter/lib/common.dart | 2 ++ flutter/lib/utils/multi_window_manager.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 570b134c5..e518a56e0 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1543,6 +1543,8 @@ Future restoreWindowPosition(WindowType type, bool isRemotePeerPos = false; String? pos; + // No need to check mainGetLocalBoolOptionSync(kOptionOpenNewConnInTabs) + // Though "open in tabs" is true and the new window restore peer position, it's ok. if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) { // If the restore position is called by main window, and the peer id is not null // then we may need to get the position by reading the peer config. diff --git a/flutter/lib/utils/multi_window_manager.dart b/flutter/lib/utils/multi_window_manager.dart index 4bd8a46e9..3f7d995b7 100644 --- a/flutter/lib/utils/multi_window_manager.dart +++ b/flutter/lib/utils/multi_window_manager.dart @@ -98,9 +98,9 @@ class RustDeskMultiWindowManager { if (_inactiveWindows.isNotEmpty) { for (final windowId in windows) { if (_inactiveWindows.contains(windowId)) { - await DesktopMultiWindow.invokeMethod(windowId, methodName, msg); await restoreWindowPosition(type, windowId: windowId, peerId: remoteId); + await DesktopMultiWindow.invokeMethod(windowId, methodName, msg); WindowController.fromWindowId(windowId).show(); registerActiveWindow(windowId); return;