adium 3702:a6ebe4428c50: Conform to TableViewDelegate protocols ...

commits at adium.im commits at adium.im
Tue Mar 1 01:49:47 UTC 2011


details:	http://hg.adium.im/adium/rev/a6ebe4428c50
revision:	3702:a6ebe4428c50
author:		Stephen Holt <sholt at adium.im>
date:		Mon Feb 28 13:48:36 2011 -0800

Conform to TableViewDelegate protocols where necessary.
Subject: adium 3703:e45f3c22fa86: Formally conform to NSWindowDelegate

details:	http://hg.adium.im/adium/rev/e45f3c22fa86
revision:	3703:e45f3c22fa86
author:		Stephen Holt <sholt at adium.im>
date:		Mon Feb 28 13:43:07 2011 -0800

Formally conform to NSWindowDelegate
Subject: adium 3704:deb47d7bbc68: Conform to AIOutlineViewDelegate where necessary.

details:	http://hg.adium.im/adium/rev/deb47d7bbc68
revision:	3704:deb47d7bbc68
author:		Stephen Holt <sholt at adium.im>
date:		Mon Feb 28 13:53:50 2011 -0800

Conform to AIOutlineViewDelegate where necessary.
Subject: adium 3705:f06032595008: Fix deprecated methods in AIImageViewWithImagePicker.

details:	http://hg.adium.im/adium/rev/f06032595008
revision:	3705:f06032595008
author:		Stephen Holt <sholt at adium.im>
date:		Mon Feb 28 13:27:35 2011 -0800

Fix deprecated methods in AIImageViewWithImagePicker.
Subject: adium 3706:7cd4fb521300: Maintain compatability with current build targets

details:	http://hg.adium.im/adium/rev/7cd4fb521300
revision:	3706:7cd4fb521300
author:		Stephen Holt <sholt at adium.im>
date:		Mon Feb 28 17:49:25 2011 -0800

Maintain compatability with current build targets

diffs (197 lines):

diff -r 31312c5aa68c -r 7cd4fb521300 Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m	Tue Mar 01 01:47:29 2011 +0100
+++ b/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m	Mon Feb 28 17:49:25 2011 -0800
@@ -635,13 +635,14 @@
 		
 		openPanel = [NSOpenPanel openPanel];
 		[openPanel setTitle:[NSString stringWithFormat:AILocalizedStringFromTableInBundle(@"Select Image", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], nil)]];
+        [openPanel setAllowedFileTypes:[NSImage imageFileTypes]];
 		
