adium 5052:de29b6d93baf: Fix a bunch of other problems with NSWi...

commits at adium.im commits at adium.im
Wed Sep 12 10:17:53 UTC 2012


details:	http://hg.adium.im/adium/rev/de29b6d93baf
revision:	5052:de29b6d93baf
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Wed Sep 12 12:17:15 2012 +0200

Fix a bunch of other problems with NSWindowController subclasses.

diffs (160 lines):

diff -r 565d34e57d54 -r de29b6d93baf Plugins/Emoticons/AIEmoticonPreferences.h
--- a/Plugins/Emoticons/AIEmoticonPreferences.h	Wed Sep 12 12:04:11 2012 +0200
+++ b/Plugins/Emoticons/AIEmoticonPreferences.h	Wed Sep 12 12:17:15 2012 +0200
@@ -38,7 +38,6 @@
 	BOOL															viewIsOpen;
 }
 
-- (void)openOnWindow:(NSWindow *)parentWindow __attribute__((ns_consumes_self));
 - (void)toggledPackController:(id)packController;
 - (void)emoticonXtrasDidChange;
 
diff -r 565d34e57d54 -r de29b6d93baf Plugins/Emoticons/AIEmoticonPreferences.m
--- a/Plugins/Emoticons/AIEmoticonPreferences.m	Wed Sep 12 12:04:11 2012 +0200
+++ b/Plugins/Emoticons/AIEmoticonPreferences.m	Wed Sep 12 12:17:15 2012 +0200
@@ -53,16 +53,11 @@
 	return self;
 }
 
-- (void)openOnWindow:(NSWindow *)parentWindow
+- (void)showOnWindow:(id)parentWindow
 {
-	if (parentWindow) {
-		[NSApp beginSheet:self.window
-		   modalForWindow:parentWindow
-			modalDelegate:self
-		   didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
-			  contextInfo:nil];
-	} else {
-		[self showWindow:nil];
+	[super showOnWindow:parentWindow];
+	
+	if (!parentWindow) {
 		[self.window makeKeyAndOrderFront:nil];
 		[NSApp activateIgnoringOtherApps:YES];
 	}
@@ -73,12 +68,12 @@
  */
 - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
 {
-	[sheet orderOut:nil];
-	
 	viewIsOpen = NO;
 	
 	[adium.preferenceController unregisterPreferenceObserver:self];
     [adium.emoticonController flushEmoticonImageCache];
+	
+	[super sheetDidEnd:sheet returnCode:returnCode contextInfo:contextInfo];
 }
 
 //Configure the preference view
@@ -138,10 +133,10 @@
 {
 	viewIsOpen = NO;
 	
-	[super windowWillClose:sender];
-	
 	[adium.preferenceController unregisterPreferenceObserver:self];
     [adium.emoticonController flushEmoticonImageCache];
+	
+	[super windowWillClose:sender];
 }
 
 - (void)dealloc
diff -r 565d34e57d54 -r de29b6d93baf Source/AIAppearancePreferences.m
--- a/Source/AIAppearancePreferences.m	Wed Sep 12 12:04:11 2012 +0200
+++ b/Source/AIAppearancePreferences.m	Wed Sep 12 12:17:15 2012 +0200
@@ -275,7 +275,7 @@
 - (IBAction)customizeEmoticons:(id)sender
 {
 	AIEmoticonPreferences *emoticonPreferences = [[AIEmoticonPreferences alloc] init];
-	[emoticonPreferences openOnWindow:[[self view] window]];
+	[emoticonPreferences showOnWindow:[[self view] window]];
 }
 
 /*!
@@ -331,7 +331,7 @@
 - (IBAction)showAllDockIcons:(id)sender
 {
 	AIDockIconSelectionSheet *dockIconSelectionSheet = [[AIDockIconSelectionSheet alloc] init];
-	[dockIconSelectionSheet openOnWindow:[[self view] window]];
+	[dockIconSelectionSheet showOnWindow:[[self view] window]];
 }
 
 /*!
diff -r 565d34e57d54 -r de29b6d93baf Source/AIContactInfoWindowController.m
--- a/Source/AIContactInfoWindowController.m	Wed Sep 12 12:04:11 2012 +0200
+++ b/Source/AIContactInfoWindowController.m	Wed Sep 12 12:17:15 2012 +0200
@@ -198,10 +198,10 @@
 	[[adium preferenceController] setPreference:[NSNumber numberWithInteger:[inspectorToolbar selectedColumn]]
 										  forKey:KEY_INFO_SELECTED_CATEGORY
 										   group:PREF_GROUP_WINDOW_POSITIONS];
+
+	[super windowWillClose:inNotification];
 	
 	sharedContactInfoInstance = nil;
-
-	[super windowWillClose:inNotification];
 }
 
 /*
diff -r 565d34e57d54 -r de29b6d93baf Source/AIDockIconSelectionSheet.h
--- a/Source/AIDockIconSelectionSheet.h	Wed Sep 12 12:04:11 2012 +0200
+++ b/Source/AIDockIconSelectionSheet.h	Wed Sep 12 12:17:15 2012 +0200
@@ -45,8 +45,6 @@
 @property (weak) NSTimer *animationTimer;
 @property (assign) NSUInteger previousIndex;
 
-- (void)openOnWindow:(NSWindow *)parentWindow __attribute__((ns_consumes_self));
-
 #pragma mark - Animations
 
 - (void)setAnimatedDockIconAtIndex:(NSInteger)index;
diff -r 565d34e57d54 -r de29b6d93baf Source/AIDockIconSelectionSheet.m
--- a/Source/AIDockIconSelectionSheet.m	Wed Sep 12 12:04:11 2012 +0200
+++ b/Source/AIDockIconSelectionSheet.m	Wed Sep 12 12:17:15 2012 +0200
@@ -48,16 +48,11 @@
 	return self;
 }
 
-- (void)openOnWindow:(NSWindow *)parentWindow
+- (void)showOnWindow:(NSWindow *)parentWindow
 {
-	if (parentWindow) {
-		[NSApp beginSheet:self.window
-		   modalForWindow:parentWindow
-			modalDelegate:self
-		   didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
-			  contextInfo:nil];
-	} else {
-		[self showWindow:nil];
+	[super showOnWindow:parentWindow];
+	
+	if (!parentWindow) {
 		[self.window makeKeyAndOrderFront:nil];
 		[NSApp activateIgnoringOtherApps:YES];
 	}
@@ -99,9 +94,9 @@
 // Preference view is closing
 - (void)windowWillClose:(id)sender
 {
+    [self setAnimatedDockIconAtIndex:NSNotFound];
+	
 	[super windowWillClose:sender];
-	
-    [self setAnimatedDockIconAtIndex:NSNotFound];
 }
 
 #pragma mark -
@@ -109,9 +104,9 @@
 // Invoked as the sheet closes, dismiss the sheet
 - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
 {
+    [self setAnimatedDockIconAtIndex:NSNotFound];
+	
     [sheet orderOut:nil];
-	
-    [self setAnimatedDockIconAtIndex:NSNotFound];
 }
 
 // When the xtras are changed, update our icons




More information about the commits mailing list