mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
support --play in flutter for shortcut
This commit is contained in:
parent
f4bdfb6936
commit
e3d2dcf0c8
@ -22,12 +22,11 @@ pub fn core_main() -> Option<Vec<String>> {
|
|||||||
let mut _is_flutter_connect = false;
|
let mut _is_flutter_connect = false;
|
||||||
let mut arg_exe = Default::default();
|
let mut arg_exe = Default::default();
|
||||||
for arg in std::env::args() {
|
for arg in std::env::args() {
|
||||||
// to-do: how to pass to flutter?
|
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
arg_exe = arg;
|
arg_exe = arg;
|
||||||
} else if i > 0 {
|
} else if i > 0 {
|
||||||
#[cfg(feature = "flutter")]
|
#[cfg(feature = "flutter")]
|
||||||
if arg == "--connect" {
|
if arg == "--connect" || arg == "--play" {
|
||||||
_is_flutter_connect = true;
|
_is_flutter_connect = true;
|
||||||
}
|
}
|
||||||
if arg == "--elevate" {
|
if arg == "--elevate" {
|
||||||
@ -309,13 +308,18 @@ fn import_config(path: &str) {
|
|||||||
#[cfg(feature = "flutter")]
|
#[cfg(feature = "flutter")]
|
||||||
fn core_main_invoke_new_connection(mut args: std::env::Args) -> Option<Vec<String>> {
|
fn core_main_invoke_new_connection(mut args: std::env::Args) -> Option<Vec<String>> {
|
||||||
args.position(|element| {
|
args.position(|element| {
|
||||||
return element == "--connect";
|
return element == "--connect" || element == "--play";
|
||||||
})?;
|
})?;
|
||||||
let peer_id = args.next().unwrap_or("".to_string());
|
let mut peer_id = args.next().unwrap_or("".to_string());
|
||||||
if peer_id.is_empty() {
|
if peer_id.is_empty() {
|
||||||
eprintln!("please provide a valid peer id");
|
eprintln!("please provide a valid peer id");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
let app_name = crate::get_app_name();
|
||||||
|
let ext = format!(".{}", app_name.to_lowercase());
|
||||||
|
if peer_id.ends_with(&ext) {
|
||||||
|
peer_id = peer_id.replace(ext, "");
|
||||||
|
}
|
||||||
let mut switch_uuid = None;
|
let mut switch_uuid = None;
|
||||||
while let Some(item) = args.next() {
|
while let Some(item) = args.next() {
|
||||||
if item == "--switch_uuid" {
|
if item == "--switch_uuid" {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user