Make sounds when save happens & when save is canceled

This commit is contained in:
Tim Young 2015-11-01 08:25:20 -05:00
parent 148e285234
commit 1a5efe1925
3 changed files with 22 additions and 2 deletions

View File

@ -37,7 +37,7 @@ namespace EduNetworkBuilder
public enum IPAddressType { ip, gw, route, ip_only } public enum IPAddressType { ip, gw, route, ip_only }
public enum nb_direction { none, to_src, to_dst } public enum nb_direction { none, to_src, to_dst }
public enum GeneralComponentType { none, link, device } 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 RTFWindowContents { help, about, release_notes }
public enum NetTestType { NeedsLocalIPTo, NeedsDefaultGW, NeedsLinkToDevice, NeedsRouteToNet, public enum NetTestType { NeedsLocalIPTo, NeedsDefaultGW, NeedsLinkToDevice, NeedsRouteToNet,
SuccessfullyPings, SuccessfullyArps, SuccessfullyDHCPs, HelpRequest, ReadContextHelp, FailedPing, SuccessfullyPings, SuccessfullyArps, SuccessfullyDHCPs, HelpRequest, ReadContextHelp, FailedPing,
@ -434,6 +434,15 @@ namespace EduNetworkBuilder
sndClick = new SoundPlayer(Properties.Resources.wavBellDing); sndClick = new SoundPlayer(Properties.Resources.wavBellDing);
sndClick.Play(); sndClick.Play();
break; 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;
} }
} }

View File

@ -930,6 +930,7 @@ namespace EduNetworkBuilder
{ {
//Just save over it //Just save over it
myNetwork.Save(myNetwork.NetworkFilename); myNetwork.Save(myNetwork.NetworkFilename);
NB.PlaySound(NBSoundType.saved_ok);
} }
else else
{ {
@ -945,9 +946,15 @@ namespace EduNetworkBuilder
mydialog.InitialDirectory = initialfolder; mydialog.InitialDirectory = initialfolder;
DialogResult result = mydialog.ShowDialog(); 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; LastPath = mydialog.FileName;
myNetwork.Save(mydialog.FileName); myNetwork.Save(mydialog.FileName);
NB.PlaySound(NBSoundType.saved_ok);
} }
lblStatus.Text = NB.Translate("_Saved"); lblStatus.Text = NB.Translate("_Saved");
} }

View File

@ -731,4 +731,8 @@
<value>The wireless signal was too weak. Packet dropped.</value> <value>The wireless signal was too weak. Packet dropped.</value>
<comment>NetworkLink WirelessDropped = The wireless signal was too weak. Packet dropped.</comment> <comment>NetworkLink WirelessDropped = The wireless signal was too weak. Packet dropped.</comment>
</data> </data>
<data name="_Save_Canceled" xml:space="preserve">
<value>Saved</value>
<comment>String used when we have successfully saved the network.</comment>
</data>
</root> </root>