Skip to content

Commit

Permalink
only onboard on first startup
Browse files Browse the repository at this point in the history
  • Loading branch information
itisrazza committed Mar 23, 2021
1 parent f2c480c commit 407ce25
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 40 deletions.
77 changes: 39 additions & 38 deletions SuperSize/Forms/ConfigForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions SuperSize/Forms/ConfigForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,30 @@ private void customScriptRadio_CheckedChanged(object sender, EventArgs e)
builtinScriptChooser.Enabled = !useCustomScript;
SaveScript();
}

private void pictureBox1_DoubleClick(object sender, EventArgs e)
{
var response = MessageBox.Show(
this,
"What have you royally screwed up so much that you need to reset the program settings? Are you sure you want to do this?",
"Settings Reset",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button2);
if (response != DialogResult.Yes)
{
MessageBox.Show(
this,
"I'll let you off the hook for now...",
"Operation Cancelled");
return;
}

Properties.Settings.Default.Reset();
Properties.Settings.Default.Save();

MessageBox.Show("Please restart the application.");
Program.Exit();
}
}
}
9 changes: 7 additions & 2 deletions SuperSize/Forms/NotifyIconForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ private void notifyIcon_MouseClick(object sender, MouseEventArgs e)
private void NotifyIconForm_Shown(object sender, EventArgs e)
{
Hide();
new WelcomeForm().Show();

// if the user hasn't been onboarded, do that now
if (!Properties.Settings.Default.WasOnboarded)
{
new WelcomeForm().Show();
}
}

private void openConfigForm_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -96,7 +101,7 @@ private void sendFeedback_Click(object sender, EventArgs e)
procInfo.ArgumentList.Add("/c");
procInfo.ArgumentList.Add("start");
procInfo.ArgumentList.Add("https://github.com/thegreatrazz/SuperSize/issues/new");

Process.Start(procInfo);
}
}
Expand Down
1 change: 1 addition & 0 deletions SuperSize/Forms/WelcomeForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions SuperSize/Forms/WelcomeForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,13 @@ private void WelcomeForm_Load(object sender, EventArgs e)
{
FormBorderStyle = FormBorderStyle.FixedSingle;
}

private void WelcomeForm_FormClosed(object sender, FormClosedEventArgs e)
{
// don't onboard again
var settings = Properties.Settings.Default;
settings.WasOnboarded = true;
settings.Save();
}
}
}
12 changes: 12 additions & 0 deletions SuperSize/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions SuperSize/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
<Setting Name="WindowPreviewBorder" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">232, 17, 35</Value>
</Setting>
<Setting Name="WasOnboarded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 407ce25

Please sign in to comment.