diff --git a/ApplicationView/MenuRow/ApplicationMenuRow.cs b/ApplicationView/MenuRow/ApplicationMenuRow.cs index 76f443821..635c7b166 100644 --- a/ApplicationView/MenuRow/ApplicationMenuRow.cs +++ b/ApplicationView/MenuRow/ApplicationMenuRow.cs @@ -38,9 +38,10 @@ namespace MatterHackers.MatterControl public class ApplicationMenuRow : FlowLayoutWidget { private static FlowLayoutWidget rightElement; - private event EventHandler unregisterEvents; LinkButtonFactory linkButtonFactory = new LinkButtonFactory(); + public static bool AlwaysShowUpdateStatus { get; set; } + GuiWidget popUpAboutPage; public ApplicationMenuRow() @@ -60,11 +61,6 @@ namespace MatterHackers.MatterControl MenuOptionFile menuOptionFile = new MenuOptionFile(); this.AddChild(menuOptionFile); -#if false - // put in the view menu - MenuOptionView menuOptionView = new MenuOptionView(); - this.AddChild(menuOptionView); -#endif MenuOptionSettings menuOptionSettings = new MenuOptionSettings(); this.AddChild(menuOptionSettings); @@ -109,6 +105,26 @@ namespace MatterHackers.MatterControl } } + public delegate void AddRightElementDelegate(GuiWidget iconContainer); + + public static event AddRightElementDelegate AddRightElement + { + add + { + privateAddRightElement += value; + // and call it right away + value(rightElement); + } + + remove + { + privateAddRightElement -= value; + } + } + + private static event AddRightElementDelegate privateAddRightElement; + + private event EventHandler unregisterEvents; public override void OnClosed(EventArgs e) { if (unregisterEvents != null) @@ -158,32 +174,41 @@ namespace MatterHackers.MatterControl break; case UpdateControlData.UpdateStatusStates.UpToDate: + if (AlwaysShowUpdateStatus) + { + popUpAboutPage.RemoveAllChildren(); + TextWidget updateStatusMessage = new TextWidget("Up to Date".Localize(), textColor: ActiveTheme.Instance.PrimaryAccentColor, pointSize: linkButtonFactory.fontSize); + updateStatusMessage.VAnchor = VAnchor.ParentCenter; + popUpAboutPage.AddChild(updateStatusMessage); + popUpAboutPage.Visible = true; + + UiThread.RunOnIdle((state) => popUpAboutPage.Visible = false, 3); + AlwaysShowUpdateStatus = false; + } + else + { + popUpAboutPage.Visible = false; + } + break; + case UpdateControlData.UpdateStatusStates.CheckingForUpdate: - popUpAboutPage.Visible = false; + if (AlwaysShowUpdateStatus) + { + popUpAboutPage.RemoveAllChildren(); + TextWidget updateStatusMessage = new TextWidget("Checking For Update".Localize(), textColor: ActiveTheme.Instance.PrimaryAccentColor, pointSize: linkButtonFactory.fontSize); + updateStatusMessage.VAnchor = VAnchor.ParentCenter; + popUpAboutPage.AddChild(updateStatusMessage); + popUpAboutPage.Visible = true; + } + else + { + popUpAboutPage.Visible = false; + } break; default: throw new NotImplementedException(); } } - - public delegate void AddRightElementDelegate(GuiWidget iconContainer); - - private static event AddRightElementDelegate privateAddRightElement; - - public static event AddRightElementDelegate AddRightElement - { - add - { - privateAddRightElement += value; - // and call it right away - value(rightElement); - } - - remove - { - privateAddRightElement -= value; - } - } } } \ No newline at end of file diff --git a/ApplicationView/MenuRow/MenuOptionHelp.cs b/ApplicationView/MenuRow/MenuOptionHelp.cs index b902abc56..2ecaba69d 100644 --- a/ApplicationView/MenuRow/MenuOptionHelp.cs +++ b/ApplicationView/MenuRow/MenuOptionHelp.cs @@ -20,8 +20,11 @@ namespace MatterHackers.MatterControl { {LocalizedString.Get("Getting Started"), gettingStarted_Click}, {LocalizedString.Get("View Help"), help_Click}, - {LocalizedString.Get("Report a Bug"), bug_Click}, {LocalizedString.Get("Release Notes"), notes_Click}, + {LocalizedString.Get("------------------------"), nothing_Click}, + {LocalizedString.Get("Report a Bug"), bug_Click}, + {LocalizedString.Get("Check For Update"), checkForUpdate_Click}, + {LocalizedString.Get("------------------------"), nothing_Click}, {LocalizedString.Get("About MatterControl"), about_Click}, }; } @@ -44,6 +47,16 @@ namespace MatterHackers.MatterControl return true; } + private bool checkForUpdate_Click() + { + UiThread.RunOnIdle((state) => + { + ApplicationMenuRow.AlwaysShowUpdateStatus = true; + UpdateControlData.Instance.CheckForUpdateUserRequested(); + }); + return true; + } + private bool about_Click() { UiThread.RunOnIdle((state) => @@ -53,6 +66,11 @@ namespace MatterHackers.MatterControl return true; } + private bool nothing_Click() + { + return true; + } + private bool notes_Click() { UiThread.RunOnIdle((state) => diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index ebd6d9e33..6a3f8a629 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -3259,3 +3259,9 @@ Translated:solid_shell English:GCode file too big to preview ({0}). Translated:GCode file too big to preview ({0}). +English:Up to Date +Translated:Up to Date + +English:Checking For Update +Translated:Checking For Update +