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:
Robert Knight 2011-08-24 11:14:39 +01:00
parent 121b1c9126
commit 22d0bd0939

View file

@ -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