Commits

Anonymous committed 158a620

Added identifier field for notifications coming from BeepHammer, allowing for coalescing testing

Comments (0)

Files changed (5)

 	IBOutlet NSTextField	*notificationDescription;	// The long description
 	IBOutlet NSImageView	*notificationImage;			// The associated image
 	IBOutlet NSTextField	*notificationTitle;			// The title of this notification
+	IBOutlet NSTextField	*notificationIdentifier;	// The identifier of this notification
 	IBOutlet NSButton		*addEditButton;				// The OK button for the panel
 	NSString *addButtonTitle, *editButtonTitle, *mainEditButtonTitle;
 	
 	[notificationSticky      setState:NSOffState];
 	[notificationPriority    selectItemAtIndex:2]; //middle item: 'Normal' priority
 	[notificationImage       setImage:nil];
-	static NSString *empty = @"";
-	[notificationDescription setStringValue:empty];
-	[notificationTitle       setStringValue:empty];
+	[notificationDescription setStringValue:@""];
+	[notificationTitle       setStringValue:@""];
+	[notificationIdentifier  setStringValue:@""];
 
 	[notificationPanel makeFirstResponder:[notificationPanel initialFirstResponder]];
 	[addEditButton setTitle:addButtonTitle];
 		[notificationImage       setImage:      [dict objectForKey:GROWL_NOTIFICATION_ICON]];
 		[notificationDescription setStringValue:[dict objectForKey:GROWL_NOTIFICATION_DESCRIPTION]];
 		[notificationTitle       setStringValue:[dict objectForKey:GROWL_NOTIFICATION_TITLE]];
+		[notificationIdentifier  setStringValue:([dict objectForKey:GROWL_NOTIFICATION_IDENTIFIER] ?
+												 [dict objectForKey:GROWL_NOTIFICATION_IDENTIFIER] :
+												 @"")];
 
 		[notificationPanel makeFirstResponder:[notificationPanel initialFirstResponder]];
 		[addEditButton setTitle:editButtonTitle];
 											   iconData:[note objectForKey:GROWL_NOTIFICATION_ICON]
 											   priority:[[note objectForKey:GROWL_NOTIFICATION_PRIORITY] intValue]
 											   isSticky:[[note objectForKey:GROWL_NOTIFICATION_STICKY] boolValue]
-										   clickContext:nil];							
+										   clickContext:nil
+											 identifier:([[note objectForKey:GROWL_NOTIFICATION_IDENTIFIER] length] ?
+														 [note objectForKey:GROWL_NOTIFICATION_IDENTIFIER] :
+														 nil)];	
 				
 				batchCount--;
 			}
 												   iconData:[note objectForKey:GROWL_NOTIFICATION_ICON]
 												   priority:[[note objectForKey:GROWL_NOTIFICATION_PRIORITY] intValue]
 												   isSticky:[[note objectForKey:GROWL_NOTIFICATION_STICKY] boolValue]
-											   clickContext:nil];					
+											   clickContext:nil
+												 identifier:([[note objectForKey:GROWL_NOTIFICATION_IDENTIFIER] length] ?
+															 [note objectForKey:GROWL_NOTIFICATION_IDENTIFIER] :
+															 nil)];
 				}
 				
 				batchCount--;
 		NSImage  *image        = [notificationImage image];
 		NSString *title        = [notificationTitle       stringValue];
 		NSString *desc         = [notificationDescription stringValue];
+		NSString *identifier   = [notificationIdentifier  stringValue];
 
 		NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
 			title,         GROWL_NOTIFICATION_NAME,
 			title,         GROWL_NOTIFICATION_TITLE,
 			desc,          GROWL_NOTIFICATION_DESCRIPTION,
+			identifier,    GROWL_NOTIFICATION_IDENTIFIER,
 			priority,      GROWL_NOTIFICATION_PRIORITY,
 			defaultValue,  GROWL_NOTIFICATION_DEFAULT,
 			stickyValue,   GROWL_NOTIFICATION_STICKY,
-			image,         GROWL_NOTIFICATION_ICON,
+			image,         GROWL_NOTIFICATION_ICON, /* May be nil, ending the dict */
 			nil];
 
 		NSNumber *indexNum = contextInfo;

English.lproj/BeepHammer.nib/classes.nib

                 cancelNotification = id; 
                 clearImage = id; 
                 editNotification = id; 
-                registerBeep = id; 
                 removeAllNotifications = id; 
                 removeNotification = id; 
                 sendNotification = id; 
                 mainWindow = NSWindow; 
                 notificationDefault = NSButton; 
                 notificationDescription = NSTextField; 
+                notificationIdentifier = NSTextField; 
                 notificationImage = NSImageView; 
                 notificationPanel = NSPanel; 
                 notificationPriority = NSPopUpButton; 

English.lproj/BeepHammer.nib/info.nib

 	<key>IBEditorPositions</key>
 	<dict>
 		<key>29</key>
-		<string>41 342 397 44 0 0 1680 1028 </string>
+		<string>33 290 397 44 0 0 1440 878 </string>
 	</dict>
 	<key>IBFramework Version</key>
 	<string>446.1</string>
+	<key>IBGroupedObjects</key>
+	<dict>
+		<key>0</key>
+		<array>
+			<string>266</string>
+			<string>263</string>
+		</array>
+		<key>1</key>
+		<array>
+			<string>269</string>
+			<string>268</string>
+		</array>
+		<key>2</key>
+		<array>
+			<string>403</string>
+			<string>402</string>
+		</array>
+	</dict>
+	<key>IBLastGroupID</key>
+	<string>3</string>
 	<key>IBOldestOS</key>
 	<integer>2</integer>
 	<key>IBOpenObjects</key>
 	<array>
+		<integer>29</integer>
+		<integer>255</integer>
 		<integer>365</integer>
 		<integer>21</integer>
-		<integer>255</integer>
-		<integer>29</integer>
 	</array>
 	<key>IBSystem Version</key>
-	<string>8L2127</string>
+	<string>8P2137</string>
 </dict>
 </plist>

English.lproj/BeepHammer.nib/keyedobjects.nib

Binary file modified.