mirror of
https://github.com/2dust/v2rayN.git
synced 2025-11-12 18:32:52 +00:00
Rename IsOSX to IsMacOS in Utils and usages
This commit is contained in:
parent
e20c11c1a7
commit
4da59cd767
10 changed files with 12 additions and 12 deletions
|
|
@ -998,7 +998,7 @@ public class Utils
|
|||
|
||||
public static bool IsLinux() => OperatingSystem.IsLinux();
|
||||
|
||||
public static bool IsOSX() => OperatingSystem.IsMacOS();
|
||||
public static bool IsMacOS() => OperatingSystem.IsMacOS();
|
||||
|
||||
public static bool IsNonWindows() => !OperatingSystem.IsWindows();
|
||||
|
||||
|
|
@ -1020,7 +1020,7 @@ public class Utils
|
|||
{
|
||||
try
|
||||
{
|
||||
if (IsWindows() || IsOSX())
|
||||
if (IsWindows() || IsMacOS())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public static class AutoStartupHandler
|
|||
await SetTaskLinux();
|
||||
}
|
||||
}
|
||||
else if (Utils.IsOSX())
|
||||
else if (Utils.IsMacOS())
|
||||
{
|
||||
await ClearTaskOSX();
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public static class SysProxyHandler
|
|||
await ProxySettingLinux.SetProxy(Global.Loopback, port, exceptions);
|
||||
break;
|
||||
|
||||
case ESysProxyType.ForcedChange when Utils.IsOSX():
|
||||
case ESysProxyType.ForcedChange when Utils.IsMacOS():
|
||||
await ProxySettingOSX.SetProxy(Global.Loopback, port, exceptions);
|
||||
break;
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ public static class SysProxyHandler
|
|||
await ProxySettingLinux.UnsetProxy();
|
||||
break;
|
||||
|
||||
case ESysProxyType.ForcedClear when Utils.IsOSX():
|
||||
case ESysProxyType.ForcedClear when Utils.IsMacOS():
|
||||
await ProxySettingOSX.UnsetProxy();
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class CoreAdminManager
|
|||
|
||||
try
|
||||
{
|
||||
var shellFileName = Utils.IsOSX() ? Global.KillAsSudoOSXShellFileName : Global.KillAsSudoLinuxShellFileName;
|
||||
var shellFileName = Utils.IsMacOS() ? Global.KillAsSudoOSXShellFileName : Global.KillAsSudoLinuxShellFileName;
|
||||
var shFilePath = await FileUtils.CreateLinuxShellFile("kill_as_sudo.sh", EmbedUtils.GetEmbedText(shellFileName), true);
|
||||
if (shFilePath.Contains(' '))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public partial class CoreConfigSingboxService
|
|||
}
|
||||
|
||||
var tunInbound = JsonUtils.Deserialize<Inbound4Sbox>(EmbedUtils.GetEmbedText(Global.TunSingboxInboundFileName)) ?? new Inbound4Sbox { };
|
||||
tunInbound.interface_name = Utils.IsOSX() ? $"utun{new Random().Next(99)}" : "singbox_tun";
|
||||
tunInbound.interface_name = Utils.IsMacOS() ? $"utun{new Random().Next(99)}" : "singbox_tun";
|
||||
tunInbound.mtu = _config.TunModeItem.Mtu;
|
||||
tunInbound.auto_route = _config.TunModeItem.AutoRoute;
|
||||
tunInbound.strict_route = _config.TunModeItem.StrictRoute;
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ public class UpdateService(Config config, Func<bool, string, Task> updateFunc)
|
|||
_ => null,
|
||||
};
|
||||
}
|
||||
else if (Utils.IsOSX())
|
||||
else if (Utils.IsMacOS())
|
||||
{
|
||||
return RuntimeInformation.ProcessArchitecture switch
|
||||
{
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
{
|
||||
ProcUtils.ProcessStart("xdg-open", path);
|
||||
}
|
||||
else if (Utils.IsOSX())
|
||||
else if (Utils.IsMacOS())
|
||||
{
|
||||
ProcUtils.ProcessStart("open", path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ public class StatusBarViewModel : MyReactiveObject
|
|||
{
|
||||
return AppManager.Instance.LinuxSudoPwd.IsNotEmpty();
|
||||
}
|
||||
else if (Utils.IsOSX())
|
||||
else if (Utils.IsMacOS())
|
||||
{
|
||||
return AppManager.Instance.LinuxSudoPwd.IsNotEmpty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
|||
Height = sizeItem.Height;
|
||||
|
||||
var workingArea = (Screens.ScreenFromWindow(this) ?? Screens.Primary).WorkingArea;
|
||||
var scaling = (Utils.IsOSX() ? null : VisualRoot?.RenderScaling) ?? 1.0;
|
||||
var scaling = (Utils.IsMacOS() ? null : VisualRoot?.RenderScaling) ?? 1.0;
|
||||
|
||||
var x = workingArea.X + ((workingArea.Width - (Width * scaling)) / 2);
|
||||
var y = workingArea.Y + ((workingArea.Height - (Height * scaling)) / 2);
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
|
|||
|
||||
tbAutoRunTip.IsVisible = false;
|
||||
}
|
||||
else if (Utils.IsOSX())
|
||||
else if (Utils.IsMacOS())
|
||||
{
|
||||
txbSettingsExceptionTip.IsVisible = false;
|
||||
panSystemProxyAdvanced.IsVisible = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue