diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 10069c9bb..421ecacf0 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -3078,6 +3078,7 @@ If you experience adhesion problems, please re-run leveling." private static Stopwatch timer; public static bool EnableF5Collect { get; set; } + public static bool EnableNetworkTraffic { get; set; } public static SystemWindow LoadRootWindow(int width, int height) { diff --git a/MatterControlLib/ApplicationView/BrandMenuButton.cs b/MatterControlLib/ApplicationView/BrandMenuButton.cs index 425c0c24a..78f4e6460 100644 --- a/MatterControlLib/ApplicationView/BrandMenuButton.cs +++ b/MatterControlLib/ApplicationView/BrandMenuButton.cs @@ -103,14 +103,17 @@ namespace MatterHackers.MatterControl }); }; - popupMenu.CreateSeparator(); - - menuItem = popupMenu.CreateMenuItem("Check For Update".Localize(), AggContext.StaticData.LoadIcon("update.png", 16, 16, menuTheme.InvertIcons)); - menuItem.Click += (s, e) => UiThread.RunOnIdle(() => + if (Application.EnableNetworkTraffic) { - UpdateControlData.Instance.CheckForUpdate(); - DialogWindow.Show(); - }); + popupMenu.CreateSeparator(); + + menuItem = popupMenu.CreateMenuItem("Check For Update".Localize(), AggContext.StaticData.LoadIcon("update.png", 16, 16, menuTheme.InvertIcons)); + menuItem.Click += (s, e) => UiThread.RunOnIdle(() => + { + UpdateControlData.Instance.CheckForUpdate(); + DialogWindow.Show(); + }); + } popupMenu.CreateSeparator(); diff --git a/MatterControlLib/PartPreviewWindow/MainViewWidget.cs b/MatterControlLib/PartPreviewWindow/MainViewWidget.cs index 6456415bf..a1dfc523b 100644 --- a/MatterControlLib/PartPreviewWindow/MainViewWidget.cs +++ b/MatterControlLib/PartPreviewWindow/MainViewWidget.cs @@ -98,28 +98,36 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // Force common padding into top region tabControl.TabBar.Padding = theme.TabbarPadding.Clone(top: theme.TabbarPadding.Top * 2, bottom: 0); - // add in the update available button - updateAvailableButton = new LinkLabel("Update Available".Localize(), theme) + if (Application.EnableNetworkTraffic) { - Visible = false, - Name = "Update Available Link", - ToolTipText = "There is a new update available for download".Localize(), - VAnchor = VAnchor.Center, - Margin = new BorderDouble(10, 0) - }; + // add in the update available button + updateAvailableButton = new LinkLabel("Update Available".Localize(), theme) + { + Visible = false, + Name = "Update Available Link", + ToolTipText = "There is a new update available for download".Localize(), + VAnchor = VAnchor.Center, + Margin = new BorderDouble(10, 0) + }; - // Register listeners - UserSettings.Instance.SettingChanged += SetLinkButtonsVisibility; + // Register listeners + UserSettings.Instance.SettingChanged += SetLinkButtonsVisibility; - SetLinkButtonsVisibility(this, null); + SetLinkButtonsVisibility(this, null); - updateAvailableButton.Click += (s, e) => UiThread.RunOnIdle(() => - { - UpdateControlData.Instance.CheckForUpdate(); - DialogWindow.Show(); - }); + updateAvailableButton.Click += (s, e) => UiThread.RunOnIdle(() => + { + UpdateControlData.Instance.CheckForUpdate(); + DialogWindow.Show(); + }); - tabControl.TabBar.ActionArea.AddChild(updateAvailableButton); + tabControl.TabBar.ActionArea.AddChild(updateAvailableButton); + + UpdateControlData.Instance.UpdateStatusChanged.RegisterEvent((s, e) => + { + SetLinkButtonsVisibility(s, new StringEventArgs("Unknown")); + }, ref unregisterEvents); + } this.AddChild(tabControl); @@ -266,11 +274,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow ApplicationController.Instance.ShellFileOpened += this.Instance_OpenNewFile; - UpdateControlData.Instance.UpdateStatusChanged.RegisterEvent((s, e) => - { - SetLinkButtonsVisibility(s, new StringEventArgs("Unknown")); - }, ref unregisterEvents); - ApplicationController.Instance.MainView = this; } diff --git a/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs b/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs index ae6a15a77..b495a4cb2 100644 --- a/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs +++ b/MatterControlLib/SetupWizard/PrinterProfileHistoryPage.cs @@ -48,7 +48,11 @@ namespace MatterHackers.MatterControl.SetupWizard var profile = ProfileManager.Instance[printer.Settings.ID]; // Download the specified json profile - var printerSettings = await ApplicationController.GetPrinterProfileAsync(profile, profileToken); + PrinterSettings printerSettings = null; + if (Application.EnableNetworkTraffic) + { + await ApplicationController.GetPrinterProfileAsync(profile, profileToken); + } if (printerSettings != null) { // Persist downloaded profile diff --git a/Program.cs b/Program.cs index 0ea3ed60e..de0d7eea2 100644 --- a/Program.cs +++ b/Program.cs @@ -124,6 +124,7 @@ namespace MatterHackers.MatterControl Slicer.RunInProcess = config.GetValue("MatterControl:Slicer:Debug"); Application.EnableF5Collect = config.GetValue("MatterControl:Application:EnableF5Collect"); + Application.EnableNetworkTraffic = config.GetValue("MatterControl:Application:EnableNetworkTraffic", true); // Make sure we have the right working directory as we assume everything relative to the executable. Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 2b1622efb..4c3af4d68 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 2b1622efb7f9e4a2ad648f2f01e4575a31cc4422 +Subproject commit 4c3af4d68af4a00dfde8fb55b21e07833cc0b6fb