Skip to content

Commit

Permalink
#16. Fixed an instance when file paths are wrongly emptied.
Browse files Browse the repository at this point in the history
  • Loading branch information
zionyx committed Jul 28, 2015
1 parent 02aa945 commit 778e689
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
16 changes: 12 additions & 4 deletions HudsonTrayTracker/UI/Controls/NotificationSettingsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ protected override void OnLoad(EventArgs e)
}

statusLabel.Text = HudsonTrayTrackerResources.ResourceManager.GetString("NotificationSettings_" + Status);
}

public void Initialize()
{
if (configurationService == null)
{
configurationService = (ConfigurationService)ContextRegistry.GetContext().GetObject("ConfigurationService");
}
SoundPath = configurationService.GetSoundPath(Status);
}

Expand All @@ -66,10 +74,10 @@ private void ChooseFile()
fileDialog.Filter = "Sound file (*.wav)|*.wav";

DialogResult res = fileDialog.ShowDialog();
if (res != DialogResult.OK)
return;

SetPath(fileDialog.FileName);
if (res == DialogResult.OK)
{
SetPath(fileDialog.FileName);
}
}

private void SetPath(string path)
Expand Down
8 changes: 8 additions & 0 deletions HudsonTrayTracker/UI/Controls/NotificationsSettingsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ protected override void OnLoad(EventArgs e)
enableSoundCheckBox_CheckedChanged(null, null);
}

public void InitializeValues()
{
notificationSettingsControl1.Initialize();
notificationSettingsControl2.Initialize();
notificationSettingsControl3.Initialize();
notificationSettingsControl4.Initialize();
}

public bool SoundNotificationsEnabled()
{
return enableSoundCheckBox.Checked;
Expand Down

0 comments on commit 778e689

Please sign in to comment.