From 1a5efe192582eb251614c178f9b3ad842634bf3d Mon Sep 17 00:00:00 2001 From: Tim Young Date: Sun, 1 Nov 2015 08:25:20 -0500 Subject: [PATCH] Make sounds when save happens & when save is canceled --- EduNetworkBuilder/NB.cs | 11 ++++++++++- EduNetworkBuilder/NetworkBuilder.cs | 9 ++++++++- EduNetworkBuilder/Resources/languages/edustrings.resx | 4 ++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/EduNetworkBuilder/NB.cs b/EduNetworkBuilder/NB.cs index f186a36..87a596b 100644 --- a/EduNetworkBuilder/NB.cs +++ b/EduNetworkBuilder/NB.cs @@ -37,7 +37,7 @@ namespace EduNetworkBuilder public enum IPAddressType { ip, gw, route, ip_only } public enum nb_direction { none, to_src, to_dst } public enum GeneralComponentType { none, link, device } - public enum NBSoundType { none, success } + public enum NBSoundType { none, success, saved_ok, saved_failed } public enum RTFWindowContents { help, about, release_notes } public enum NetTestType { NeedsLocalIPTo, NeedsDefaultGW, NeedsLinkToDevice, NeedsRouteToNet, SuccessfullyPings, SuccessfullyArps, SuccessfullyDHCPs, HelpRequest, ReadContextHelp, FailedPing, @@ -434,6 +434,15 @@ namespace EduNetworkBuilder sndClick = new SoundPlayer(Properties.Resources.wavBellDing); sndClick.Play(); break; + case NBSoundType.saved_failed: + sndClick = new SoundPlayer(Properties.Resources.noBeep); + sndClick.Play(); + break; + case NBSoundType.saved_ok: + sndClick = new SoundPlayer(Properties.Resources.click); + sndClick.Play(); + break; + } } diff --git a/EduNetworkBuilder/NetworkBuilder.cs b/EduNetworkBuilder/NetworkBuilder.cs index 827639b..ea7c14f 100644 --- a/EduNetworkBuilder/NetworkBuilder.cs +++ b/EduNetworkBuilder/NetworkBuilder.cs @@ -930,6 +930,7 @@ namespace EduNetworkBuilder { //Just save over it myNetwork.Save(myNetwork.NetworkFilename); + NB.PlaySound(NBSoundType.saved_ok); } else { @@ -945,9 +946,15 @@ namespace EduNetworkBuilder mydialog.InitialDirectory = initialfolder; DialogResult result = mydialog.ShowDialog(); - if (result == System.Windows.Forms.DialogResult.Cancel) return; + if (result == System.Windows.Forms.DialogResult.Cancel) + { + NB.PlaySound(NBSoundType.saved_failed); + lblStatus.Text = NB.Translate("_Save_Canceled"); + return; + } LastPath = mydialog.FileName; myNetwork.Save(mydialog.FileName); + NB.PlaySound(NBSoundType.saved_ok); } lblStatus.Text = NB.Translate("_Saved"); } diff --git a/EduNetworkBuilder/Resources/languages/edustrings.resx b/EduNetworkBuilder/Resources/languages/edustrings.resx index 811b135..d0df418 100644 --- a/EduNetworkBuilder/Resources/languages/edustrings.resx +++ b/EduNetworkBuilder/Resources/languages/edustrings.resx @@ -731,4 +731,8 @@ The wireless signal was too weak. Packet dropped. NetworkLink WirelessDropped = The wireless signal was too weak. Packet dropped. + + Saved + String used when we have successfully saved the network. + \ No newline at end of file