From 9e99950dd4aef3b6275616ba8e40caa249017b61 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 12 Mar 2013 03:08:59 +0000 Subject: [PATCH] add a note to myself to set off the pieces view target/action in the xib instead of code --- macosx/InfoActivityViewController.h | 3 ++- macosx/InfoActivityViewController.m | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/macosx/InfoActivityViewController.h b/macosx/InfoActivityViewController.h index ae12b1a70..37c7ccc39 100644 --- a/macosx/InfoActivityViewController.h +++ b/macosx/InfoActivityViewController.h @@ -56,7 +56,8 @@ - (void) setInfoForTorrents: (NSArray *) torrents; - (void) updateInfo; -- (void) setPiecesView: (id) sender; +- (IBAction) setPiecesView: (id) sender; +- (IBAction) updatePiecesView: (id) sender; - (void) clearView; @end diff --git a/macosx/InfoActivityViewController.m b/macosx/InfoActivityViewController.m index 4f06d6dcd..64ebf7d3e 100644 --- a/macosx/InfoActivityViewController.m +++ b/macosx/InfoActivityViewController.m @@ -37,8 +37,6 @@ - (void) setupInfo; -- (void) updatePiecesView; - @end @implementation InfoActivityViewController @@ -95,7 +93,8 @@ } //set the click action of the pieces view - [fPiecesView setAction:@selector(updatePiecesView)]; + #warning after 2.8 just hook this up in the xib + [fPiecesView setAction:@selector(updatePiecesView:)]; [fPiecesView setTarget:self]; } @@ -205,6 +204,17 @@ [self updatePiecesView]; } + +- (void) updatePiecesView: (id) sender +{ + const BOOL piecesAvailableSegment = [[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"]; + + [fPiecesControl setSelected: piecesAvailableSegment forSegment: PIECES_CONTROL_AVAILABLE]; + [fPiecesControl setSelected: !piecesAvailableSegment forSegment: PIECES_CONTROL_PROGRESS]; + + [fPiecesView updateView]; +} + - (void) clearView { [fPiecesView clearView]; @@ -261,14 +271,4 @@ fSet = YES; } -- (void) updatePiecesView -{ - const BOOL piecesAvailableSegment = [[NSUserDefaults standardUserDefaults] boolForKey: @"PiecesViewShowAvailability"]; - - [fPiecesControl setSelected: piecesAvailableSegment forSegment: PIECES_CONTROL_AVAILABLE]; - [fPiecesControl setSelected: !piecesAvailableSegment forSegment: PIECES_CONTROL_PROGRESS]; - - [fPiecesView updateView]; -} - @end