diff --git a/src/ProcessUtils.cpp b/src/ProcessUtils.cpp index 0707440..aa27fad 100644 --- a/src/ProcessUtils.cpp +++ b/src/ProcessUtils.cpp @@ -195,7 +195,7 @@ void ProcessUtils::runElevatedMac(const std::string& executable, char** argv; argv = (char**) malloc(sizeof(char*) * args.size() + 1); - int i = 0; + unsigned int i = 0; for (std::list::const_iterator iter = args.begin(); iter != args.end(); iter++) { argv[i] = strdup(iter->c_str()); diff --git a/src/UpdateDialogCocoa.mm b/src/UpdateDialogCocoa.mm index 28e2bd2..dc1e972 100644 --- a/src/UpdateDialogCocoa.mm +++ b/src/UpdateDialogCocoa.mm @@ -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,19 @@ class UpdateDialogPrivate } - (void) reportUpdateError: (id)arg { - NSMutableString* message; - [message appendString:@"There was a problem installing the update: "]; + dialog->hadError = true; + NSMutableString* message = [[NSMutableString alloc] init]; + [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 { @@ -45,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 @@ -120,6 +147,7 @@ void UpdateDialogCocoa::updateError(const std::string& errorMessage) bool UpdateDialogCocoa::updateRetryCancel(const std::string& message) { // TODO + return false; } void UpdateDialogCocoa::updateProgress(int percentage) diff --git a/src/UpdaterOptions.cpp b/src/UpdaterOptions.cpp index d67b65d..7db077e 100644 --- a/src/UpdaterOptions.cpp +++ b/src/UpdaterOptions.cpp @@ -43,7 +43,7 @@ UpdateInstaller::Mode stringToMode(const std::string& modeStr) void UpdaterOptions::parseOldFormatArg(const std::string& arg, std::string* key, std::string* value) { - unsigned int pos = arg.find('='); + size_t pos = arg.find('='); if (pos != std::string::npos) { *key = arg.substr(0,pos);