-		if ([openPanel runModalForDirectory:nil file:nil types:[NSImage imageFileTypes]] == NSOKButton) {
+		if ([openPanel runModal] == NSOKButton) {
 			NSData	*imageData;
 			NSImage *image;
 			NSSize	imageSize;
 
-			imageData = [NSData dataWithContentsOfFile:[openPanel filename]];
+			imageData = [NSData dataWithContentsOfURL:[[openPanel URLs] objectAtIndex:0]];
 			image = (imageData ? [[[NSImage alloc] initWithData:imageData] autorelease] : nil);
 			imageSize = (image ? [image size] : NSZeroSize);
 
diff -r 31312c5aa68c -r 7cd4fb521300 Frameworks/AIUtilities Framework/Source/AILeopardCompatibility.h
--- a/Frameworks/AIUtilities Framework/Source/AILeopardCompatibility.h	Tue Mar 01 01:47:29 2011 +0100
+++ b/Frameworks/AIUtilities Framework/Source/AILeopardCompatibility.h	Mon Feb 28 17:49:25 2011 -0800
@@ -65,6 +65,14 @@
 @protocol NSMenuDelegate
 @end
 @protocol NSOutlineViewDelegate
+ at optional
+- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item;
+- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item;
+- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item;
+- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
+- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
+- (id)outlineView:(NSOutlineView *)outlineView itemForPersistentObject:(id)object;
+- (id)outlineView:(NSOutlineView *)outlineView persistentObjectForItem:(id)item;
 @end
 @protocol NSOutlineViewDataSource
 @end
diff -r 31312c5aa68c -r 7cd4fb521300 Frameworks/AIUtilities Framework/Source/AIOutlineView.h
--- a/Frameworks/AIUtilities Framework/Source/AIOutlineView.h	Tue Mar 01 01:47:29 2011 +0100
+++ b/Frameworks/AIUtilities Framework/Source/AIOutlineView.h	Mon Feb 28 17:49:25 2011 -0800
@@ -14,6 +14,8 @@
  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
+#include "AILeopardCompatibility.h"
+
 #define AIOutlineViewUserDidExpandItemNotification		@"AIOutlineViewUserDidExpandItemNotification"
 #define AIOutlineViewUserDidCollapseItemNotification	@"AIOutlineViewUserDidCollapseItemNotification"
 
@@ -21,13 +23,16 @@
 @class NSMenu, NSEvent, NSOutlineView, NSImage;
 @class AIOutlineView;
 
+
+
 /*!
  * @protocol AIOutlineViewDelegate
  * @brief Delegate protocol for <tt>AIOutlineView</tt>
  *
  * Implementation of all methods is optional.
  */
- at protocol AIOutlineViewDelegate
+ at protocol AIOutlineViewDelegate <NSOutlineViewDelegate, NSOutlineViewDataSource>
+ at optional
 /*!
  * @brief Requests a contextual menu for an event from the delegate
  *
diff -r 31312c5aa68c -r 7cd4fb521300 Frameworks/AIUtilities Framework/Source/AIOutlineView.m
--- a/Frameworks/AIUtilities Framework/Source/AIOutlineView.m	Tue Mar 01 01:47:29 2011 +0100
+++ b/Frameworks/AIUtilities Framework/Source/AIOutlineView.m	Mon Feb 28 17:49:25 2011 -0800
@@ -55,7 +55,7 @@
 - (NSMenu *)menuForEvent:(NSEvent *)theEvent
 {
     if ([[self delegate] respondsToSelector:@selector(outlineView:menuForEvent:)]) {
-        return [[self delegate] outlineView:self menuForEvent:theEvent];
+        return [(id<AIOutlineViewDelegate>)[self delegate] outlineView:self menuForEvent:theEvent];
     } else {
         return nil;
     }
@@ -84,7 +84,7 @@
 
     	if (pressedChar == NSDeleteFunctionKey || pressedChar == NSBackspaceCharacter || pressedChar == NSDeleteCharacter) { //Delete
 			if ([[self dataSource] respondsToSelector:@selector(outlineViewDeleteSelectedRows:)]) {
-				[[self dataSource] outlineViewDeleteSelectedRows:self];
+				[(id<AIOutlineViewDelegate>)[self dataSource] outlineViewDeleteSelectedRows:self];
 			}
 
 		} else if (pressedChar == NSCarriageReturnCharacter || pressedChar == NSEnterCharacter) { //Enter or return
@@ -143,7 +143,7 @@
 				   !([theEvent modifierFlags] & NSCommandKeyMask) && 
 				   !([theEvent modifierFlags] & NSControlKeyMask)) {
 			//handle any key we have not alredy handled that is a visable character and likely not to be a shortcut key (no command or control key modifiers) by asking the delegate to add it to the search string
-			if (![[self delegate] outlineView:self forwardKeyEventToFindPanel:theEvent]) {
+			if (![(id<AIOutlineViewDelegate>)[self delegate] outlineView:self forwardKeyEventToFindPanel:theEvent]) {
 				//the delegate's find panel could not handle the event, so we just pass it to super
 				[super keyDown:theEvent];
 			}
@@ -159,7 +159,7 @@
 - (void)performFindPanelAction:(id)sender;
 {
 	if ([[self delegate] respondsToSelector:@selector(outlineViewToggleFindPanel:)]) {
-		[[self delegate]outlineViewToggleFindPanel:self];
+		[(id<AIOutlineViewDelegate>)[self delegate] outlineViewToggleFindPanel:self];
 	}
 }
 
@@ -181,7 +181,7 @@
 
 		//Inform our delegate directly
 		if ([[self delegate] respondsToSelector:@selector(outlineView:setExpandState:ofItem:)]) {
-			[[self delegate] outlineView:self setExpandState:YES ofItem:item];
+			[(id<AIOutlineViewDelegate>)[self delegate] outlineView:self setExpandState:YES ofItem:item];
 		}
 	}
 }
@@ -197,7 +197,7 @@
 
 		//Inform our delegate directly
 		if ([[self delegate] respondsToSelector:@selector(outlineView:setExpandState:ofItem:)]) {
-			[[self delegate] outlineView:self setExpandState:NO ofItem:item];
+			[(id<AIOutlineViewDelegate>)[self delegate] outlineView:self setExpandState:NO ofItem:item];
 		}
 	}
 }
@@ -231,7 +231,7 @@
 {
 	//After reloading data, we correctly expand/collapse all groups
 	if ([[self delegate] respondsToSelector:@selector(outlineView:expandStateOfItem:)]) {
-		id		delegate = [self delegate];
+		id<AIOutlineViewDelegate>   delegate = (id<AIOutlineViewDelegate>)[self delegate];
 		NSInteger 	numberOfRows = [delegate outlineView:self numberOfChildrenOfItem:rootItem];
 		NSInteger 	row;
 		
@@ -276,7 +276,7 @@
 - (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation
 {	
 	if ([[self delegate] respondsToSelector:@selector(outlineView:draggedImage:endedAt:operation:)]) {
-		[[self delegate] outlineView:self draggedImage:image endedAt:screenPoint operation:operation];
+		[(id<AIOutlineViewDelegate>)[self delegate] outlineView:self draggedImage:image endedAt:screenPoint operation:operation];
 	}
 	
 	[super draggedImage:image endedAt:screenPoint operation:operation];
diff -r 31312c5aa68c -r 7cd4fb521300 Frameworks/Adium Framework/Source/AIWindowController.h
--- a/Frameworks/Adium Framework/Source/AIWindowController.h	Tue Mar 01 01:47:29 2011 +0100
+++ b/Frameworks/Adium Framework/Source/AIWindowController.h	Mon Feb 28 17:49:25 2011 -0800
@@ -14,7 +14,9 @@
  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
- at interface AIWindowController : NSWindowController {
+#import "AILeopardCompatibility.h"
+
+ at interface AIWindowController : NSWindowController <NSWindowDelegate> {
 }
 
 - (IBAction)closeWindow:(id)sender;
diff -r 31312c5aa68c -r 7cd4fb521300 Source/AIAccountListPreferences.h
--- a/Source/AIAccountListPreferences.h	Tue Mar 01 01:47:29 2011 +0100
+++ b/Source/AIAccountListPreferences.h	Mon Feb 28 17:49:25 2011 -0800
@@ -21,7 +21,7 @@
 
 @class AIAccountController, AIAccount, AIAutoScrollView, AIImageViewWithImagePicker;
 
- at interface AIAccountListPreferences : AIPreferencePane <AIListObjectObserver, AIAccountMenuDelegate> {
+ at interface AIAccountListPreferences : AIPreferencePane <AIListObjectObserver, AIAccountMenuDelegate, NSTableViewDelegate> {
 	//Account list
     IBOutlet		NSScrollView			*scrollView_accountList;
     IBOutlet		NSTableView				*tableView_accountList;
diff -r 31312c5aa68c -r 7cd4fb521300 Source/AIAdvancedPreferences.h
--- a/Source/AIAdvancedPreferences.h	Tue Mar 01 01:47:29 2011 +0100
+++ b/Source/AIAdvancedPreferences.h	Mon Feb 28 17:49:25 2011 -0800
@@ -15,10 +15,11 @@
  */
 
 #import <Adium/AIPreferencePane.h>
+#import "AILeopardCompatibility.h"
 
 @class KNShelfSplitView, AIModularPaneCategoryView;
 
- at interface AIAdvancedPreferences : AIPreferencePane {
+ at interface AIAdvancedPreferences : AIPreferencePane <NSTableViewDelegate> {
 	IBOutlet KNShelfSplitView			*shelf_splitView;
 	
 	IBOutlet NSTableView	*tableView_categories;
diff -r 31312c5aa68c -r 7cd4fb521300 Source/AILogViewerWindowController.h
--- a/Source/AILogViewerWindowController.h	Tue Mar 01 01:47:29 2011 +0100
+++ b/Source/AILogViewerWindowController.h	Mon Feb 28 17:49:25 2011 -0800
@@ -68,7 +68,7 @@
 
 @class AIListContact, AIChat, AIAccount, AIGradientView;
 
- at interface AILogViewerWindowController : AIWindowController <NSToolbarDelegate> {
+ at interface AILogViewerWindowController : AIWindowController <NSToolbarDelegate, NSOutlineViewDelegate, NSTableViewDelegate> {
 	AILoggerPlugin				*plugin;
 
 	IBOutlet	AIDividedAlternatingRowOutlineView	*outlineView_contacts;




More information about the commits mailing list