Changed the suppression logic for welcome page

issue: MatterHackers/MCCentral#4647
Consider showing welcome screen until the user opts-out
This commit is contained in:
Lars Brubaker 2018-11-30 12:05:30 -08:00
parent 726b14f9c0
commit 5c4b9f92c2
7 changed files with 41 additions and 20 deletions

View file

@ -40,14 +40,16 @@ namespace MatterHackers.MatterControl
public class WelcomePage : DialogPage
{
public WelcomePage()
: base("Done".Localize())
{
this.WindowTitle = "MatterControl".Localize();
this.HeaderText = "Welcome to MatterControl".Localize();
this.HeaderText = "A Quick Tour of MatterControl".Localize();
var welcome = @"Thank you for installing MatterControl. We are excited to help you bring your ideas to life. This new version includes hundreds of improvements and new features.
var welcome = @"Thank you for installing MatterControl. We are excited to help bring your ideas to life. This new version includes hundreds of improvements and new features.
Feature Overview:
Features:
Simple Setup
Automatic Leveling
Built in 3D Design Tools
@ -55,7 +57,7 @@ Features:
SMS / Email Notifications
Enhanced 64 Bit support
Click 'Next' to for a quick tour of the interface";
Click 'Next' to continue the tour of the interface";
var textWidget = new WrappedTextWidget(welcome)
{
@ -66,7 +68,29 @@ Click 'Next' to for a quick tour of the interface";
contentRow.AddChild(textWidget);
var nextButton = new TextButton("Tour".Localize(), theme)
contentRow.AddChild(new VerticalSpacer());
var showWelcomPageCheckBox = new CheckBox("Don't remind me again".Localize())
{
TextColor = theme.TextColor,
Margin = new BorderDouble(top: 6, left: 6),
HAnchor = Agg.UI.HAnchor.Left,
Checked = ApplicationSettings.Instance.get(ApplicationSettingsKey.ShownWelcomeMessage) == "false"
};
showWelcomPageCheckBox.Click += (sender, e) =>
{
if (showWelcomPageCheckBox.Checked)
{
ApplicationSettings.Instance.set(ApplicationSettingsKey.ShownWelcomeMessage, "false");
}
else
{
ApplicationSettings.Instance.set(ApplicationSettingsKey.ShownWelcomeMessage, "true");
}
};
contentRow.AddChild(showWelcomPageCheckBox);
var nextButton = new TextButton("Next".Localize(), theme)
{
Name = "Next Button",
BackgroundColor = theme.MinimalShade
@ -83,12 +107,5 @@ Click 'Next' to for a quick tour of the interface";
this.AddPageAction(nextButton);
}
protected override void OnCancel(out bool abortCancel)
{
UserSettings.Instance.set(UserSettingsKey.ShownWelcomeMessage, "true");
base.OnCancel(out abortCancel);
}
}
}