Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show app version in menu

  • Loading branch information...
commit b9fb5860b5c9d3e1b47134df7bdf734e57490f8d 1 parent 01c4f9f
@codler authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  Battery Time Remaining/AppDelegate.m
View
3  Battery Time Remaining/AppDelegate.m
@@ -645,6 +645,7 @@ - (void)menuWillOpen:(NSMenu *)menu
[[HttpGet new] url:@"https://raw.github.com/codler/Battery-Time-Remaining/master/build_version" success:^(NSString *result) {
NSInteger latestBuildVersion = [result integerValue];
NSInteger currentBuildVersion = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] integerValue];
+ NSString *currentBuildVersionText = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
// Wrong format build version
if (!latestBuildVersion)
@@ -663,7 +664,7 @@ - (void)menuWillOpen:(NSMenu *)menu
}
else
{
- updaterMenu.title = NSLocalizedString(@"Up to date", @"Update menuitem");
+ updaterMenu.title = [NSString stringWithFormat:@"%@ - v%@", NSLocalizedString(@"Up to date", @"Update menuitem"), currentBuildVersionText];
}
} error:^(NSError *error) {
updaterMenu.title = NSLocalizedString(@"Could not check for updates", @"Update menuitem");
Please sign in to comment.
Something went wrong with that request. Please try again.