diff --git a/src/App.Commands.cs b/src/App.Commands.cs index 8a485029..18016a1c 100644 --- a/src/App.Commands.cs +++ b/src/App.Commands.cs @@ -25,6 +25,18 @@ namespace SourceGit private Action _action = null; } + public static bool IsCheckForUpdateCommandVisible + { + get + { + #if DISABLE_UPDATE_DETECTION + return false; + #else + return true; + #endif + } + } + public static readonly Command OpenPreferenceCommand = new Command(_ => OpenDialog(new Views.Preference())); public static readonly Command OpenHotkeysCommand = new Command(_ => OpenDialog(new Views.Hotkeys())); public static readonly Command OpenAppDataDirCommand = new Command(_ => Native.OS.OpenInFileManager(Native.OS.DataDir)); diff --git a/src/App.axaml b/src/App.axaml index 0f40031d..55aacb89 100644 --- a/src/App.axaml +++ b/src/App.axaml @@ -33,7 +33,7 @@ - + diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 0615724a..3d1547c9 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -548,9 +548,11 @@ namespace SourceGit _launcher = new ViewModels.Launcher(startupRepo); desktop.MainWindow = new Views.Launcher() { DataContext = _launcher }; + #if !DISABLE_UPDATE_DETECTION var pref = ViewModels.Preference.Instance; if (pref.ShouldCheck4UpdateOnStartup()) Check4Update(); + #endif } private ViewModels.Launcher _launcher = null; diff --git a/src/SourceGit.csproj b/src/SourceGit.csproj index 32f68d03..89893a39 100644 --- a/src/SourceGit.csproj +++ b/src/SourceGit.csproj @@ -26,6 +26,10 @@ link + + $(DefineConstants);DISABLE_UPDATE_DETECTION + + diff --git a/src/Views/Launcher.axaml b/src/Views/Launcher.axaml index d37cf928..a0691c4c 100644 --- a/src/Views/Launcher.axaml +++ b/src/Views/Launcher.axaml @@ -51,12 +51,12 @@ - + - + diff --git a/src/Views/Preference.axaml b/src/Views/Preference.axaml index 0ed598c2..6adbaca4 100644 --- a/src/Views/Preference.axaml +++ b/src/Views/Preference.axaml @@ -2,6 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:s="using:SourceGit" xmlns:m="using:SourceGit.Models" xmlns:c="using:SourceGit.Converters" xmlns:vm="using:SourceGit.ViewModels" @@ -45,7 +46,7 @@ - +