switch-ify more code

This commit is contained in:
Mitchell Livingston 2007-10-08 04:28:15 +00:00
parent fc432f1c29
commit ab154c3971
1 changed files with 17 additions and 16 deletions

View File

@ -244,21 +244,22 @@
if (change = (fNatStatus != stat->natTraversalStatus))
{
fNatStatus = stat->natTraversalStatus;
if (fNatStatus == TR_NAT_TRAVERSAL_MAPPED)
switch (fNatStatus)
{
case TR_NAT_TRAVERSAL_MAPPED:
[fNatStatusField setStringValue: NSLocalizedString(@"Port successfully mapped",
"Preferences -> Advanced -> port map status")];
[fNatStatusImage setImage: [NSImage imageNamed: @"GreenDot.tiff"]];
}
else if (fNatStatus == TR_NAT_TRAVERSAL_NOTFOUND || fNatStatus == TR_NAT_TRAVERSAL_ERROR)
{
break;
case TR_NAT_TRAVERSAL_NOTFOUND:
case TR_NAT_TRAVERSAL_ERROR:
[fNatStatusField setStringValue: NSLocalizedString(@"Error mapping port",
"Preferences -> Advanced -> port map status")];
[fNatStatusImage setImage: [NSImage imageNamed: @"RedDot.tiff"]];
}
else
{
break;
default:
[fNatStatusField setStringValue: @""];
[fNatStatusImage setImage: nil];
}