diff --git a/flutter/lib/desktop/pages/file_manager_page.dart b/flutter/lib/desktop/pages/file_manager_page.dart index 03a6fd788..021f03713 100644 --- a/flutter/lib/desktop/pages/file_manager_page.dart +++ b/flutter/lib/desktop/pages/file_manager_page.dart @@ -824,22 +824,22 @@ class _FileManagerPageState extends State final x = offset.dx; final y = offset.dy + size.height + 1; - final peerPlatform = (await bind.sessionGetPlatform( - id: _ffi.id, isRemote: !isLocal)) - .toLowerCase(); + final isPeerWindows = isWindows(isLocal); final List menuItems = [ MenuEntryButton( - childBuilder: (TextStyle? style) => Text( - '/', - style: style, - ), + childBuilder: (TextStyle? style) => isPeerWindows + ? buildWindowsThisPC(style) + : Text( + '/', + style: style, + ), proc: () { openDirectory('/', isLocal: isLocal); }, dismissOnClicked: true), MenuEntryDivider() ]; - if (peerPlatform == "windows") { + if (isPeerWindows) { var loadingTag = ""; if (!isLocal) { loadingTag = _ffi.dialogManager.showLoading("Waiting"); @@ -865,7 +865,8 @@ class _FileManagerPageState extends State ) ]), proc: () { - openDirectory(entry.name, isLocal: isLocal); + openDirectory('${entry.name}\\', + isLocal: isLocal); }, dismissOnClicked: true)); } @@ -898,21 +899,48 @@ class _FileManagerPageState extends State ]); } + Widget buildWindowsThisPC([TextStyle? textStyle]) { + final color = Theme.of(context).iconTheme.color?.withOpacity(0.7); + return Row(children: [ + Icon(Icons.computer, size: 20, color: color), + SizedBox(width: 10), + Text(translate('This PC'), style: textStyle) + ]); + } + List getPathBreadCrumbItems( bool isLocal, void Function(List) onPressed) { final path = model.getCurrentDir(isLocal).path; - final list = PathUtil.split(path, model.getCurrentIsWindows(isLocal)); final breadCrumbList = List.empty(growable: true); - breadCrumbList.addAll(list.asMap().entries.map((e) => BreadCrumbItem( - content: TextButton( - child: Text(e.value), - style: ButtonStyle( - minimumSize: MaterialStateProperty.all(Size(0, 0))), - onPressed: () => onPressed(list.sublist(0, e.key + 1))) - .marginSymmetric(horizontal: 4)))); + if (isWindows(isLocal) && path == '/') { + breadCrumbList.add(BreadCrumbItem( + content: TextButton( + child: buildWindowsThisPC(), + style: ButtonStyle( + minimumSize: MaterialStateProperty.all(Size(0, 0))), + onPressed: () => onPressed(['/'])) + .marginSymmetric(horizontal: 4))); + } else { + final list = PathUtil.split(path, model.getCurrentIsWindows(isLocal)); + breadCrumbList.addAll(list.asMap().entries.map((e) => BreadCrumbItem( + content: TextButton( + child: Text(e.value), + style: ButtonStyle( + minimumSize: MaterialStateProperty.all(Size(0, 0))), + onPressed: () => onPressed(list.sublist(0, e.key + 1))) + .marginSymmetric(horizontal: 4)))); + } return breadCrumbList; } + bool isWindows(bool isLocal) { + if (isLocal) { + return Platform.isWindows; + } else { + return _ffi.ffiModel.pi.platform.toLowerCase() == "windows"; + } + } + breadCrumbScrollToEnd(bool isLocal) { Future.delayed(Duration(milliseconds: 200), () { final breadCrumbScroller = getBreadCrumbScrollController(isLocal); diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 29516432d..3ee4735e3 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -386,5 +386,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("JumpLink", "查看"), ("Please Select the screen to be shared(Operate on the peer side).", "请选择要分享的画面(对端操作)。"), ("Show RustDesk", "显示rustdesk"), + ("This PC", "此电脑"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 84a5c590e..e0998a7bb 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland vyžaduje vyšší verzi linuxové distribuce. Zkuste prosím X11 desktop nebo změňte OS."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Vyberte prosím obrazovku, kterou chcete sdílet (Ovládejte na straně protějšku)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 1210c2dba..9aa4f00b9 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland kræver en højere version af linux distro. Prøv venligst X11 desktop eller skift dit OS."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Vælg venligst den skærm, der skal deles (Betjen på peer-siden)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 95d0c3e5b..4ce6cbd56 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland erfordert eine höhere Version der Linux-Distribution. Bitte versuchen Sie den X11-Desktop oder ändern Sie Ihr Betriebssystem."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Bitte wählen Sie den Bildschirm aus, der freigegeben werden soll (auf der Peer-Seite arbeiten)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 57955b9b8..8fb58cf83 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland postulas pli altan version de linuksa distro. Bonvolu provi X11-labortablon aŭ ŝanĝi vian OS."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Bonvolu Elekti la ekranon por esti dividita (Funkciu ĉe la sama flanko)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 3fdcbc069..a14aa7bcb 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -278,7 +278,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("android_stop_service_tip", "Cerrar el servicio cerrará automáticamente todas las conexiones establecidas."), ("android_version_audio_tip", "La versión actual de Android no admite la captura de audio, actualice a Android 10 o posterior."), ("android_start_service_tip", "Toque el permiso [Iniciar servicio] o ABRIR [Captura de pantalla] para iniciar el servicio de uso compartido de pantalla."), - ("Account", ""), + ("Account", "Cuenta"), ("Overwrite", "Sobrescribir"), ("This file exists, skip or overwrite this file?", "Este archivo existe, ¿omitir o sobrescribir este archivo?"), ("Quit", "Salir"), @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland requiere una versión superior de la distribución de Linux. Pruebe el escritorio X11 o cambie su sistema operativo."), ("JumpLink", "Ver"), ("Please Select the screen to be shared(Operate on the peer side).", "Seleccione la pantalla que se compartirá (Operar en el lado del par)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 8e75eec3a..f1119e166 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland nécessite une version supérieure de la distribution Linux. Veuillez essayer le bureau X11 ou changer votre système d'exploitation."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Veuillez sélectionner l'écran à partager (opérer du côté pair)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index e26cdeff7..262574c43 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "A Wayland a Linux disztró magasabb verzióját igényli. Próbálja ki az X11 desktopot, vagy változtassa meg az operációs rendszert."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Kérjük, válassza ki a megosztani kívánt képernyőt (a társoldalon működjön)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 8486e9e64..2d2ab9b1a 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland membutuhkan versi distro linux yang lebih tinggi. Silakan coba desktop X11 atau ubah OS Anda."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Silakan Pilih layar yang akan dibagikan (Operasi di sisi rekan)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 57ba210c3..6965e6610 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland richiede una versione superiore della distribuzione Linux. Prova X11 desktop o cambia il tuo sistema operativo."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Seleziona lo schermo da condividere (opera sul lato peer)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 207a874ec..12dc9ebaf 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland には、より高いバージョンの Linux ディストリビューションが必要です。 X11 デスクトップを試すか、OS を変更してください。"), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "共有する画面を選択してください(ピア側で操作)。"), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 5ed580ff3..406de6cef 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland에는 더 높은 버전의 Linux 배포판이 필요합니다. X11 데스크탑을 시도하거나 OS를 변경하십시오."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "공유할 화면을 선택하십시오(피어 측에서 작동)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index ad7bdb476..df1237bfb 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland linux дистрибутивінің жоғарырақ нұсқасын қажет етеді. X11 жұмыс үстелін қолданып көріңіз немесе операциялық жүйеңізді өзгертіңіз."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Бөлісетін экранды таңдаңыз (бірдей жағынан жұмыс жасаңыз)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 79b5869db..201a60811 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -116,7 +116,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Good image quality", "Dobra jakość obrazu"), ("Balanced", "Zrównoważony"), ("Optimize reaction time", "Zoptymalizuj czas reakcji"), - ("Custom", ""), + ("Custom", "Własne"), ("Show remote cursor", "Pokazuj zdalny kursor"), ("Show quality monitor", "Pokazuj jakość monitora"), ("Disable clipboard", "Wyłącz schowek"), @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland wymaga wyższej wersji dystrybucji Linuksa. Wypróbuj pulpit X11 lub zmień system operacyjny."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Wybierz ekran do udostępnienia (działaj po stronie równorzędnej)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index fc40cbfb8..a9189fc14 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland requer uma versão superior da distribuição linux. Por favor, tente o desktop X11 ou mude seu sistema operacional."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Por favor, selecione a tela a ser compartilhada (operar no lado do peer)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index adeee81a4..d6a7ccec0 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", ""), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", ""), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index c6f9d6d0f..9ddb630d3 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Для Wayland требуется более поздняя версия дистрибутива Linux. Пожалуйста, попробуйте рабочий стол X11 или смените ОС."), ("JumpLink", "Просмотр"), ("Please Select the screen to be shared(Operate on the peer side).", "Пожалуйста, выберите экран для совместного использования (работайте на одноранговой стороне)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 107f38bf8..38196c011 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland vyžaduje vyššiu verziu linuxovej distribúcie. Skúste X11 desktop alebo zmeňte OS."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Vyberte obrazovku, ktorú chcete zdieľať (Ovládajte na strane partnera)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index a08eec33d..d5130d66b 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", ""), ("JumpLink", ""), ("Please Select the screen to be shared(Operate on the peer side).", ""), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 99fad87bc..fe9b5d2fc 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland, linux dağıtımının daha yüksek bir sürümünü gerektirir. Lütfen X11 masaüstünü deneyin veya işletim sisteminizi değiştirin."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Lütfen paylaşılacak ekranı seçiniz (Ekran tarafında çalıştırın)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index d20888aeb..0f986ffa1 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -32,7 +32,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Import Server Config", "匯入伺服器設定"), ("Export Server Config", "導出服務器配置"), ("Import server configuration successfully", "匯入伺服器設定成功"), - ("Export server configuration successfully", ""), ("Export server configuration successfully", "導出服務器配置信息成功"), ("Invalid server configuration", "無效的伺服器設定"), ("Clipboard is empty", "剪貼簿是空的"), @@ -386,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland 需要更高版本的 linux 發行版。 請嘗試 X11 桌面或更改您的操作系統。"), ("JumpLink", "查看"), ("Please Select the screen to be shared(Operate on the peer side).", "請選擇要分享的畫面(在對端操作)。"), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index f6c389533..1c34d0825 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Для Wayland потрібна новіша версія дистрибутива Linux. Будь ласка, спробуйте робочий стіл X11 або змініть свою ОС."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Будь ласка, виберіть екран, до якого потрібно надати доступ (працюйте на стороні однорангового пристрою)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index f4823dbfd..255b60def 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -385,5 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland yêu cầu phiên bản distro linux cao hơn. Vui lòng thử máy tính để bàn X11 hoặc thay đổi hệ điều hành của bạn."), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "Vui lòng Chọn màn hình để chia sẻ (Hoạt động ở phía ngang hàng)."), + ("Show RustDesk", ""), + ("This PC", ""), ].iter().cloned().collect(); }