From 15d93aece014958c9097cced4888632e596973ad Mon Sep 17 00:00:00 2001 From: Evan Schoenberg Date: Thu, 17 Nov 2005 18:06:03 +0000 Subject: [PATCH] Save first. git-svn-id: svn://svn.adiumx.com/adium/branches/adium-0.8@14027 1c916fce-81e2-0310-a464-8ca513f45935 --- .../ESTextAndButtonsWindowController.m | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Frameworks/Adium Framework/ESTextAndButtonsWindowController.m b/Frameworks/Adium Framework/ESTextAndButtonsWindowController.m index ed39b344c..fd12c01db 100644 --- a/Frameworks/Adium Framework/ESTextAndButtonsWindowController.m +++ b/Frameworks/Adium Framework/ESTextAndButtonsWindowController.m @@ -43,6 +43,7 @@ * @param parentWindow Window on which to display as a sheet. Displayed as a normal window if nil. * @param inMessageHeader A plain NSString which will be displayed as a bolded header for the message. Hidden if nil. * @param inMessage The NSAttributedString which is the body of text for the window. + * @param inImage The NSImage to display; if nil, the default application icon will be shown * @param target The target to send the selector textAndButtonsWindowDidEnd:(NSWindow *)window returnCode:(AITextAndButtonsReturnCode)returnCode userInfo:(id)userInfo when the sheet ends. * * @see AITextAndButtonsReturnCode @@ -56,6 +57,7 @@ onWindow:(NSWindow *)parentWindow withMessageHeader:(NSString *)inMessageHeader andMessage:(NSAttributedString *)inMessage + image:(NSImage *)inImage target:(id)inTarget userInfo:(id)inUserInfo { @@ -86,6 +88,28 @@ return controller; } ++ (id)showTextAndButtonsWindowWithTitle:(NSString *)inTitle + defaultButton:(NSString *)inDefaultButton + alternateButton:(NSString *)inAlternateButton + otherButton:(NSString *)inOtherButton + onWindow:(NSWindow *)parentWindow + withMessageHeader:(NSString *)inMessageHeader + andMessage:(NSAttributedString *)inMessage + target:(id)inTarget + userInfo:(id)inUserInfo +{ + return [self showTextAndButtonsWindowWithTitle:inTitle + defaultButton:inDefaultButton + alternateButton:inAlternateButton + otherButton:inOtherButton + onWindow:parentWindow + withMessageHeader:inMessageHeader + andMessage:inMessage + image:nil + target:inTarget + userInfo:inUserInfo]; +} + /*! * @bref Initialize */ @@ -96,6 +120,7 @@ otherButton:(NSString *)inOtherButton withMessageHeader:(NSString *)inMessageHeader andMessage:(NSAttributedString *)inMessage + image:(NSImage *)inImage target:(id)inTarget userInfo:(id)inUserInfo { @@ -108,6 +133,8 @@ message = [inMessage retain]; target = [inTarget retain]; userInfo = [inUserInfo retain]; + image = [inImage retain]; + userClickedButton = NO; allowsCloseWithoutResponse = YES; } @@ -194,6 +221,11 @@ int distanceFromBottomOfMessageToButtons = 24; NSRect frame = [window frame]; + //Set the image if we have one + if (image) { + [imageView setImage:image]; + } + //Hide the toolbar and zoom buttons [[[self window] standardWindowButton:NSWindowToolbarButton] setFrame:NSMakeRect(0,0,0,0)]; [[[self window] standardWindowButton:NSWindowZoomButton] setFrame:NSMakeRect(0,0,0,0)]; @@ -370,7 +402,8 @@ [messageHeader release]; [message release]; [userInfo release]; - + [image release]; + [super dealloc]; } -- 2.11.4.GIT