From 93a17d2b6caf22a41472495ec7e662b17ebfdf07 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 11 Apr 2016 08:25:40 -0700 Subject: [PATCH] Guard LoadHistoryItems with WidgetHasBeenClosed - Observed exception on shutdown where PrintHistory was reloaded during shutdown after the db had been closed. Skip load if Closing/closed - Spelling, whitespace, use .Localize() --- ApplicationView/MenuRow/MenuOptionSettings.cs | 16 ++++++++-------- History/PrintHistoryDataView.cs | 5 ++++- PartPreviewWindow/View3D/View3DWidget.cs | 2 +- .../SlicePresetDetailWidget.cs | 2 +- Submodules/agg-sharp | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ApplicationView/MenuRow/MenuOptionSettings.cs b/ApplicationView/MenuRow/MenuOptionSettings.cs index 1af187a5f..2c39b2180 100644 --- a/ApplicationView/MenuRow/MenuOptionSettings.cs +++ b/ApplicationView/MenuRow/MenuOptionSettings.cs @@ -25,14 +25,14 @@ namespace MatterHackers.MatterControl override protected TupleList> GetMenuItems() { return new TupleList> - { - {LocalizedString.Get("Settings"), openPrintingPannel_Click}, - {LocalizedString.Get("Controls"), openControlsPannel_Click}, - {LocalizedString.Get("Terminal"), openTermanialPannel_Click}, - }; + { + {"Settings".Localize(), openPrintingPanel_Click}, + {"Controls".Localize(), openControlsPanel_Click}, + {"Terminal".Localize(), openTerminalPanel_Click}, + }; } - private bool openPrintingPannel_Click() + private bool openPrintingPanel_Click() { UiThread.RunOnIdle(() => { @@ -44,7 +44,7 @@ namespace MatterHackers.MatterControl return true; } - private bool openControlsPannel_Click() + private bool openControlsPanel_Click() { UiThread.RunOnIdle(() => { @@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl return true; } - private bool openTermanialPannel_Click() + private bool openTerminalPanel_Click() { UiThread.RunOnIdle(TerminalWindow.Show); return true; diff --git a/History/PrintHistoryDataView.cs b/History/PrintHistoryDataView.cs index f01a77489..589cb7133 100644 --- a/History/PrintHistoryDataView.cs +++ b/History/PrintHistoryDataView.cs @@ -146,7 +146,10 @@ namespace MatterHackers.MatterControl.PrintHistory { UiThread.RunOnIdle(() => { - LoadHistoryItems(Count); + if(!this.WidgetHasBeenClosed) + { + LoadHistoryItems(Count); + } }); } diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index 87c970652..a06182550 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -170,7 +170,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow editToolBar.VAnchor |= Agg.UI.VAnchor.ParentCenter; processingProgressControl.Visible = false; - // If the window is embeded (in the center pannel) and there is no item loaded then don't show the add button + // If the window is embedded (in the center panel) and there is no item loaded then don't show the add button enterEditButtonsContainer = new FlowLayoutWidget(); { Button addButton = textImageButtonFactory.Generate("Insert".Localize(), "icon_insert_32x32.png"); diff --git a/SlicerConfiguration/SlicePresetsWindow/SlicePresetDetailWidget.cs b/SlicerConfiguration/SlicePresetsWindow/SlicePresetDetailWidget.cs index 7de4a1b73..cdd5c1d5b 100644 --- a/SlicerConfiguration/SlicePresetsWindow/SlicePresetDetailWidget.cs +++ b/SlicerConfiguration/SlicePresetsWindow/SlicePresetDetailWidget.cs @@ -924,7 +924,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration windowController.functionToCallOnSave(this, null); windowController.ChangeToSlicePresetList(); ActiveSliceSettings.Instance.LoadAllSettings(); - // Dissabled this as the pannel is already reloaded from LoadAllSettings LBB 2015 01 03. + // Disabled this as the panel is already reloaded from LoadAllSettings LBB 2015 01 03. //ApplicationController.Instance.ReloadAdvancedControlsPanel(); } }); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 7378b394c..f7775a5a6 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 7378b394c4f6e3071fe7c12458fc08646df22bd0 +Subproject commit f7775a5a669e5bbaaf4b2a2510fd730320b42b54