mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-20 19:51:04 +03:00
buildin options and add to mobile (#8759)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -1341,6 +1341,7 @@ fn read_custom_client_advanced_settings(
|
||||
map_display_settings: &HashMap<String, &&str>,
|
||||
map_local_settings: &HashMap<String, &&str>,
|
||||
map_settings: &HashMap<String, &&str>,
|
||||
map_buildin_settings: &HashMap<String, &&str>,
|
||||
is_override: bool,
|
||||
) {
|
||||
let mut display_settings = if is_override {
|
||||
@@ -1358,6 +1359,8 @@ fn read_custom_client_advanced_settings(
|
||||
} else {
|
||||
config::DEFAULT_SETTINGS.write().unwrap()
|
||||
};
|
||||
let mut buildin_settings = config::BUILDIN_SETTINGS.write().unwrap();
|
||||
|
||||
if let Some(settings) = settings.as_object() {
|
||||
for (k, v) in settings {
|
||||
let Some(v) = v.as_str() else {
|
||||
@@ -1369,6 +1372,8 @@ fn read_custom_client_advanced_settings(
|
||||
local_settings.insert(k2.to_string(), v.to_owned());
|
||||
} else if let Some(k2) = map_settings.get(k) {
|
||||
server_settings.insert(k2.to_string(), v.to_owned());
|
||||
} else if let Some(k2) = map_buildin_settings.get(k) {
|
||||
buildin_settings.insert(k2.to_string(), v.to_owned());
|
||||
} else {
|
||||
let k2 = k.replace("_", "-");
|
||||
let k = k2.replace("-", "_");
|
||||
@@ -1381,6 +1386,9 @@ fn read_custom_client_advanced_settings(
|
||||
// server
|
||||
server_settings.insert(k.clone(), v.to_owned());
|
||||
server_settings.insert(k2.clone(), v.to_owned());
|
||||
// buildin
|
||||
buildin_settings.insert(k.clone(), v.to_owned());
|
||||
buildin_settings.insert(k2.clone(), v.to_owned());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1443,12 +1451,17 @@ pub fn read_custom_client(config: &str) {
|
||||
for s in config::keys::KEYS_SETTINGS {
|
||||
map_settings.insert(s.replace("_", "-"), s);
|
||||
}
|
||||
let mut buildin_settings = HashMap::new();
|
||||
for s in config::keys::KEYS_BUILDIN_SETTINGS {
|
||||
buildin_settings.insert(s.replace("_", "-"), s);
|
||||
}
|
||||
if let Some(default_settings) = data.remove("default-settings") {
|
||||
read_custom_client_advanced_settings(
|
||||
default_settings,
|
||||
&map_display_settings,
|
||||
&map_local_settings,
|
||||
&map_settings,
|
||||
&buildin_settings,
|
||||
false,
|
||||
);
|
||||
}
|
||||
@@ -1458,6 +1471,7 @@ pub fn read_custom_client(config: &str) {
|
||||
&map_display_settings,
|
||||
&map_local_settings,
|
||||
&map_settings,
|
||||
&buildin_settings,
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user