Skip to content

Commit

Permalink
Merge branch 'hotfix-1.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswayoub committed May 12, 2014
2 parents 41618f0 + 41da3d6 commit 157b599
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
53 changes: 31 additions & 22 deletions Vagrant Manager/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -811,33 +811,42 @@ - (void)checkForUpdates:(BOOL)displayResult {
NSString *currentVersion = [responseObj objectForKey:@"current_version"];
NSString *installedVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"];

NSComparisonResult versionComparison = [Util compareVersion:currentVersion toVersion:installedVersion];

BOOL updateAvailable = (versionComparison == NSOrderedDescending);

if(updateAvailable) {
if(![[NSUserDefaults standardUserDefaults] boolForKey:@"dontShowUpdateNotification"]) {
[self updateCheckUpdatesIcon:YES];
}
if(downloadURL && currentVersion) {
NSComparisonResult versionComparison = [Util compareVersion:currentVersion toVersion:installedVersion];

if(displayResult) {
dispatch_async(dispatch_get_main_queue(), ^{
NSAlert *confirmAlert = [NSAlert alertWithMessageText:[NSString stringWithFormat:@"There is a new version available.\nCurrent Version: %@\nLatest Version: %@", [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"], currentVersion] defaultButton:@"Download Latest Version" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@""];
NSInteger button = [confirmAlert runModal];

if(button == NSAlertDefaultReturn) {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:downloadURL]];
}
});
BOOL updateAvailable = (versionComparison == NSOrderedDescending);

if(updateAvailable) {
if(![[NSUserDefaults standardUserDefaults] boolForKey:@"dontShowUpdateNotification"]) {
[self updateCheckUpdatesIcon:YES];
}

if(displayResult) {
dispatch_async(dispatch_get_main_queue(), ^{
NSAlert *confirmAlert = [NSAlert alertWithMessageText:[NSString stringWithFormat:@"There is a new version available.\nCurrent Version: %@\nLatest Version: %@", [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"], currentVersion] defaultButton:@"Download Latest Version" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@""];
NSInteger button = [confirmAlert runModal];

if(button == NSAlertDefaultReturn) {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:downloadURL]];
}
});
}
} else {
[self updateCheckUpdatesIcon:NO];

if(displayResult) {
dispatch_async(dispatch_get_main_queue(), ^{
NSAlert *alert = [NSAlert alertWithMessageText:@"There are no updates available." defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@""];
[alert runModal];
});
}
}
} else {
[self updateCheckUpdatesIcon:NO];

if(displayResult) {
dispatch_async(dispatch_get_main_queue(), ^{
NSAlert *alert = [NSAlert alertWithMessageText:@"There are no updates available." defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@""];
[alert runModal];
});
NSAlert *errorAlert = [NSAlert alertWithMessageText:@"There was an error checking for a new version. Please try again later." defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@""];
[errorAlert runModal];
});
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Vagrant Manager/Vagrant Manager-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.0</string>
<string>1.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>6</string>
<key>Configuration</key>
<string>${CONFIGURATION}</string>
<key>LSApplicationCategoryType</key>
Expand Down

0 comments on commit 157b599

Please sign in to comment.