Skip to content

Commit

Permalink
Trim the API key, App key, and email address inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoolls committed Dec 10, 2013
1 parent 201623c commit d232110
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
45 changes: 23 additions & 22 deletions MultiMiner.Win/SettingsForm.Designer.cs

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

19 changes: 11 additions & 8 deletions MultiMiner.Win/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public SettingsForm(ApplicationConfiguration applicationConfiguration, XgminerCo

private void saveButton_Click(object sender, EventArgs e)
{
CleanUpInput();

if (!ValidateInput())
return;

Expand All @@ -30,8 +32,17 @@ private void saveButton_Click(object sender, EventArgs e)
DialogResult = System.Windows.Forms.DialogResult.OK;
}

private void CleanUpInput()
{
//clean up input
emailAddressEdit.Text = emailAddressEdit.Text.Trim();
appKeyEdit.Text = appKeyEdit.Text.Trim();
apiKeyEdit.Text = apiKeyEdit.Text.Trim();
}

private bool ValidateInput()
{
//validate input
if (emailAddressEdit.Enabled && !String.IsNullOrEmpty(emailAddressEdit.Text) &&
!InputValidation.IsValidEmailAddress(emailAddressEdit.Text))
{
Expand Down Expand Up @@ -89,10 +100,6 @@ private void remoteMonitoringCheck_CheckedChanged(object sender, EventArgs e)
UpdateMobileMinerControls();
}

private void remoteCommandsCheck_CheckedChanged(object sender, EventArgs e)
{
}

private void UpdateMobileMinerControls()
{
emailAddressEdit.Enabled = remoteMonitoringCheck.Checked;
Expand All @@ -108,10 +115,6 @@ private void mobileMinerInfoLink_LinkClicked(object sender, LinkLabelLinkClicked
Process.Start("http://mobileminerapp.com/");
}

private void minerCombo_SelectedIndexChanged(object sender, EventArgs e)
{
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
AdvancedSettingsForm advancedSettingsForm = new AdvancedSettingsForm(minerConfiguration, applicationConfiguration);
Expand Down

0 comments on commit d232110

Please sign in to comment.