1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 14:13:23 +00:00

make sure the group info is updated when adding/removing groups

This commit is contained in:
Mitchell Livingston 2008-12-08 03:55:08 +00:00
parent 1e7807356f
commit 6e519855b8

View file

@ -35,7 +35,7 @@
@interface GroupsPrefsController (Private) @interface GroupsPrefsController (Private)
- (void) updateSelectedColor; - (void) updateSelectedGroup;
@end @end
@ -55,7 +55,7 @@
[fSelectedColorView addObserver: self forKeyPath: @"color" options: 0 context: NULL]; [fSelectedColorView addObserver: self forKeyPath: @"color" options: 0 context: NULL];
[self updateSelectedColor]; [self updateSelectedGroup];
} }
- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableview - (NSInteger) numberOfRowsInTableView: (NSTableView *) tableview
@ -77,7 +77,7 @@
- (void) tableViewSelectionDidChange: (NSNotification *) notification - (void) tableViewSelectionDidChange: (NSNotification *) notification
{ {
[self updateSelectedColor]; [self updateSelectedGroup];
} }
- (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id) object change: (NSDictionary *) change context: (void *) context - (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id) object change: (NSDictionary *) change context: (void *) context
@ -182,6 +182,8 @@
break; break;
} }
[self updateSelectedGroup];
} }
- (void) customDownloadLocationSheetShow: (id) sender - (void) customDownloadLocationSheetShow: (id) sender
@ -224,7 +226,7 @@
path = [[openPanel filenames] objectAtIndex: 0]; path = [[openPanel filenames] objectAtIndex: 0];
[[GroupsController groups] setCustomDownloadLocation: path forIndex: index]; [[GroupsController groups] setCustomDownloadLocation: path forIndex: index];
[[GroupsController groups] setUsesCustomDownloadLocation: YES forIndex: index]; [[GroupsController groups] setUsesCustomDownloadLocation: YES forIndex: index];
[self updateSelectedColor]; // Update the popup's icon/title [self updateSelectedGroup]; // update the popup's icon/title
} }
else if (!path) else if (!path)
{ {
@ -389,7 +391,7 @@ static NSString * endsWithCriteria = @"ends";
@implementation GroupsPrefsController (Private) @implementation GroupsPrefsController (Private)
- (void) updateSelectedColor - (void) updateSelectedGroup
{ {
[fAddRemoveControl setEnabled: [fTableView numberOfSelectedRows] > 0 forSegment: REMOVE_TAG]; [fAddRemoveControl setEnabled: [fTableView numberOfSelectedRows] > 0 forSegment: REMOVE_TAG];
if ([fTableView numberOfSelectedRows] == 1) if ([fTableView numberOfSelectedRows] == 1)