Changeset 9790
- Timestamp:
- Dec 16, 2009, 3:19:09 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/GroupsPrefsController.m
r9320 r9790 36 36 37 37 - (void) updateSelectedGroup; 38 - (void) refreshCustomLocation; 38 39 39 40 @end … … 217 218 [[GroupsController groups] setCustomDownloadLocation: path forIndex: index]; 218 219 [[GroupsController groups] setUsesCustomDownloadLocation: YES forIndex: index]; 219 [self updateSelectedGroup]; //update the popup's icon/title220 220 } 221 221 else 222 222 { 223 223 if (![[GroupsController groups] customDownloadLocationForIndex: index]) 224 {225 224 [[GroupsController groups] setUsesCustomDownloadLocation: NO forIndex: index]; 226 [fCustomLocationEnableCheck setState: NSOffState]; 227 [fCustomLocationPopUp setEnabled: NO]; 228 } 229 } 230 225 } 226 227 [self refreshCustomLocation]; 228 231 229 [fCustomLocationPopUp selectItemAtIndex: 0]; 232 230 } … … 315 313 if ([fTableView numberOfSelectedRows] == 1) 316 314 { 317 NSInteger index = [[GroupsController groups] indexForRow: [fTableView selectedRow]];315 const NSInteger index = [[GroupsController groups] indexForRow: [fTableView selectedRow]]; 318 316 [fSelectedColorView setColor: [[GroupsController groups] colorForIndex: index]]; 319 317 [fSelectedColorView setEnabled: YES]; 320 318 [fSelectedColorNameField setStringValue: [[GroupsController groups] nameForIndex: index]]; 321 319 [fSelectedColorNameField setEnabled: YES]; 322 [fCustomLocationEnableCheck setState: [[GroupsController groups] usesCustomDownloadLocationForIndex: index]]; 323 [fCustomLocationEnableCheck setEnabled: YES]; 324 [fCustomLocationPopUp setEnabled: [fCustomLocationEnableCheck state] == NSOnState]; 325 if ([[GroupsController groups] customDownloadLocationForIndex: index]) 326 { 327 NSString * location = [[GroupsController groups] customDownloadLocationForIndex: index]; 328 ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease]; 329 [[fCustomLocationPopUp itemAtIndex: 0] setTitle: [pathTransformer transformedValue: location]]; 330 ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease]; 331 [[fCustomLocationPopUp itemAtIndex: 0] setImage: [iconTransformer transformedValue: location]]; 332 } 333 else 334 { 335 [[fCustomLocationPopUp itemAtIndex: 0] setTitle: @""]; 336 [[fCustomLocationPopUp itemAtIndex: 0] setImage: nil]; 337 } 320 321 [self refreshCustomLocation]; 338 322 339 323 [fAutoAssignRulesEnableCheck setState: [[GroupsController groups] usesAutoAssignRulesForIndex: index]]; … … 354 338 } 355 339 340 - (void) refreshCustomLocation 341 { 342 const NSInteger index = [[GroupsController groups] indexForRow: [fTableView selectedRow]]; 343 344 [fCustomLocationEnableCheck setState: [[GroupsController groups] usesCustomDownloadLocationForIndex: index]]; 345 [fCustomLocationEnableCheck setEnabled: YES]; 346 [fCustomLocationPopUp setEnabled: [fCustomLocationEnableCheck state] == NSOnState]; 347 348 if ([[GroupsController groups] customDownloadLocationForIndex: index]) 349 { 350 NSString * location = [[GroupsController groups] customDownloadLocationForIndex: index]; 351 ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease]; 352 [[fCustomLocationPopUp itemAtIndex: 0] setTitle: [pathTransformer transformedValue: location]]; 353 ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease]; 354 [[fCustomLocationPopUp itemAtIndex: 0] setImage: [iconTransformer transformedValue: location]]; 355 } 356 else 357 { 358 [[fCustomLocationPopUp itemAtIndex: 0] setTitle: @""]; 359 [[fCustomLocationPopUp itemAtIndex: 0] setImage: nil]; 360 } 361 } 362 356 363 @end
Note: See TracChangeset
for help on using the changeset viewer.