adium 5057:68f49c9d6bfb: Modernize AIImageButton.

commits at adium.im commits at adium.im
Wed Sep 12 12:21:21 UTC 2012


details:	http://hg.adium.im/adium/rev/68f49c9d6bfb
revision:	5057:68f49c9d6bfb
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Wed Sep 12 14:19:34 2012 +0200

Modernize AIImageButton.
Subject: adium 5058:1b3f8d0c1663: Rework AILogByAccountWindowController and AIURLHandlerWindowController to be independent window controllers.

details:	http://hg.adium.im/adium/rev/1b3f8d0c1663
revision:	5058:1b3f8d0c1663
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Wed Sep 12 14:21:00 2012 +0200

Rework AILogByAccountWindowController and AIURLHandlerWindowController to be independent window controllers.

diffs (117 lines):

diff -r 512cb1d5bcd7 -r 1b3f8d0c1663 Frameworks/AIUtilities Framework/Source/AIImageButton.h
--- a/Frameworks/AIUtilities Framework/Source/AIImageButton.h	Wed Sep 12 13:47:11 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageButton.h	Wed Sep 12 14:21:00 2012 +0200
@@ -31,5 +31,6 @@
 }
 
 @property (assign) CGFloat cornerRadius;
+ at property (strong, nonatomic) AIFloater *imageFloater;
 
 @end
diff -r 512cb1d5bcd7 -r 1b3f8d0c1663 Frameworks/AIUtilities Framework/Source/AIImageButton.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageButton.m	Wed Sep 12 13:47:11 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageButton.m	Wed Sep 12 14:21:00 2012 +0200
@@ -23,22 +23,13 @@
 
 @implementation AIImageButton
 
- at synthesize cornerRadius;
-
-- (id)initWithFrame:(NSRect)frame
-{
-	if ((self = [super initWithFrame:frame])) {
-		imageFloater = nil;
-	}
-
-	return self;
-}
+ at synthesize cornerRadius, imageFloater;
 
 - (id)copyWithZone:(NSZone *)zone
 {
 	AIImageButton *newButton = [super copyWithZone:zone];
-	newButton->imageFloater = imageFloater;
-	[newButton setCornerRadius:[self cornerRadius]];
+	newButton.imageFloater = imageFloater;
+	newButton.cornerRadius = self.cornerRadius;
 
 	return newButton;
 }
diff -r 512cb1d5bcd7 -r 1b3f8d0c1663 Plugins/General Preferences/AILogByAccountWindowController.h
--- a/Plugins/General Preferences/AILogByAccountWindowController.h	Wed Sep 12 13:47:11 2012 +0200
+++ b/Plugins/General Preferences/AILogByAccountWindowController.h	Wed Sep 12 14:21:00 2012 +0200
@@ -14,7 +14,9 @@
  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
- at interface AILogByAccountWindowController : NSWindowController {
+#import <Adium/AIWindowController.h>
+
+ at interface AILogByAccountWindowController : AIWindowController {
 	NSArray *accounts;
 }
 
diff -r 512cb1d5bcd7 -r 1b3f8d0c1663 Plugins/General Preferences/AIMessagePreferences.m
--- a/Plugins/General Preferences/AIMessagePreferences.m	Wed Sep 12 13:47:11 2012 +0200
+++ b/Plugins/General Preferences/AIMessagePreferences.m	Wed Sep 12 14:21:00 2012 +0200
@@ -273,19 +273,11 @@
 										group:@"Message Context Display"];
 }
 
-- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
-{
-	[sheet orderOut:nil];
-}
 - (IBAction)configureLogCertainAccounts:(id)sender
 {
 	AILogByAccountWindowController *windowController = [[AILogByAccountWindowController alloc] initWithWindowNibName:@"AILogByAccountWindow"];
 	
-	[NSApp beginSheet:windowController.window
-	   modalForWindow:self.view.window
-		modalDelegate:self
-	   didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
-		  contextInfo:nil];
+	[windowController showOnWindow:self.view.window];
 }
 
 @end
diff -r 512cb1d5bcd7 -r 1b3f8d0c1663 Plugins/General Preferences/ESGeneralPreferences.m
--- a/Plugins/General Preferences/ESGeneralPreferences.m	Wed Sep 12 13:47:11 2012 +0200
+++ b/Plugins/General Preferences/ESGeneralPreferences.m	Wed Sep 12 14:21:00 2012 +0200
@@ -158,20 +158,11 @@
 	[[AIURLHandlerPlugin sharedAIURLHandlerPlugin] setAdiumAsDefault];
 }
 
-- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
-{
-	[sheet orderOut:nil];
-}
-
 - (IBAction)customizeDefaultApp:(id)sender
 {
 	AIURLHandlerWindowController *windowController = [[AIURLHandlerWindowController alloc] initWithWindowNibName:@"AIURLHandlerPreferences"];
 	
-	[NSApp beginSheet:windowController.window
-	   modalForWindow:self.view.window
-		modalDelegate:self
-	   didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
-		  contextInfo:nil];
+	[windowController showOnWindow:self.view.window];
 }
 
 @end
diff -r 512cb1d5bcd7 -r 1b3f8d0c1663 Source/AIURLHandlerWindowController.h
--- a/Source/AIURLHandlerWindowController.h	Wed Sep 12 13:47:11 2012 +0200
+++ b/Source/AIURLHandlerWindowController.h	Wed Sep 12 14:21:00 2012 +0200
@@ -15,9 +15,10 @@
  */
 
 #import <Adium/AIPreferencePane.h>
+#import <Adium/AIWindowController.h>
 #import "AIURLHandlerPlugin.h"
 
- at interface AIURLHandlerWindowController : NSWindowController {
+ at interface AIURLHandlerWindowController : AIWindowController {
 	IBOutlet		NSTableView			*tableView;
 	
 	IBOutlet		NSButton					*checkBox_enforceDefault;




More information about the commits mailing list