mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-22 20:01:20 +00:00
Display details of any update failure in a message box instead of in the progress label on Mac.
This matches the Windows UI and a message box provides more space for text details than a progress label.
This commit is contained in:
parent
121b1c9126
commit
22d0bd0939
1 changed files with 29 additions and 3 deletions
|
@ -18,12 +18,18 @@
|
|||
class UpdateDialogPrivate
|
||||
{
|
||||
public:
|
||||
UpdateDialogPrivate()
|
||||
: hadError(false)
|
||||
{
|
||||
}
|
||||
|
||||
UpdateDialogDelegate* delegate;
|
||||
NSAutoreleasePool* pool;
|
||||
NSWindow* window;
|
||||
NSButton* finishButton;
|
||||
NSTextField* progressLabel;
|
||||
NSProgressIndicator* progressBar;
|
||||
bool hadError;
|
||||
};
|
||||
|
||||
@implementation UpdateDialogDelegate
|
||||
|
@ -33,10 +39,18 @@ class UpdateDialogPrivate
|
|||
}
|
||||
- (void) reportUpdateError: (id)arg
|
||||
{
|
||||
dialog->hadError = true;
|
||||
NSMutableString* message = [[NSMutableString alloc] init];
|
||||
[message appendString:@"There was a problem installing the update: "];
|
||||
[message appendString:@"There was a problem installing the update:\n"];
|
||||
[message appendString:arg];
|
||||
[dialog->progressLabel setTitleWithMnemonic: message];
|
||||
|
||||
NSAlert* alert = [NSAlert
|
||||
alertWithMessageText: @"Update Problem"
|
||||
defaultButton: nil
|
||||
alternateButton: nil
|
||||
otherButton: nil
|
||||
informativeTextWithFormat: message];
|
||||
[alert runModal];
|
||||
[message release];
|
||||
}
|
||||
- (void) reportUpdateProgress: (id)arg
|
||||
|
@ -46,7 +60,19 @@ class UpdateDialogPrivate
|
|||
}
|
||||
- (void) reportUpdateFinished: (id)arg
|
||||
{
|
||||
[dialog->progressLabel setTitleWithMnemonic:@"Updates installed. Click 'Finish' to restart the application."];
|
||||
NSMutableString* message = [[NSMutableString alloc] init];
|
||||
if (!dialog->hadError)
|
||||
{
|
||||
[message appendString:@"Updates installed."];
|
||||
}
|
||||
else
|
||||
{
|
||||
[message appendString:@"Update failed."];
|
||||
}
|
||||
|
||||
[message appendString:@" Click 'Finish' to restart the application."];
|
||||
[dialog->progressLabel setTitleWithMnemonic:message];
|
||||
[message release];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue