1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

add a note to myself to set off the pieces view target/action in the xib instead of code

This commit is contained in:
Mitchell Livingston 2013-03-12 03:08:59 +00:00
parent 90b042f789
commit 9e99950dd4
2 changed files with 15 additions and 14 deletions

View file

@ -56,7 +56,8 @@
- (void) setInfoForTorrents: (NSArray *) torrents; - (void) setInfoForTorrents: (NSArray *) torrents;
- (void) updateInfo; - (void) updateInfo;
- (void) setPiecesView: (id) sender; - (IBAction) setPiecesView: (id) sender;
- (IBAction) updatePiecesView: (id) sender;
- (void) clearView; - (void) clearView;
@end @end

View file

@ -37,8 +37,6 @@
- (void) setupInfo; - (void) setupInfo;
- (void) updatePiecesView;
@end @end
@implementation InfoActivityViewController @implementation InfoActivityViewController
@ -95,7 +93,8 @@
} }
//set the click action of the pieces view //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]; [fPiecesView setTarget:self];
} }
@ -205,6 +204,17 @@
[self updatePiecesView]; [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 - (void) clearView
{ {
[fPiecesView clearView]; [fPiecesView clearView];
@ -261,14 +271,4 @@
fSet = YES; 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 @end