feat: support create shortcut for peers

This commit is contained in:
Kingtous
2022-11-14 15:41:43 +08:00
parent 5a25d0c9f7
commit 41b0c77faa
3 changed files with 43 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
use hbb_common::log;
// shared by flutter and sciter main function
/// shared by flutter and sciter main function
///
/// [Note]
/// If it returns [`None`], then the process will terminate, and flutter gui will not be started.
/// If it returns [`Some`], then the process will continue, and flutter gui will be started.
pub fn core_main() -> Option<Vec<String>> {
// https://docs.rs/flexi_logger/latest/flexi_logger/error_info/index.html#write
// though async logger more efficient, but it also causes more problems, disable it for now
@@ -223,6 +227,8 @@ fn import_config(path: &str) {
///
/// [Note]
/// this is for invoke new connection from dbus.
/// If it returns [`None`], then the process will terminate, and flutter gui will not be started.
/// If it returns [`Some`], then the process will continue, and flutter gui will be started.
#[cfg(feature = "flutter")]
fn core_main_invoke_new_connection(mut args: std::env::Args) -> Option<Vec<String>> {
args.position(|element| {
@@ -250,5 +256,5 @@ fn core_main_invoke_new_connection(mut args: std::env::Args) -> Option<Vec<Strin
}
}
#[cfg(not(target_os = "linux"))]
return None;
return Some(Vec::new());
}

View File

@@ -973,6 +973,11 @@ pub fn main_wol(id: String) {
crate::lan::send_wol(id)
}
pub fn main_create_shortcut(_id: String) {
#[cfg(windows)]
create_shortcut(_id);
}
pub fn cm_send_chat(conn_id: i32, msg: String) {
crate::ui_cm_interface::send_chat(conn_id, msg);
}