mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Fixing 241181
Added a cancel button to the "checking for updates..." dialog.
This commit is contained in:
1 parent
756b32f258
commit
c51abb4318
4 files changed
+18
-8
No files matched your search
@@ -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;
|
||||
|
||||
@@ -87,12 +87,6 @@
|
||||
[actionButton setEnabled:enabled];
|
||||
}
|
||||
|
||||
- (void)setButtonHidden:(BOOL)hidden
|
||||
{
|
||||
[actionButton setHidden:hidden];
|
||||
[[actionButton superview] display];
|
||||
}
|
||||
|
||||
- (double)progressValue
|
||||
{
|
||||
return progressValue;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
@interface SUUserInitiatedUpdateDriver : SUUIBasedUpdateDriver {
|
||||
SUStatusController *checkingController;
|
||||
BOOL isCanceled;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user