Current download should have focus in download manager. b=266831 sr=pinkerton

This commit is contained in:
joshmoz%gmail.com 2004-12-03 18:01:59 +00:00
Родитель 5b0800ae0b
Коммит 130551926f
1 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -50,7 +50,7 @@ static NSString *ProgressWindowFrameSaveName = @"ProgressWindow";
-(void)rebuildViews; -(void)rebuildViews;
-(NSMutableArray*)getSelectedProgressViewControllers; -(NSMutableArray*)getSelectedProgressViewControllers;
-(void)deselectAllDLInstances:(NSArray*)instances; -(void)deselectDLInstancesInArray:(NSArray*)instances;
-(void)makeDLInstanceVisibleIfItsNotAlready:(ProgressViewController*)controller; -(void)makeDLInstanceVisibleIfItsNotAlready:(ProgressViewController*)controller;
-(void)killDownloadTimer; -(void)killDownloadTimer;
-(void)setupDownloadTimer; -(void)setupDownloadTimer;
@ -210,7 +210,7 @@ static id gSharedProgressController = nil;
// if its not either clear all selections except the one that just happened // if its not either clear all selections except the one that just happened
if (lastMod == kNoKey) { if (lastMod == kNoKey) {
// deselect everything // deselect everything
[self deselectAllDLInstances:selectedArray]; [self deselectDLInstancesInArray:selectedArray];
[sender setSelected:YES]; [sender setSelected:YES];
mSelectionPivotIndex = [mProgressViewControllers indexOfObject:[sender getController]]; mSelectionPivotIndex = [mProgressViewControllers indexOfObject:[sender getController]];
} }
@ -238,7 +238,7 @@ static id gSharedProgressController = nil;
else { else {
int senderLocation = [mProgressViewControllers indexOfObject:[sender getController]]; int senderLocation = [mProgressViewControllers indexOfObject:[sender getController]];
// deselect everything // deselect everything
[self deselectAllDLInstances:selectedArray]; [self deselectDLInstancesInArray:selectedArray];
if (senderLocation <= mSelectionPivotIndex) { if (senderLocation <= mSelectionPivotIndex) {
for (int i = senderLocation; i <= mSelectionPivotIndex; i++) { for (int i = senderLocation; i <= mSelectionPivotIndex; i++) {
[[((ProgressViewController*)[mProgressViewControllers objectAtIndex:i]) view] setSelected:YES]; [[((ProgressViewController*)[mProgressViewControllers objectAtIndex:i]) view] setSelected:YES];
@ -271,7 +271,7 @@ static id gSharedProgressController = nil;
} }
// deselect everything if the shift key isn't a modifier // deselect everything if the shift key isn't a modifier
if (!(mods & NSShiftKeyMask)) { if (!(mods & NSShiftKeyMask)) {
[self deselectAllDLInstances:[self getSelectedProgressViewControllers]]; [self deselectDLInstancesInArray:[self getSelectedProgressViewControllers]];
} }
if (i == [mProgressViewControllers count]) { // if nothing was selected select the first item if (i == [mProgressViewControllers count]) { // if nothing was selected select the first item
instanceToSelect = 0; instanceToSelect = 0;
@ -302,7 +302,7 @@ static id gSharedProgressController = nil;
} }
// deselect everything if the shift key isn't a modifier // deselect everything if the shift key isn't a modifier
if (!(mods & NSShiftKeyMask)) { if (!(mods & NSShiftKeyMask)) {
[self deselectAllDLInstances:[self getSelectedProgressViewControllers]]; [self deselectDLInstancesInArray:[self getSelectedProgressViewControllers]];
} }
if (i < 0) { // if nothing was selected select the first item if (i < 0) { // if nothing was selected select the first item
instanceToSelect = ([mProgressViewControllers count] - 1); instanceToSelect = ([mProgressViewControllers count] - 1);
@ -358,7 +358,7 @@ static id gSharedProgressController = nil;
} }
} }
-(void)deselectAllDLInstances:(NSArray*)instances -(void)deselectDLInstancesInArray:(NSArray*)instances
{ {
unsigned count = [instances count]; unsigned count = [instances count];
for (unsigned i = 0; i < count; i++) { for (unsigned i = 0; i < count; i++) {
@ -413,6 +413,10 @@ static id gSharedProgressController = nil;
[self rebuildViews]; [self rebuildViews];
[self setupDownloadTimer]; [self setupDownloadTimer];
// downloads should be individually selected when initiated
[self deselectDLInstancesInArray:[self getSelectedProgressViewControllers]];
[[((ProgressViewController*)progressDisplay) view] setSelected:YES];
// make sure new download is visible // make sure new download is visible
[self makeDLInstanceVisibleIfItsNotAlready:progressDisplay]; [self makeDLInstanceVisibleIfItsNotAlready:progressDisplay];
} }