From 90b042f78993e2b3d08c13aa5521b2ef86afd4df Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 12 Mar 2013 02:56:35 +0000 Subject: [PATCH] the PiecesView will use target/action instead of notification center for mouse-down events --- macosx/InfoActivityViewController.m | 6 ++++-- macosx/PiecesView.m | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/macosx/InfoActivityViewController.m b/macosx/InfoActivityViewController.m index 8d191f3f1..4f06d6dcd 100644 --- a/macosx/InfoActivityViewController.m +++ b/macosx/InfoActivityViewController.m @@ -55,8 +55,6 @@ - (void) awakeFromNib { - [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updatePiecesView) name: @"UpdatePiecesView" object: nil]; - [fTransferSectionLabel sizeToFit]; [fDatesSectionLabel sizeToFit]; [fTimeSectionLabel sizeToFit]; @@ -95,6 +93,10 @@ frame.size.width -= widthIncrease; [field setFrame: frame]; } + + //set the click action of the pieces view + [fPiecesView setAction:@selector(updatePiecesView)]; + [fPiecesView setTarget:self]; } - (void) dealloc diff --git a/macosx/PiecesView.m b/macosx/PiecesView.m index d7e36b6c6..9b86e3078 100644 --- a/macosx/PiecesView.m +++ b/macosx/PiecesView.m @@ -216,7 +216,7 @@ enum const BOOL availability = ![[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"]; [[NSUserDefaults standardUserDefaults] setBool: availability forKey: @"PiecesViewShowAvailability"]; - [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdatePiecesView" object: self]; + [self sendAction:[self action] to:[self target]]; } [super mouseDown: event];