Skip to content
This repository was archived by the owner on Jun 19, 2020. It is now read-only.

Commit fee57a5

Browse files
committed
Minor fixes in localization and docktile
1 parent e38b58d commit fee57a5

File tree

7 files changed

+37
-7
lines changed

7 files changed

+37
-7
lines changed

Apple Events.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
DD27D2F021447AC500CD5F6C /* SwiftProtobuf.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DD27D2E121447AA300CD5F6C /* SwiftProtobuf.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3434
DD27D2FD21447AE000CD5F6C /* ChromeCastCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD27D2FC21447AD700CD5F6C /* ChromeCastCore.framework */; };
3535
DD27D2FE21447AE400CD5F6C /* ChromeCastCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DD27D2FC21447AD700CD5F6C /* ChromeCastCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
36+
DD27D3022144837400CD5F6C /* Environment.plist in Resources */ = {isa = PBXBuildFile; fileRef = DD27D3012144837400CD5F6C /* Environment.plist */; };
37+
DD27D303214483EE00CD5F6C /* Environment.plist in Resources */ = {isa = PBXBuildFile; fileRef = DD27D3012144837400CD5F6C /* Environment.plist */; };
3638
DD2ACCD7214474ED000E8D7A /* EventsUI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DD2ACCCE214472C0000E8D7A /* EventsUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3739
DD2ACCD8214474FC000E8D7A /* EventsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD2ACCCE214472C0000E8D7A /* EventsUI.framework */; };
3840
DD4514501DBD30C7001464B0 /* EVTChromecastViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD45144F1DBD30C7001464B0 /* EVTChromecastViewController.m */; };
@@ -178,6 +180,7 @@
178180
DD27D2D321447A8D00CD5F6C /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; };
179181
DD27D2D621447AA300CD5F6C /* SwiftProtobuf.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftProtobuf.xcodeproj; path = "swift-protobuf/SwiftProtobuf.xcodeproj"; sourceTree = "<group>"; };
180182
DD27D2F721447AD700CD5F6C /* ChromeCastCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ChromeCastCore.xcodeproj; path = "swift-protobuf/../ChromeCastCore/ChromeCastCore.xcodeproj"; sourceTree = "<group>"; };
183+
DD27D3012144837400CD5F6C /* Environment.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Environment.plist; sourceTree = "<group>"; };
181184
DD45144E1DBD30C7001464B0 /* EVTChromecastViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EVTChromecastViewController.h; sourceTree = "<group>"; };
182185
DD45144F1DBD30C7001464B0 /* EVTChromecastViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EVTChromecastViewController.m; sourceTree = "<group>"; };
183186
DD9CEB0F1D8069BD00DE15D5 /* EVTVerboseLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EVTVerboseLogger.h; sourceTree = "<group>"; };
@@ -385,6 +388,7 @@
385388
DDF00EED1D7D9FB100418830 /* Resources */ = {
386389
isa = PBXGroup;
387390
children = (
391+
DD27D3012144837400CD5F6C /* Environment.plist */,
388392
DDF00EE51D7D9F9E00418830 /* Info.plist */,
389393
DDF00EE21D7D9F9E00418830 /* Main.storyboard */,
390394
DDF00EE01D7D9F9D00418830 /* Assets.xcassets */,
@@ -592,6 +596,7 @@
592596
DD00F2BD1D7E6EF7001049E6 /* IconMask.png in Resources */,
593597
DD00F2BA1D7E6EF7001049E6 /* DefaultIcon.png in Resources */,
594598
DD00F2BC1D7E6EF7001049E6 /* [email protected] in Resources */,
599+
DD27D303214483EE00CD5F6C /* Environment.plist in Resources */,
595600
DD00F2BE1D7E6EF7001049E6 /* [email protected] in Resources */,
596601
DD00F2BF1D7E6EF7001049E6 /* [email protected] in Resources */,
597602
DD00F2BB1D7E6EF7001049E6 /* [email protected] in Resources */,
@@ -603,6 +608,7 @@
603608
buildActionMask = 2147483647;
604609
files = (
605610
DDF00EE11D7D9F9D00418830 /* Assets.xcassets in Resources */,
611+
DD27D3022144837400CD5F6C /* Environment.plist in Resources */,
606612
DDF00EE41D7D9F9E00418830 /* Main.storyboard in Resources */,
607613
);
608614
runOnlyForDeploymentPostprocessing = 0;

Apple Events/EVTEnvironment.m

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import "EVTEnvironment.h"
1010

11+
@import os.log;
12+
1113
@interface EVTEnvironment ()
1214

1315
@property (nonatomic, copy) NSURL *baseURL;
@@ -45,16 +47,30 @@ + (instancetype)testEnvironment
4547
return testEnv;
4648
}
4749

50+
+ (NSURL *)__configurationFileURL
51+
{
52+
return [[NSBundle bundleForClass:[self class]] URLForResource:@"Environment" withExtension:@"plist"];
53+
}
54+
55+
+ (NSDictionary *)__environmentDictionary
56+
{
57+
return [NSDictionary dictionaryWithContentsOfURL:[self __configurationFileURL]];
58+
}
59+
4860
+ (instancetype)productionEnvironment
4961
{
5062
static EVTEnvironment *prodEnv;
5163
static dispatch_once_t onceToken;
5264
dispatch_once(&onceToken, ^{
5365
prodEnv = [[EVTEnvironment alloc] init];
5466

55-
NSString *eventHash = [NSBundle mainBundle].infoDictionary[@"EVTCurrentEventHash"];
67+
NSDictionary *config = [self __environmentDictionary];
68+
NSString *eventHash = config[@"EVTCurrentEventHash"];
5669
NSString *urlString = [NSString stringWithFormat:@"https://itunesevents.apple.com/%@/data/", eventHash];
5770

71+
os_log_t log = os_log_create("AppleEventsApp", "EVTEnvironment");
72+
os_log_info(log, "Current event hash: %{public}@", eventHash);
73+
5874
prodEnv.baseURL = [NSURL URLWithString:urlString];
5975

6076
prodEnv.stateCheckInterval = 60.0;

Apple Events/EVTEvent+Dictionary.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define kDatePlaceholder @"@@DATE@@"
3030
#define kYearPlaceholder @"@@YEAR@@"
3131
#define kMonthPlaceholder @"@@MONTH@@"
32+
#define kSyntaxMonthPlaceholder @"@@SYNTAX_MONTH@@"
3233
#define kLocationPlaceholder @"@@LOCATION@@"
3334

3435
#define kButtonComingSoonFormat @"APPLE_EVENTS.BUTTON_COMING_SOON"
@@ -196,6 +197,7 @@ + (NSString *)description:(NSString *)desc withDateTimePlaceholdersFilledWithDat
196197
output = [output stringByReplacingOccurrencesOfString:kDatePlaceholder withString:day];
197198
output = [output stringByReplacingOccurrencesOfString:kDatePlaceholder withString:day];
198199
output = [output stringByReplacingOccurrencesOfString:kMonthPlaceholder withString:month];
200+
output = [output stringByReplacingOccurrencesOfString:kSyntaxMonthPlaceholder withString:month];
199201
output = [output stringByReplacingOccurrencesOfString:kHour24Placeholder withString:hour24];
200202
output = [output stringByReplacingOccurrencesOfString:kHour12Placeholder withString:hour12];
201203
output = [output stringByReplacingOccurrencesOfString:kMinutePlaceholder withString:minute];

Apple Events/EVTEventsFetcher.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ - (void)fetchCurrentEventIdentifierCompletionHandler:(void (^)(NSError *, NSStri
186186
}
187187

188188
NSArray *identifiers = [eventsDict keysSortedByValueUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
189-
if ([[obj1 objectForKey:@"order"] integerValue] > [[obj2 objectForKey:@"order"] integerValue]) {
190-
return NSOrderedDescending;
191-
} else {
189+
if ([[obj1 objectForKey:@"live"] boolValue]) {
192190
return NSOrderedAscending;
191+
} else {
192+
return NSOrderedDescending;
193193
}
194194
}];
195195

Apple Events/EVTEventsViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ - (void)viewDidLoad
5959
self.eventsCache = [EVTEventsCache cache];
6060
self.fetcher = [[EVTEventsFetcher alloc] initWithEnvironment:[EVTEnvironment currentEnvironment] cache:self.eventsCache];
6161
self.stateProvider = [[EVTEventStateProvider alloc] initWithEnvironment:[EVTEnvironment currentEnvironment]];
62-
62+
6363
[self __configureAndInstallChildViewControllers];
6464

6565
[self loadEventsWithProgress:YES];

Apple Events/Environment.plist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>EVTCurrentEventHash</key>
6+
<string>c7c808b8426b5211088e00be67754024e0c3d171</string>
7+
</dict>
8+
</plist>

Apple Events/Info.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
<string>1.2</string>
2121
<key>CFBundleVersion</key>
2222
<string>30</string>
23-
<key>EVTCurrentEventHash</key>
24-
<string>c7c808b8426b5211088e00be67754024e0c3d171</string>
2523
<key>LSMinimumSystemVersion</key>
2624
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2725
<key>NSAppTransportSecurity</key>

0 commit comments

Comments
 (0)