From 7ddc706f2d39d5cd0fea17d9b84682e00c021550 Mon Sep 17 00:00:00 2001 From: dignow Date: Sun, 6 Aug 2023 11:21:07 +0800 Subject: [PATCH] refact, change 'Split' to 'Move tab to new window' Signed-off-by: dignow --- flutter/lib/common/widgets/peer_card.dart | 1 - flutter/lib/consts.dart | 2 +- flutter/lib/desktop/pages/desktop_home_page.dart | 4 ++-- flutter/lib/desktop/pages/remote_tab_page.dart | 4 ++-- flutter/lib/utils/multi_window_manager.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 +- 39 files changed, 40 insertions(+), 41 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 4e03edfbd..61c5cb69e 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -2,7 +2,6 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_hbb/common/widgets/address_book.dart'; import 'package:flutter_hbb/common/widgets/dialog.dart'; import 'package:flutter_hbb/consts.dart'; import 'package:flutter_hbb/models/peer_tab_model.dart'; diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 65e8611c3..92ad7451a 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -39,7 +39,7 @@ const String kWindowEventActiveSession = "active_session"; const String kWindowEventGetRemoteList = "get_remote_list"; const String kWindowEventGetSessionIdList = "get_session_id_list"; -const String kWindowEventSplit = "split"; +const String kWindowEventMoveTabToNewWindow = "move_tab_to_new_window"; const String kWindowEventCloseForSeparateWindow = "close_for_separate_window"; const String kOptionSeparateRemoteWindow = "enable-separate-remote-window"; diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index 34916481c..b87820b97 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -570,7 +570,7 @@ class _DesktopHomePageState extends State forceRelay: call.arguments['forceRelay'], forceSeparateWindow: call.arguments['forceSeparateWindow'], ); - } else if (call.method == kWindowEventSplit) { + } else if (call.method == kWindowEventMoveTabToNewWindow) { final args = call.arguments.split(','); int? windowId; try { @@ -579,7 +579,7 @@ class _DesktopHomePageState extends State debugPrint("Failed to parse window id '${call.arguments}': $e"); } if (windowId != null) { - await rustDeskWinManager.splitWindow(windowId, args[1], args[2]); + await rustDeskWinManager.moveTabToNewWindow(windowId, args[1], args[2]); } } }); diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index e4bbeba92..712ded223 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -332,12 +332,12 @@ class _ConnectionTabPageState extends State { if (tabController.state.value.tabs.length > 1) { final splitAction = MenuEntryButton( childBuilder: (TextStyle? style) => Text( - translate('Split'), + translate('Move tab to new window'), style: style, ), proc: () async { await DesktopMultiWindow.invokeMethod( - kMainWindowId, kWindowEventSplit, '${windowId()},$key,$sessionId'); + kMainWindowId, kWindowEventMoveTabToNewWindow, '${windowId()},$key,$sessionId'); cancelFunc(); }, padding: padding, diff --git a/flutter/lib/utils/multi_window_manager.dart b/flutter/lib/utils/multi_window_manager.dart index fb576e426..3287c52ed 100644 --- a/flutter/lib/utils/multi_window_manager.dart +++ b/flutter/lib/utils/multi_window_manager.dart @@ -43,7 +43,7 @@ class RustDeskMultiWindowManager { final List _fileTransferWindows = List.empty(growable: true); final List _portForwardWindows = List.empty(growable: true); - splitWindow(int windowId, String peerId, String sessionId) async { + moveTabToNewWindow(int windowId, String peerId, String sessionId) async { var params = { 'type': WindowType.RemoteDesktop.index, 'id': peerId, diff --git a/src/lang/ca.rs b/src/lang/ca.rs index d285805f5..4fa999491 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 3e93a7869..8569088ba 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "对标签进行排序"), ("Separate remote window", "使用独立远程窗口"), ("separate window", "独立窗口"), - ("Split", "拆分"), + ("Move tab to new window", "将标签页移至新窗口"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 8bc165f40..28c105aad 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index c44973bbf..1935d8a6f 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 24a59d4fc..6b4798e95 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Tags sortieren"), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index ccfd1c8ec..4e0994268 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 9cc79a98a..d81bce08c 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 2d33c5756..aa7310e41 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Ordenar etiquetas"), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index f57687e53..d7af98c07 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index bab0ef06b..63539061a 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 02b0ed900..893537880 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 608b00cd1..e0967a287 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index d1c71c385..3a5dab832 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Ordina etichette"), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index e5328f332..767e4faa6 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 05f003f63..32d57f4fc 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 634654dc6..33ca22920 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index bdc8c9e24..2f3233bb7 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index d4868b401..fab4af88a 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Labels sorteren"), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 8aa9525ab..2f61ebb16 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 196f1e5c3..8dbbe9bee 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 53c91b3c6..326b64c5c 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index f3cc62202..9051e8c42 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index c44335f69..e18abb4c4 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", "Сортировка меток"), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 0c7e5f2d8..6ac2ed4ab 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index ff0c0114d..631b8a6ea 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 261d5fa5a..102800cca 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 9ce8e4c3f..22c2f7da3 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 72b3f3243..dcf3620d8 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 82fcec792..e19c4a022 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index b17f432d0..7325c0f90 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index c2467ce5d..086a713c9 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index c705665ae..ad66ee6bd 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 879dd9d94..852a276a0 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 52fef05d4..f8b08ca79 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -526,6 +526,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Sort tags", ""), ("Separate remote window", ""), ("separate window", ""), - ("Split", ""), + ("Move tab to new window", ""), ].iter().cloned().collect(); }