refactor and fix

This commit is contained in:
rustdesk
2021-10-08 00:16:10 +08:00
parent c0459b8f94
commit c0db2e6da4
2 changed files with 23 additions and 17 deletions

View File

@@ -333,9 +333,21 @@ impl UI {
}
}
}
*self.2.lock().unwrap() = m.clone();
ipc::set_options(m).ok();
}
fn set_option(&self, key: String, value: String) {
let mut options = self.2.lock().unwrap();
if value.is_empty() {
options.remove(&key);
} else {
options.insert(key, value);
}
ipc::set_options(options.clone()).ok();
}
fn install_path(&mut self) -> String {
#[cfg(windows)]
return crate::platform::windows::get_install_info().1;
@@ -587,6 +599,7 @@ impl sciter::EventHandler for UI {
fn test_if_valid_server(String);
fn get_sound_inputs();
fn set_options(Value);
fn set_option(String, String);
fn get_software_update_url();
fn get_new_version();
fn get_version();