From b52cf070f5e95c906640dc02a42e63f944174a8e Mon Sep 17 00:00:00 2001 From: dignow Date: Mon, 9 Oct 2023 17:22:22 +0800 Subject: [PATCH] multi flutter ui sessions, refact 'Show displays as individual windows' Signed-off-by: dignow --- flutter/lib/common.dart | 15 +++------ flutter/lib/common/widgets/toolbar.dart | 18 ++++++++++ flutter/lib/consts.dart | 5 ++- .../desktop/pages/desktop_setting_page.dart | 29 ++-------------- .../lib/desktop/widgets/remote_toolbar.dart | 33 +++++++++++++++++-- flutter/lib/models/model.dart | 5 ++- libs/hbb_common/src/config.rs | 12 +++++++ src/client.rs | 11 +++++++ src/flutter_ffi.rs | 14 ++++++++ src/lang/ar.rs | 3 +- src/lang/ca.rs | 3 +- src/lang/cn.rs | 3 +- src/lang/cs.rs | 3 +- src/lang/da.rs | 3 +- src/lang/de.rs | 3 +- src/lang/el.rs | 3 +- src/lang/eo.rs | 3 +- src/lang/es.rs | 3 +- src/lang/fa.rs | 3 +- src/lang/fr.rs | 3 +- src/lang/hu.rs | 3 +- src/lang/id.rs | 3 +- src/lang/it.rs | 3 +- src/lang/ja.rs | 3 +- src/lang/ko.rs | 3 +- src/lang/kz.rs | 3 +- src/lang/lt.rs | 3 +- src/lang/lv.rs | 3 +- src/lang/nl.rs | 3 +- src/lang/pl.rs | 3 +- src/lang/pt_PT.rs | 3 +- src/lang/ptbr.rs | 3 +- src/lang/ro.rs | 3 +- src/lang/ru.rs | 3 +- src/lang/sk.rs | 3 +- src/lang/sl.rs | 3 +- src/lang/sq.rs | 3 +- src/lang/sr.rs | 3 +- src/lang/sv.rs | 3 +- src/lang/template.rs | 3 +- src/lang/th.rs | 3 +- src/lang/tr.rs | 3 +- src/lang/tw.rs | 3 +- src/lang/ua.rs | 3 +- src/lang/vn.rs | 3 +- src/ui_session_interface.rs | 8 +++++ 46 files changed, 140 insertions(+), 118 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 61d006b8a..73b4bf1a5 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -2590,15 +2590,6 @@ String getDesktopTabLabel(String peerId, String alias) { return label; } -String getChooseDisplayBehavior() { - var current = bind.mainGetOptionSync(key: kKeyChooseDisplayBehavior); - if (![kChooseDisplayBehaviorSwitch, kChooseDisplayBehaviorOpen] - .contains(current)) { - current = kChooseDisplayBehaviorOpen; - } - return current; -} - sessionRefreshVideo(SessionID sessionId, PeerInfo pi) async { if (pi.currentDisplay == kAllDisplayValue) { for (int i = 0; i < pi.displays.length; i++) { @@ -2609,5 +2600,7 @@ sessionRefreshVideo(SessionID sessionId, PeerInfo pi) async { } } -bool get isChooseDisplayToOpen => - getChooseDisplayBehavior() != kChooseDisplayBehaviorSwitch; +bool isChooseDisplayToOpenInNewWindow(PeerInfo pi, SessionID sessionId) => + pi.isSupportMultiDisplay && + bind.sessionGetDisplaysAsIndividualWindows(sessionId: sessionId) == 'Y'; + diff --git a/flutter/lib/common/widgets/toolbar.dart b/flutter/lib/common/widgets/toolbar.dart index 1717e99f2..ceb28b0a3 100644 --- a/flutter/lib/common/widgets/toolbar.dart +++ b/flutter/lib/common/widgets/toolbar.dart @@ -515,5 +515,23 @@ Future> toolbarDisplayToggle( }, child: Text(translate('Swap control-command key')))); } + + if (pi.isSupportMultiDisplay && + PrivacyModeState.find(id).isFalse && + pi.displaysCount.value > 1 && + bind.mainGetUserDefaultOption(key: kKeyShowMonitorsToolbar) == 'Y') { + final value = + bind.sessionGetDisplaysAsIndividualWindows(sessionId: ffi.sessionId) == + 'Y'; + v.add(TToggleMenu( + value: value, + onChanged: (value) { + if (value == null) return; + bind.sessionSetDisplaysAsIndividualWindows( + sessionId: sessionId, value: value ? 'Y' : ''); + }, + child: Text(translate('Show displays as individual windows')))); + } + return v; } diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 9c7fdf01d..1452270d1 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -66,9 +66,8 @@ const int kWindowMainId = 0; const String kPointerEventKindTouch = "touch"; const String kPointerEventKindMouse = "mouse"; -const String kKeyChooseDisplayBehavior = 'choose-display-behavior'; -const String kChooseDisplayBehaviorSwitch = 'switch'; -const String kChooseDisplayBehaviorOpen = 'open'; +const String kKeyShowDisplaysAsIndividualWindows = 'displays_as_individual_windows'; +const String kKeyShowMonitorsToolbar = 'show_monitors_toolbar'; // the executable name of the portable version const String kEnvPortableExecutable = "RUSTDESK_APPNAME"; diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 84c941c88..259511bfd 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -11,7 +11,6 @@ import 'package:flutter_hbb/consts.dart'; import 'package:flutter_hbb/desktop/pages/desktop_home_page.dart'; import 'package:flutter_hbb/desktop/pages/desktop_tab_page.dart'; import 'package:flutter_hbb/models/platform_model.dart'; -import 'package:flutter_hbb/models/desktop_render_texture.dart'; import 'package:flutter_hbb/models/server_model.dart'; import 'package:flutter_hbb/plugin/manager.dart'; import 'package:flutter_hbb/plugin/widgets/desktop_settings.dart'; @@ -1124,7 +1123,6 @@ class _DisplayState extends State<_Display> { controller: scrollController, physics: DraggableNeverScrollableScrollPhysics(), children: [ - chooseDisplay(context), viewStyle(context), scrollStyle(context), imageQuality(context), @@ -1133,29 +1131,6 @@ class _DisplayState extends State<_Display> { ]).marginOnly(bottom: _kListViewBottomMargin)); } - Widget chooseDisplay(BuildContext context) { - if (!useTextureRender) return const Offstage(); - - var current = getChooseDisplayBehavior(); - onChanged(String value) { - bind.mainSetOption(key: kKeyChooseDisplayBehavior, value: value); - setState(() {}); - } - - return _Card(title: 'Choose display behavior', children: [ - _Radio(context, - value: kChooseDisplayBehaviorSwitch, - groupValue: current, - label: 'Switch display', - onChanged: onChanged), - _Radio(context, - value: kChooseDisplayBehaviorOpen, - groupValue: current, - label: 'Open in new window', - onChanged: onChanged), - ]); - } - Widget viewStyle(BuildContext context) { final key = 'view_style'; onChanged(String value) async { @@ -1314,7 +1289,7 @@ class _DisplayState extends State<_Display> { Widget other(BuildContext context) { return _Card(title: 'Other Default Options', children: [ otherRow('View Mode', 'view_only'), - otherRow('show_monitors_tip', 'show_monitors_toolbar'), + otherRow('show_monitors_tip', kKeyShowMonitorsToolbar), otherRow('Collapse toolbar', 'collapse_toolbar'), otherRow('Show remote cursor', 'show_remote_cursor'), otherRow('Zoom cursor', 'zoom-cursor'), @@ -1325,6 +1300,8 @@ class _DisplayState extends State<_Display> { otherRow('Lock after session end', 'lock_after_session_end'), otherRow('Privacy mode', 'privacy_mode'), otherRow('Reverse mouse wheel', 'reverse_mouse_wheel'), + otherRow('Show displays as individual windows', + kKeyShowDisplaysAsIndividualWindows), ]); } } diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart index dddbc32a1..1bf4d438a 100644 --- a/flutter/lib/desktop/widgets/remote_toolbar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -598,7 +598,7 @@ class _MonitorMenu extends StatelessWidget { }) : super(key: key); bool get showMonitorsToolbar => - bind.mainGetUserDefaultOption(key: 'show_monitors_toolbar') == 'Y'; + bind.mainGetUserDefaultOption(key: kKeyShowMonitorsToolbar) == 'Y'; @override Widget build(BuildContext context) => @@ -614,13 +614,40 @@ class _MonitorMenu extends StatelessWidget { menuStyle: MenuStyle( padding: MaterialStatePropertyAll(EdgeInsets.symmetric(horizontal: 6))), - menuChildren: [Row(children: buildMonitorList(false))]); + menuChildren: [buildMonitorSubmenuWidget()]); } Widget buildMultiMonitorMenu() { return Row(children: buildMonitorList(true)); } + Widget buildMonitorSubmenuWidget() { + final pi = ffi.ffiModel.pi; + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row(children: buildMonitorList(false)), + pi.isSupportMultiDisplay ? Divider() : Offstage(), + pi.isSupportMultiDisplay ? chooseDisplayBehavior() : Offstage(), + ], + ); + } + + Widget chooseDisplayBehavior() { + final value = + bind.sessionGetDisplaysAsIndividualWindows(sessionId: ffi.sessionId) == + 'Y'; + return CkbMenuButton( + value: value, + onChanged: (value) async { + if (value == null) return; + await bind.sessionSetDisplaysAsIndividualWindows( + sessionId: ffi.sessionId, value: value ? 'Y' : ''); + }, + ffi: ffi, + child: Text(translate('Show displays as individual windows'))); + } + List buildMonitorList(bool isMulti) { final List monitorList = []; final pi = ffi.ffiModel.pi; @@ -746,7 +773,7 @@ class _MonitorMenu extends StatelessWidget { _menuDismissCallback(ffi); RxInt display = CurrentDisplayState.find(id); if (display.value != i) { - if (pi.isSupportMultiDisplay) { + if (isChooseDisplayToOpenInNewWindow(pi, ffi.sessionId)) { openMonitorInNewTabOrWindow(i, pi); } else { openMonitorInTheSameTab(i, pi); diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 7bb96a99b..a0fde0ca4 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -430,7 +430,7 @@ class FfiModel with ChangeNotifier { final curDisplay = int.parse(evt['display']); // The message should be handled by the another UI session. - if (_pi.isSupportMultiDisplay) { + if (isChooseDisplayToOpenInNewWindow(_pi, sessionId)) { if (curDisplay != _pi.currentDisplay) { return; } @@ -2211,8 +2211,7 @@ class PeerInfo with ChangeNotifier { bool get isWayland => platformDdditions['is_wayland'] == true; bool get isHeadless => platformDdditions['headless'] == true; - bool get isSupportMultiDisplay => - isDesktop && isSupportMultiUiSession && isChooseDisplayToOpen; + bool get isSupportMultiDisplay => isDesktop && isSupportMultiUiSession; bool get cursorEmbedded => tryGetDisplay()?.cursorEmbedded ?? false; diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs index 5a7c7d4b4..02f3c719e 100644 --- a/libs/hbb_common/src/config.rs +++ b/libs/hbb_common/src/config.rs @@ -284,6 +284,12 @@ pub struct PeerConfig { skip_serializing_if = "String::is_empty" )] pub reverse_mouse_wheel: String, + #[serde( + default = "PeerConfig::default_displays_as_individual_windows", + deserialize_with = "PeerConfig::deserialize_displays_as_individual_windows", + skip_serializing_if = "String::is_empty" + )] + pub displays_as_individual_windows: String, #[serde( default, @@ -328,6 +334,7 @@ impl Default for PeerConfig { keyboard_mode: Default::default(), view_only: Default::default(), reverse_mouse_wheel: Self::default_reverse_mouse_wheel(), + displays_as_individual_windows: Self::default_displays_as_individual_windows(), custom_resolutions: Default::default(), options: Self::default_options(), ui_flutter: Default::default(), @@ -1144,6 +1151,11 @@ impl PeerConfig { deserialize_reverse_mouse_wheel, UserDefaultConfig::read().get("reverse_mouse_wheel") ); + serde_field_string!( + default_displays_as_individual_windows, + deserialize_displays_as_individual_windows, + UserDefaultConfig::read().get("displays_as_individual_windows") + ); fn default_custom_image_quality() -> Vec { let f: f64 = UserDefaultConfig::read() diff --git a/src/client.rs b/src/client.rs index eff490ebb..445aaf225 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1207,6 +1207,17 @@ impl LoginConfigHandler { self.save_config(config); } + /// Save reverse mouse wheel ("", "Y") to the current config. + /// + /// # Arguments + /// + /// * `value` - The "displays_as_individual_windows" value ("", "Y"). + pub fn save_displays_as_individual_windows(&mut self, value: String) { + let mut config = self.load_config(); + config.displays_as_individual_windows = value; + self.save_config(config); + } + /// Save scroll style to the current config. /// /// # Arguments diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 93c7ced7e..e5f5d6573 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -339,6 +339,20 @@ pub fn session_set_reverse_mouse_wheel(session_id: SessionID, value: String) { } } +pub fn session_get_displays_as_individual_windows(session_id: SessionID) -> SyncReturn> { + if let Some(session) = sessions::get_session_by_session_id(&session_id) { + SyncReturn(Some(session.get_displays_as_individual_windows())) + } else { + SyncReturn(None) + } +} + +pub fn session_set_displays_as_individual_windows(session_id: SessionID, value: String) { + if let Some(session) = sessions::get_session_by_session_id(&session_id) { + session.save_displays_as_individual_windows(value); + } +} + pub fn session_get_custom_image_quality(session_id: SessionID) -> Option> { if let Some(session) = sessions::get_session_by_session_id(&session_id) { Some(session.get_custom_image_quality()) diff --git a/src/lang/ar.rs b/src/lang/ar.rs index 90252faa7..e30621c21 100644 --- a/src/lang/ar.rs +++ b/src/lang/ar.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 90887b622..e70c2c044 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 3793c2e5d..ba2796157 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", "显示器被拔出,切换到第一个显示器。"), ("No displays", "没有显示器。"), ("elevated_switch_display_msg", "切换到主显示器,因为提权后,不支持多显示器画面。"), - ("Choose display behavior", "选择显示器的行为"), - ("Switch display", "切换显示器"), ("Open in new window", "在新的窗口中打开"), + ("Show displays as individual windows", "在单个窗口中打开显示器"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 71e152668..8907e78e0 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index f11954d02..9d76b8e2e 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index dc80bad04..d051700b0 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index b1baabb2b..472b494e7 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 0ce93fdff..ccc674749 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index aa040d252..1b1b83afa 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index b7561283c..ff90b0430 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index f0d3c1d8f..2195d4fdd 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 5a5e280d6..24ac09d05 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index cf3702176..09e7853e4 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index fb84fbbdc..4416508bd 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -563,8 +563,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 7f85fcbb0..eeed3e147 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 1cce7aa7d..dcf28718a 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 3f52f8c7c..43c36e32c 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index f1e4e790f..02d4714c2 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lv.rs b/src/lang/lv.rs index 44c53889f..8de908d9c 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index f5a1d5322..71d1c1107 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose Display Behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index beb47a4ec..c8b2a4cc3 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index b0df8eefa..85863d2ae 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index ceeb1aa22..be4cdfd8e 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index b194edd25..311a13bec 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index b132d88b4..e05322b88 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 55ab7fb64..23751b734 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 13440aa70..8f84b181a 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 718f00518..3d26b5635 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 755c52784..03f4776b7 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 80a7098fc..ce2dab684 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index ae4885298..04d3d53ef 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index a6f10fb4f..75afe0324 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index abc1d4515..e51cff3db 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index cd0da2655..c70cf8f35 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index ce5561d52..94e0bc423 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index d77125ce3..895e7491a 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -562,8 +562,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("display_is_plugged_out_msg", ""), ("No displays", ""), ("elevated_switch_display_msg", ""), - ("Choose display behavior", ""), - ("Switch display", ""), ("Open in new window", ""), + ("Show displays as individual windows", ""), ].iter().cloned().collect(); } diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 568767f81..0eea85173 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -236,10 +236,18 @@ impl Session { self.lc.read().unwrap().reverse_mouse_wheel.clone() } + pub fn get_displays_as_individual_windows(&self) -> String { + self.lc.read().unwrap().displays_as_individual_windows.clone() + } + pub fn save_reverse_mouse_wheel(&self, value: String) { self.lc.write().unwrap().save_reverse_mouse_wheel(value); } + pub fn save_displays_as_individual_windows(&self, value: String) { + self.lc.write().unwrap().save_displays_as_individual_windows(value); + } + pub fn save_view_style(&self, value: String) { self.lc.write().unwrap().save_view_style(value); }