From 7f4c83fd4bbb52e4d14ad055b70d385f19d02c99 Mon Sep 17 00:00:00 2001 From: james jones Date: Fri, 27 Jun 2014 10:31:40 -0700 Subject: [PATCH 1/2] no message --- ConfigurationPage/PrinterConfigurationPage.cs | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/ConfigurationPage/PrinterConfigurationPage.cs b/ConfigurationPage/PrinterConfigurationPage.cs index ab12e74e1..017c7970d 100644 --- a/ConfigurationPage/PrinterConfigurationPage.cs +++ b/ConfigurationPage/PrinterConfigurationPage.cs @@ -85,31 +85,34 @@ namespace MatterHackers.MatterControl mainLayoutContainer.VAnchor = Agg.UI.VAnchor.FitToChildren; mainLayoutContainer.Padding = new BorderDouble(3, 0, 3, 10); + // setup the terminal controls FlowLayoutWidget terminalControls = new FlowLayoutWidget(); terminalControls.HAnchor = Agg.UI.HAnchor.ParentLeftRight; terminalControls.Padding = new BorderDouble(right: 15); - - FlowLayoutWidget settingsControls = new FlowLayoutWidget(); - settingsControls.HAnchor = Agg.UI.HAnchor.ParentLeftRight; - - AddThemeControls(settingsControls); - AddLanguageControls(settingsControls); - - //FlowLayoutWidget releaseControls = new FlowLayoutWidget(); - //releaseControls.Margin = new BorderDouble (right: 10); - //releaseControls.HAnchor = Agg.UI.HAnchor.ParentLeftRight; - - AddTerminalControls(terminalControls); + mainLayoutContainer.AddChild(terminalControls); + + // add other elements on the same line as terminal controls AddEePromControls(terminalControls); AddReleaseOptions(terminalControls); - - mainLayoutContainer.AddChild(terminalControls); + + // put in print leveling controls AddPrintLevelingControls(mainLayoutContainer); + + // put in cloud monitor control AddCloudMonitorControls(mainLayoutContainer); - CreateEditNotificationConfiguration (mainLayoutContainer); - mainLayoutContainer.AddChild(settingsControls); - //mainLayoutContainer.AddChild(releaseControls); + + // put in the notification control (SMS, email) + CreateEditNotificationControls(mainLayoutContainer); + + // put in the theme and language controls + FlowLayoutWidget uiSettingsControls = new FlowLayoutWidget(); + uiSettingsControls.HAnchor = Agg.UI.HAnchor.ParentLeftRight; + AddThemeControls(uiSettingsControls); + AddLanguageControls(uiSettingsControls); + mainLayoutContainer.AddChild(uiSettingsControls); + + //mainLayoutContainer.AddChild(releaseControls); AddChild(mainLayoutContainer); @@ -422,7 +425,7 @@ namespace MatterHackers.MatterControl } TextWidget notificationSettingsLabel; - private void CreateEditNotificationConfiguration(FlowLayoutWidget controlsTopToBottom) + private void CreateEditNotificationControls(FlowLayoutWidget controlsTopToBottom) { DisableableWidget container = new DisableableWidget(); @@ -469,9 +472,7 @@ namespace MatterHackers.MatterControl buttonRow.AddChild (configureNotificationSettingsButton); notificationSettingsContainer.AddChild (buttonRow); controlsTopToBottom.AddChild (notificationSettingsContainer); - AddChild(controlsTopToBottom); } - } string noEepromMappingMessage = "Oops! There is no eeprom mapping for your printer's firmware.".Localize(); @@ -587,7 +588,9 @@ namespace MatterHackers.MatterControl runPrintLevelingButton.VAnchor = VAnchor.ParentCenter; runPrintLevelingButton.Click += (sender, e) => { + UiThread.RunOnIdle( (state) => { OpenPrintLevelWizard(); + }); }; Agg.Image.ImageBuffer levelingImage = new Agg.Image.ImageBuffer(); From 6a84783075deb3920837da6338e27786a9277c2b Mon Sep 17 00:00:00 2001 From: james jones Date: Fri, 27 Jun 2014 10:50:17 -0700 Subject: [PATCH 2/2] made the print leveling editing window open on the ui thread. --- ConfigurationPage/PrinterConfigurationPage.cs | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/ConfigurationPage/PrinterConfigurationPage.cs b/ConfigurationPage/PrinterConfigurationPage.cs index 017c7970d..68ff4df39 100644 --- a/ConfigurationPage/PrinterConfigurationPage.cs +++ b/ConfigurationPage/PrinterConfigurationPage.cs @@ -557,15 +557,21 @@ namespace MatterHackers.MatterControl GroupBox printLevelingControlsContainer = new GroupBox(textImageButtonFactory.GenerateGroupBoxLabelWithEdit(LocalizedString.Get("Automatic Calibration"), out editButton)); editButton.Click += (sender, e) => { - if (editLevelingSettingsWindow == null) + UiThread.RunOnIdle((state) => { - editLevelingSettingsWindow = new EditLevelingSettingsWindow(); - editLevelingSettingsWindow.Closed += (popupWindowSender, popupWindowSenderE) => { editLevelingSettingsWindow = null; }; - } - else - { - editLevelingSettingsWindow.BringToFront(); - } + if (editLevelingSettingsWindow == null) + { + editLevelingSettingsWindow = new EditLevelingSettingsWindow(); + editLevelingSettingsWindow.Closed += (sender2, e2) => + { + editLevelingSettingsWindow = null; + }; + } + else + { + editLevelingSettingsWindow.BringToFront(); + } + }); }; printLevelingControlsContainer.Margin = new BorderDouble(0); @@ -588,9 +594,10 @@ namespace MatterHackers.MatterControl runPrintLevelingButton.VAnchor = VAnchor.ParentCenter; runPrintLevelingButton.Click += (sender, e) => { - UiThread.RunOnIdle( (state) => { - OpenPrintLevelWizard(); - }); + UiThread.RunOnIdle((state) => + { + OpenPrintLevelWizard(); + }); }; Agg.Image.ImageBuffer levelingImage = new Agg.Image.ImageBuffer();