Fixing 241181

Added a cancel button to the "checking for updates..." dialog.
This commit is contained in:
Andy Matuschak committed 2008-06-28 18:22:05 -07:00
1 parent 756b32f258
commit c51abb4318
4 files changed
+18 -8

No files matched your search

-1
View File
@@ -28,7 +28,6 @@
// If isDefault is YES, the button's key equivalent will be \r.
- (void)setButtonTitle:(NSString *)buttonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault;
- (void)setButtonEnabled:(BOOL)enabled;
- (void)setButtonHidden:(BOOL)hidden;
- (double)progressValue;
- (void)setProgressValue:(double)value;
-6
View File
@@ -87,12 +87,6 @@
[actionButton setEnabled:enabled];
}
- (void)setButtonHidden:(BOOL)hidden
{
[actionButton setHidden:hidden];
[[actionButton superview] display];
}
- (double)progressValue
{
return progressValue;
+1
View File
@@ -14,6 +14,7 @@
@interface SUUserInitiatedUpdateDriver : SUUIBasedUpdateDriver {
SUStatusController *checkingController;
BOOL isCanceled;
}
@end
+17 -1
View File
@@ -17,7 +17,7 @@
checkingController = [[SUStatusController alloc] initWithHostBundle:hb];
[checkingController window]; // Force the checking controller to load its window.
[checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates\u2026", nil) maxProgressValue:0 statusText:nil];
[checkingController setButtonHidden:YES];
[checkingController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO];
[checkingController showWindow:self];
}
@@ -31,14 +31,30 @@
}
}
- (void)cancelCheckForUpdates:sender
{
[self closeCheckingWindow];
isCanceled = YES;
}
- (void)appcastDidFinishLoading:(SUAppcast *)ac
{
if (isCanceled)
{
[self abortUpdate];
return;
}
[self closeCheckingWindow];
[super appcastDidFinishLoading:ac];
}
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error
{
if (isCanceled)
{
[self abortUpdate];
return;
}
[self closeCheckingWindow];
[super appcast:ac failedToLoadWithError:error];
}