mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-14 03:56:27 +00:00
@@ -10,7 +10,6 @@ use std::time::{Duration, SystemTime};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
use hbb_common::message_proto::option_message::BoolOption;
|
||||
use rdev::{Event, EventType::*};
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -843,37 +842,6 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
pub fn set_view_only(&self, view_only: bool) {
|
||||
let mut option = OptionMessage::default();
|
||||
let f = |b: bool| {
|
||||
if b {
|
||||
BoolOption::Yes.into()
|
||||
} else {
|
||||
BoolOption::No.into()
|
||||
}
|
||||
};
|
||||
if view_only {
|
||||
option.disable_keyboard = f(true);
|
||||
option.disable_clipboard = f(true);
|
||||
option.show_remote_cursor = f(true);
|
||||
} else {
|
||||
option.disable_keyboard = f(false);
|
||||
option.disable_clipboard = f(self.get_toggle_option("disable-clipboard".to_string()));
|
||||
option.show_remote_cursor = f(self.get_toggle_option("show-remote-cursor".to_string()));
|
||||
}
|
||||
let mut misc = Misc::new();
|
||||
misc.set_option(option);
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
self.send(Data::Message(msg));
|
||||
if self.get_toggle_option("view-only".to_string()) != view_only {
|
||||
self.lc
|
||||
.write()
|
||||
.unwrap()
|
||||
.toggle_option("view-only".to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
|
||||
@@ -905,7 +873,14 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
|
||||
only_count: bool,
|
||||
);
|
||||
fn confirm_delete_files(&self, id: i32, i: i32, name: String);
|
||||
fn override_file_confirm(&self, id: i32, file_num: i32, to: String, is_upload: bool, is_identical: bool);
|
||||
fn override_file_confirm(
|
||||
&self,
|
||||
id: i32,
|
||||
file_num: i32,
|
||||
to: String,
|
||||
is_upload: bool,
|
||||
is_identical: bool,
|
||||
);
|
||||
fn update_block_input_state(&self, on: bool);
|
||||
fn job_progress(&self, id: i32, file_num: i32, speed: f64, finished_size: f64);
|
||||
fn adapt_size(&self);
|
||||
|
||||
Reference in New Issue
Block a user