@@ -1207,7 +1207,7 @@ impl LoginConfigHandler {
|
||||
self.save_config(config);
|
||||
}
|
||||
|
||||
/// Save reverse mouse wheel ("", "Y") to the current config.
|
||||
/// Save "displays_as_individual_windows" ("", "Y") to the current config.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@@ -1218,6 +1218,17 @@ impl LoginConfigHandler {
|
||||
self.save_config(config);
|
||||
}
|
||||
|
||||
/// Save "use_all_my_monitors_when_connecting" ("", "Y") to the current config.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `value` - The "use_all_my_monitors_when_connecting" value ("", "Y").
|
||||
pub fn save_use_all_my_monitors_when_connecting(&mut self, value: String) {
|
||||
let mut config = self.load_config();
|
||||
config.use_all_my_monitors_when_connecting = value;
|
||||
self.save_config(config);
|
||||
}
|
||||
|
||||
/// Save scroll style to the current config.
|
||||
///
|
||||
/// # Arguments
|
||||
|
||||
@@ -339,7 +339,9 @@ pub fn session_set_reverse_mouse_wheel(session_id: SessionID, value: String) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_get_displays_as_individual_windows(session_id: SessionID) -> SyncReturn<Option<String>> {
|
||||
pub fn session_get_displays_as_individual_windows(
|
||||
session_id: SessionID,
|
||||
) -> SyncReturn<Option<String>> {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
SyncReturn(Some(session.get_displays_as_individual_windows()))
|
||||
} else {
|
||||
@@ -353,6 +355,22 @@ pub fn session_set_displays_as_individual_windows(session_id: SessionID, value:
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_get_use_all_my_monitors_when_connecting(
|
||||
session_id: SessionID,
|
||||
) -> SyncReturn<Option<String>> {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
SyncReturn(Some(session.get_use_all_my_monitors_when_connecting()))
|
||||
} else {
|
||||
SyncReturn(None)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_set_use_all_my_monitors_when_connecting(session_id: SessionID, value: String) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.save_use_all_my_monitors_when_connecting(value);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_get_custom_image_quality(session_id: SessionID) -> Option<Vec<i32>> {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
Some(session.get_custom_image_quality())
|
||||
@@ -1069,6 +1087,29 @@ pub fn main_get_main_display() -> SyncReturn<String> {
|
||||
SyncReturn(display_info)
|
||||
}
|
||||
|
||||
pub fn main_get_displays() -> SyncReturn<String> {
|
||||
#[cfg(target_os = "ios")]
|
||||
let display_info = "".to_owned();
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
let mut display_info = "".to_owned();
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
if let Ok(displays) = crate::display_service::try_get_displays() {
|
||||
let displays = displays
|
||||
.iter()
|
||||
.map(|d| {
|
||||
HashMap::from([
|
||||
("x", d.origin().0),
|
||||
("y", d.origin().1),
|
||||
("w", d.width() as i32),
|
||||
("h", d.height() as i32),
|
||||
])
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
display_info = serde_json::to_string(&displays).unwrap_or_default();
|
||||
}
|
||||
SyncReturn(display_info)
|
||||
}
|
||||
|
||||
pub fn session_add_port_forward(
|
||||
session_id: SessionID,
|
||||
local_port: i32,
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", "切换到主显示器,因为提权后,不支持多显示器画面。"),
|
||||
("Open in new window", "在新的窗口中打开"),
|
||||
("Show displays as individual windows", "在单个窗口中打开显示器"),
|
||||
("Use all my displays when connecting", "建立连接时使用我的所有显示器"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", "Pindah ke tampilan utama, pada mode elevasi, pengggunaan lebih dari satu layar tidak diizinkan"),
|
||||
("Open in new window", "Buka di jendela baru"),
|
||||
("Show displays as individual windows", "Tampilkan dengan jendela terpisah"),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -565,5 +565,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", "Passo allo schermo principale perché in modalità elevata non sono supportati più schermi."),
|
||||
("Open in new window", "Apri in una nuova finestra"),
|
||||
("Show displays as individual windows", "Visualizza schermi come finestre individuali"),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", "Pārslēdzieties uz primāro displeju, jo paaugstinātajā režīmā netiek atbalstīti vairāki displeji."),
|
||||
("Open in new window", "Atvērt jaunā logā"),
|
||||
("Show displays as individual windows", "Rādīt displejus kā atsevišķus logus"),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", "Przełącz się na ekran główny, ponieważ wyświetlanie kilku ekranów nie jest obsługiwane przy podniesionych uprawnieniach."),
|
||||
("Open in new window", "Otwórz w nowym oknie"),
|
||||
("Show displays as individual windows", "Pokaż ekrany w osobnych oknach"),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -564,5 +564,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("elevated_switch_display_msg", ""),
|
||||
("Open in new window", ""),
|
||||
("Show displays as individual windows", ""),
|
||||
("Use all my displays when connecting", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -240,6 +240,10 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
self.lc.read().unwrap().displays_as_individual_windows.clone()
|
||||
}
|
||||
|
||||
pub fn get_use_all_my_monitors_when_connecting(&self) -> String {
|
||||
self.lc.read().unwrap().use_all_my_monitors_when_connecting.clone()
|
||||
}
|
||||
|
||||
pub fn save_reverse_mouse_wheel(&self, value: String) {
|
||||
self.lc.write().unwrap().save_reverse_mouse_wheel(value);
|
||||
}
|
||||
@@ -248,6 +252,10 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
self.lc.write().unwrap().save_displays_as_individual_windows(value);
|
||||
}
|
||||
|
||||
pub fn save_use_all_my_monitors_when_connecting(&self, value: String) {
|
||||
self.lc.write().unwrap().save_use_all_my_monitors_when_connecting(value);
|
||||
}
|
||||
|
||||
pub fn save_view_style(&self, value: String) {
|
||||
self.lc.write().unwrap().save_view_style(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user