From de923fdd2e03b6be7df53207cae8ed696dad7c2a Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 2 Aug 2022 11:29:48 +0800 Subject: [PATCH] fix: hide restart menu item if version < 1.1.10 Signed-off-by: 21pages --- src/ui/remote.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ui/remote.rs b/src/ui/remote.rs index f948f964a..1a446317d 100644 --- a/src/ui/remote.rs +++ b/src/ui/remote.rs @@ -23,10 +23,6 @@ use clipboard::{ get_rx_clip_client, server_clip_file, }; use enigo::{self, Enigo, KeyboardControllable}; -use hbb_common::fs::{ - can_enable_overwrite_detection, get_job, get_string, new_send_confirm, DigestCheckResult, - RemoveJobMeta, -}; use hbb_common::{ allow_err, config::{Config, LocalConfig, PeerConfig}, @@ -43,6 +39,13 @@ use hbb_common::{ Stream, }; use hbb_common::{config::TransferSerde, fs::TransferJobMeta}; +use hbb_common::{ + fs::{ + can_enable_overwrite_detection, get_job, get_string, new_send_confirm, DigestCheckResult, + RemoveJobMeta, + }, + get_version_number, +}; #[cfg(windows)] use crate::clipboard_file::*; @@ -2604,6 +2607,9 @@ impl Interface for Handler { pi_sciter.set_item("hostname", pi.hostname.clone()); pi_sciter.set_item("platform", pi.platform.clone()); pi_sciter.set_item("sas_enabled", pi.sas_enabled); + if get_version_number(&pi.version) < get_version_number("1.1.10") { + self.call2("setPermission", &make_args!("restart", false)); + } if self.is_file_transfer() { if pi.username.is_empty() { self.on_error("No active console user logged on, please connect and logon first.");