Fixed a bug whereby notifications without a description would not appear, as well... v1.0
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Mon, 2 Mar 2009 07:31:57 +0000 (02:31 -0500)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Mon, 2 Mar 2009 07:31:57 +0000 (02:31 -0500)
GrowlITTSWController.h
GrowlITTSWController.m
GrowlITTSWDisplay.m

index 0d6b6b1..345af9b 100644 (file)
@@ -18,6 +18,6 @@
        int _wrapColumns;
 }
 
-- (void)showWindowWithTitle:(NSString *)title text:(NSString *)text image:(NSImage *)image;
+- (void)showWindowWithTitle:(NSString *)title desc:(NSString *)desc image:(NSImage *)image;
 
 @end
index 1cd4265..5503ee8 100644 (file)
        }
 }
 
-- (void)showWindowWithTitle:(NSString *)title text:(NSString *)text image:(NSImage *)image {
-       if (text && ![text isEqualToString:@""] && ![text isEqualToString:@"\n"]) {
-               text = [title stringByAppendingFormat:@"\n%@", text];
+- (void)showWindowWithTitle:(NSString *)title desc:(NSString *)desc image:(NSImage *)image {
+       NSString *text = title;
+       
+       if (desc && ![desc isEqualToString:@""] && ![desc isEqualToString:@"\n"]) {
+               text = [text stringByAppendingFormat:@"\n%@", desc];
        }
        
        NSSize newSize;
        }
        
        //trim trailing whitespace
-       text = [text stringByReplacingOccurrencesOfRegex:@"[\\s\\r\\n]+$" withString:@""];
+       text = [text stringByReplacingOccurrencesOfRegex:@"\\s+$" withString:@""];
        
        NSArray *gothicChars = [NSArray arrayWithObjects:[NSString stringWithUTF8String:"☆"], [NSString stringWithUTF8String:"★"], nil];
        NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:text];
index ac9a647..d43a5b5 100644 (file)
@@ -31,7 +31,7 @@
        NSString *title = [dict objectForKey:GROWL_NOTIFICATION_TITLE];
        NSString *desc = [dict objectForKey:GROWL_NOTIFICATION_DESCRIPTION];
        NSImage *image = [dict objectForKey:GROWL_NOTIFICATION_ICON];
-       [[GrowlITTSWController sharedController] showWindowWithTitle:title text:desc image:image];
+       [[GrowlITTSWController sharedController] showWindowWithTitle:title desc:desc image:image];
 }
 
 @end