| Revision 134,
1.6 KB
checked in by speck, 4 years ago
(diff) |
|
Simple display of suspects in preference panel.
|
| Line | |
|---|
| 1 | // |
|---|
| 2 | // SUAutomaticUpdateAlert.m |
|---|
| 3 | // Sparkle |
|---|
| 4 | // |
|---|
| 5 | // Created by Andy Matuschak on 3/18/06. |
|---|
| 6 | // Copyright 2006 Andy Matuschak. All rights reserved. |
|---|
| 7 | // |
|---|
| 8 | |
|---|
| 9 | #import "SUAutomaticUpdateAlert.h" |
|---|
| 10 | |
|---|
| 11 | #import "SUHost.h" |
|---|
| 12 | |
|---|
| 13 | @implementation SUAutomaticUpdateAlert |
|---|
| 14 | |
|---|
| 15 | - (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:del; |
|---|
| 16 | { |
|---|
| 17 | self = [super initWithHost:aHost windowNibName:@"SUAutomaticUpdateAlert"]; |
|---|
| 18 | if (self) |
|---|
| 19 | { |
|---|
| 20 | updateItem = [item retain]; |
|---|
| 21 | delegate = del; |
|---|
| 22 | host = [aHost retain]; |
|---|
| 23 | [self setShouldCascadeWindows:NO]; |
|---|
| 24 | [[self window] center]; |
|---|
| 25 | } |
|---|
| 26 | return self; |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | - (void)dealloc |
|---|
| 30 | { |
|---|
| 31 | [host release]; |
|---|
| 32 | [updateItem release]; |
|---|
| 33 | [super dealloc]; |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | - (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; } |
|---|
| 37 | |
|---|
| 38 | - (IBAction)installNow:sender |
|---|
| 39 | { |
|---|
| 40 | [self close]; |
|---|
| 41 | [delegate automaticUpdateAlert:self finishedWithChoice:SUInstallNowChoice]; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | - (IBAction)installLater:sender |
|---|
| 45 | { |
|---|
| 46 | [self close]; |
|---|
| 47 | [delegate automaticUpdateAlert:self finishedWithChoice:SUInstallLaterChoice]; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | - (IBAction)doNotInstall:sender |
|---|
| 51 | { |
|---|
| 52 | [self close]; |
|---|
| 53 | [delegate automaticUpdateAlert:self finishedWithChoice:SUDoNotInstallChoice]; |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | - (NSImage *)applicationIcon |
|---|
| 57 | { |
|---|
| 58 | return [host icon]; |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | - (NSString *)titleText |
|---|
| 62 | { |
|---|
| 63 | return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is ready to install!", nil), [host name]]; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | - (NSString *)descriptionText |
|---|
| 67 | { |
|---|
| 68 | return [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", nil), [host name], [host displayVersion]]; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | @end |
|---|
Note: See
TracBrowser
for help on using the repository browser.