From ef14d9747d7a27cd198f2f6e4ab428e7ca28bb15 Mon Sep 17 00:00:00 2001 From: Han Lin Yap Date: Sat, 22 Jun 2013 18:59:34 +0200 Subject: [PATCH] Fix previous merge commit. --- Battery Time Remaining/AppDelegate.h | 8 ++--- Battery Time Remaining/AppDelegate.m | 32 ++++++++++++------ .../de.lproj/Localizable.strings | Bin 4906 -> 4880 bytes .../en.lproj/Localizable.strings | Bin 4722 -> 5140 bytes .../es.lproj/Localizable.strings | Bin 4840 -> 4824 bytes .../fr.lproj/Localizable.strings | Bin 4394 -> 4378 bytes .../it.lproj/Localizable.strings | Bin 3838 -> 3822 bytes .../ko.lproj/Localizable.strings | Bin 3412 -> 3396 bytes .../nl.lproj/Localizable.strings | Bin 3880 -> 3850 bytes .../pl.lproj/Localizable.strings | Bin 4314 -> 4298 bytes .../pt.lproj/Localizable.strings | Bin 3970 -> 3942 bytes .../ru.lproj/Localizable.strings | Bin 4936 -> 4920 bytes .../sk.lproj/Localizable.strings | Bin 3974 -> 3958 bytes .../sv.lproj/Localizable.strings | Bin 4764 -> 4734 bytes .../zh-Hans.lproj/Localizable.strings | Bin 3700 -> 3684 bytes 15 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Battery Time Remaining/AppDelegate.h b/Battery Time Remaining/AppDelegate.h index fa0ad64..66e3810 100644 --- a/Battery Time Remaining/AppDelegate.h +++ b/Battery Time Remaining/AppDelegate.h @@ -19,10 +19,10 @@ #define kBTRMenuSetting 6 #define kBTRMenuAdvanced 7 #define kBTRMenuParenthesis 8 -#define kBTRMenuEnergySaverSetting 9 -#define kBTRMenuUpdater 10 -#define kBTRMenuQuitKey 11 -#define kBTRMenuFahrenheit 12 +#define kBTRMenuFahrenheit 9 +#define kBTRMenuEnergySaverSetting 10 +#define kBTRMenuUpdater 11 +#define kBTRMenuQuitKey 12 #endif diff --git a/Battery Time Remaining/AppDelegate.m b/Battery Time Remaining/AppDelegate.m index daae876..ed62354 100644 --- a/Battery Time Remaining/AppDelegate.m +++ b/Battery Time Remaining/AppDelegate.m @@ -42,7 +42,7 @@ @interface AppDelegate () BOOL isOptionKeyPressed; BOOL isCapacityWarning; BOOL showParenthesis; - BOOL displayFahrenheit; + BOOL showFahrenheit; } - (void)cacheBatteryIcon; @@ -130,17 +130,17 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification parenthesisSubmenuItem.state = (showParenthesis) ? NSOnState : NSOffState; // Display in Fahrenheit menu item - NSMenuItem *displayFahrenheitSubmenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Display temperature in degrees Fahrenheit", @"Display temperature in Fahrenheit setting") action:@selector(toggleFahrenheit:) keyEquivalent:@""]; - [displayFahrenheitSubmenuItem setTag:kBTRMenuFahrenheit]; - displayFahrenheitSubmenuItem.target = self; - displayFahrenheit = [[NSUserDefaults standardUserDefaults] boolForKey:@"fahrenheit"]; - displayFahrenheitSubmenuItem.state = (displayFahrenheit) ? NSOnState : NSOffState; + NSMenuItem *fahrenheitSubmenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Display temperature in Fahrenheit", @"Display temperature in Fahrenheit setting") action:@selector(toggleFahrenheit:) keyEquivalent:@""]; + [fahrenheitSubmenuItem setTag:kBTRMenuFahrenheit]; + fahrenheitSubmenuItem.target = self; + showFahrenheit = [[NSUserDefaults standardUserDefaults] boolForKey:@"fahrenheit"]; + fahrenheitSubmenuItem.state = (showFahrenheit) ? NSOnState : NSOffState; // Build the setting submenu NSMenu *settingSubmenu = [[NSMenu alloc] initWithTitle:@"Setting Menu"]; [settingSubmenu addItem:advancedSubmenuItem]; [settingSubmenu addItem:parenthesisSubmenuItem]; - [settingSubmenu addItem:displayFahrenheitSubmenuItem]; + [settingSubmenu addItem:fahrenheitSubmenuItem]; // Settings menu item NSMenuItem *settingMenu = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Settings", @"Settings menuitem") action:nil keyEquivalent:@""]; @@ -387,12 +387,22 @@ - (void)updateStatusItemMenu unpluggedTimerCount / 3600, unpluggedTimerCount % 3600 / 60]; + // Temperature + NSString *fahrenheitTranslated; + if (showFahrenheit) { + fahrenheitTranslated = [NSString stringWithFormat:NSLocalizedString(@"Temperature: %.1f°F", @"Advanced battery info menuitem"), [self convertCelsiusToFahrenheit:[temperature doubleValue]]]; + } + else + { + fahrenheitTranslated = [NSString stringWithFormat:NSLocalizedString(@"Temperature: %.1f°C", @"Advanced battery info menuitem"), [temperature doubleValue]]; + } + // Each item in array will be a row in menu NSArray *advancedBatteryInfoTexts = [NSArray arrayWithObjects: [NSString stringWithFormat:NSLocalizedString(@"Cycle count: %ld", @"Advanced battery info menuitem"), [cycleCount integerValue]], [NSString stringWithFormat:NSLocalizedString(@"Power usage: %.2f Watt", @"Advanced battery info menuitem"), [watt doubleValue]], timeSinceUnpluggedTranslated, - (displayFahrenheit) ? [NSString stringWithFormat:NSLocalizedString(@"Temperature: %.1f°F", @"Advanced battery info menuitem"), [self convertCelsiusToFahrenheit:[temperature doubleValue]]] : [NSString stringWithFormat:NSLocalizedString(@"Temperature: %.1f°C", @"Advanced battery info menuitem"), [temperature doubleValue]], + fahrenheitTranslated, nil]; NSDictionary *advancedAttributedStyle = [NSDictionary dictionaryWithObjectsAndKeys: @@ -640,13 +650,13 @@ - (void)toggleFahrenheit:(id)sender if ([defaults boolForKey:@"fahrenheit"]) { item.state = NSOffState; - displayFahrenheit = NO; + showFahrenheit = NO; [defaults setBool:NO forKey:@"fahrenheit"]; } else { item.state = NSOnState; - displayFahrenheit = YES; + showFahrenheit = YES; [defaults setBool:YES forKey:@"fahrenheit"]; } [defaults synchronize]; @@ -829,4 +839,4 @@ - (void)menuDidClose:(NSMenu *)menu optionKeyPressedTimer = nil; } -@end +@end \ No newline at end of file diff --git a/Battery Time Remaining/de.lproj/Localizable.strings b/Battery Time Remaining/de.lproj/Localizable.strings index 9dcc92ecd7a63e8eab85704d8c1a7829e2adae45..1ee28021153c63e94c37ca113203664d7bf08507 100644 GIT binary patch delta 20 ccmZ3bHbHH}EY8VxoFbF=ahh!Y!>Pv!08wKHMF0Q* delta 42 vcmbQBwn}ZoEKc4OhE#@hh9V%D%1}J{KBwg54V*^o?m&@5hLp|sISn}h4z>(3 diff --git a/Battery Time Remaining/en.lproj/Localizable.strings b/Battery Time Remaining/en.lproj/Localizable.strings index 859afa1be948babdd7257576c80559b134a93c9c..deba2411edcde981efe1b317dea6f80520a10c3e 100644 GIT binary patch delta 197 zcmeyQGDTy6DMy9Ln=c$LlKZnWhmZU&l$-H0Ct`S&j0`b diff --git a/Battery Time Remaining/fr.lproj/Localizable.strings b/Battery Time Remaining/fr.lproj/Localizable.strings index fff5298579c64356afe4fbc25f9d2db8a928f11c..64b4dfa3ad376a95156a1c56767b6f0089783186 100644 GIT binary patch delta 16 YcmZ3bG)rm2JkH5ZoFbbKab~as05zipzW@LL delta 30 kcmbQGv`T5iJWk#ehE#@hh9V%D%1}Jno>P4DCe93Y0E|Kin*aa+ diff --git a/Battery Time Remaining/it.lproj/Localizable.strings b/Battery Time Remaining/it.lproj/Localizable.strings index 560ef6d9405305a95c7005d9b7bb4b73c9e49dbe..bea376250933cbd729a7d4f46298b8cec44b9b9c 100644 GIT binary patch delta 16 Ycmew-`%ZSl5%$R$>>`_Au#2$+06~ogcK`qY delta 26 gcmaDS`%iYm5q91bhE#@hh9V%D%22%dAiFL*0Dn{nJpcdz diff --git a/Battery Time Remaining/ko.lproj/Localizable.strings b/Battery Time Remaining/ko.lproj/Localizable.strings index e489a6563faa0b34d1ca56831946120c238a2ed1..6822528345c522284c1394c0b6c03dcd12bb4443 100644 GIT binary patch delta 16 Xcmca2bwp|d5BuZ|Y$BTt*j3m7GuZ_J delta 30 kcmX>ibwz3e4?AxPLn=c$LlKZnWhkD!mQ8%K0=o(u0EQR`-2eap diff --git a/Battery Time Remaining/nl.lproj/Localizable.strings b/Battery Time Remaining/nl.lproj/Localizable.strings index a0757cac6d41551973b84a9383067c4f9ab31bf1..a77b96364a16c6b48f1547ca37ae1775231656df 100644 GIT binary patch delta 19 acmZ1>*Cn@rV{!_I*km;hgUu-%N7w*AL2uP+f6i;5rE delta 26 gcmdm?c0z5#CQjZIhE#@hh9V%D%22#{J!dB;0Ck=SApigX diff --git a/Battery Time Remaining/sk.lproj/Localizable.strings b/Battery Time Remaining/sk.lproj/Localizable.strings index 2276003d0786f29869f2655ee20a5b4575294bcb..2ad2cb3d6e2122fdddb2e63f9246f51e9b7d7afa 100644 GIT binary patch delta 16 XcmZpZ|0cJ=gJbd=c9G3F98&B6H<<;T delta 26 gcmew+*CxNggM&APA(bJWp$JH(G8Aui>`^JI7HY0JQW4V delta 30 kcmaDN^F?NZ4F_)uLn=c$LlKZnWhkC}mtA~w0EY-00F=52qyPW_