mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-20 11:41:05 +03:00
feat: remote printer (#11231)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -379,6 +379,10 @@ impl InvokeUiSession for SciterHandler {
|
||||
fn update_record_status(&self, start: bool) {
|
||||
self.call("updateRecordStatus", &make_args!(start));
|
||||
}
|
||||
|
||||
fn printer_request(&self, id: i32, path: String) {
|
||||
self.call("printerRequest", &make_args!(id, path));
|
||||
}
|
||||
}
|
||||
|
||||
pub struct SciterSession(Session<SciterHandler>);
|
||||
@@ -491,6 +495,8 @@ impl sciter::EventHandler for SciterSession {
|
||||
fn get_chatbox();
|
||||
fn get_icon();
|
||||
fn get_home_dir();
|
||||
fn get_next_job_id();
|
||||
fn update_next_job_id(i32);
|
||||
fn read_dir(String, bool);
|
||||
fn remove_dir(i32, String, bool);
|
||||
fn create_dir(i32, String, bool);
|
||||
@@ -502,8 +508,8 @@ impl sciter::EventHandler for SciterSession {
|
||||
fn confirm_delete_files(i32, i32);
|
||||
fn set_no_confirm(i32);
|
||||
fn cancel_job(i32);
|
||||
fn send_files(i32, String, String, i32, bool, bool);
|
||||
fn add_job(i32, String, String, i32, bool, bool);
|
||||
fn send_files(i32, i32, String, String, i32, bool, bool);
|
||||
fn add_job(i32, i32, String, String, i32, bool, bool);
|
||||
fn resume_job(i32, bool);
|
||||
fn get_platform(bool);
|
||||
fn get_path_sep(bool);
|
||||
@@ -541,6 +547,8 @@ impl sciter::EventHandler for SciterSession {
|
||||
fn set_selected_windows_session_id(String);
|
||||
fn is_recording();
|
||||
fn has_file_clipboard();
|
||||
fn get_printer_names();
|
||||
fn on_printer_selected(i32, String, String);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -842,6 +850,22 @@ impl SciterSession {
|
||||
fn version_cmp(&self, v1: String, v2: String) -> i32 {
|
||||
(hbb_common::get_version_number(&v1) - hbb_common::get_version_number(&v2)) as i32
|
||||
}
|
||||
|
||||
fn get_printer_names(&self) -> Value {
|
||||
#[cfg(target_os = "windows")]
|
||||
let printer_names = crate::platform::windows::get_printer_names().unwrap_or_default();
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
let printer_names: Vec<String> = vec![];
|
||||
let mut v = Value::array(0);
|
||||
for name in printer_names {
|
||||
v.push(name);
|
||||
}
|
||||
v
|
||||
}
|
||||
|
||||
fn on_printer_selected(&self, id: i32, path: String, printer_name: String) {
|
||||
self.printer_response(id, path, printer_name);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn make_fd(id: i32, entries: &Vec<FileEntry>, only_count: bool) -> Value {
|
||||
|
||||
Reference in New Issue
Block a user