diff --git a/atemOSC/ConnectionView.mm b/atemOSC/ConnectionView.mm index 478e16e..cce106d 100644 --- a/atemOSC/ConnectionView.mm +++ b/atemOSC/ConnectionView.mm @@ -185,6 +185,19 @@ - (void)controlTextDidEndEditing:(NSNotification *)notification else if (textField == nicknameTextField) { + AppDelegate* appDel = (AppDelegate *) [[NSApplication sharedApplication] delegate]; + for (Switcher *s : [appDel switchers]) + { + if (s.nickname != nil && [textField stringValue].length > 0 && [s.nickname isEqualToString: [textField stringValue]]) + { + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:@"Duplicate Nickname"]; + [alert setInformativeText:@"Please assign a unique nickname to each switcher"]; + [alert beginSheetModalForWindow:[[NSApplication sharedApplication] mainWindow] completionHandler:nil]; + [textField setStringValue:switcher.nickname]; + return; + } + } [switcher setNickname: [textField stringValue]]; [[window addressesView] loadFromSwitcher:[self switcher]]; } diff --git a/atemOSC/MainWindow.xib b/atemOSC/MainWindow.xib index 0cec97c..5c6dbe1 100644 --- a/atemOSC/MainWindow.xib +++ b/atemOSC/MainWindow.xib @@ -31,21 +31,21 @@ - + - + - + - + - + @@ -233,21 +233,21 @@ - + - + - + - + @@ -258,7 +258,7 @@ - + @@ -272,7 +272,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -313,15 +313,15 @@ - - + + - + @@ -329,7 +329,7 @@ - + @@ -337,7 +337,7 @@ - + @@ -351,7 +351,7 @@ - + @@ -359,7 +359,7 @@ - + @@ -377,7 +377,7 @@ - + Feedback messages are OSC messages that reflect the current state of the switcher. They are sent when any value on the switcher is changed by atemOSC or any other application, such as ATEM Software Control. @@ -386,7 +386,7 @@