diff --git a/README.md b/README.md index 0e61df0..df91546 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Follow me on Twitter: [@nicoSWD](https://twitter.com/nicoSWD)! | Version | Downloads | |:----------:|:---------------:| -| **[put.io adder v3.0.4](https://github.com/nicoSWD/put.io-adder/releases/download/v3.0.4/put.io-adder-v3.0.4.zip)** | ![total](https://img.shields.io/github/downloads/nicoSWD/put.io-adder/total.svg?maxAge=25920) +| **[put.io adder v3.0.5](https://github.com/nicoSWD/put.io-adder/releases/download/v3.0.5/put.io-adder-v3.0.5.zip)** | ![total](https://img.shields.io/github/downloads/nicoSWD/put.io-adder/total.svg?maxAge=25920) (Older releases can be found [here](https://github.com/nicoSWD/put.io-adder/releases/)) diff --git a/put.io adder.xcodeproj/project.pbxproj b/put.io adder.xcodeproj/project.pbxproj index e33a9a6..1594433 100644 --- a/put.io adder.xcodeproj/project.pbxproj +++ b/put.io adder.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -54,6 +54,7 @@ 03AE9CBE17861CBA00A6E3EF /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03AE9CBD17861CBA00A6E3EF /* WebKit.framework */; }; 03AE9CC01786398200A6E3EF /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03AE9CBF1786398200A6E3EF /* Security.framework */; }; 03BCC0481895A2D300DF1FA3 /* puticon.png in Resources */ = {isa = PBXBuildFile; fileRef = 03BCC0471895A2D300DF1FA3 /* puticon.png */; }; + 03CA4EB82C0C78F800E211BD /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03CA4EB72C0C78F800E211BD /* UserNotifications.framework */; }; 03CD1E7719FAB1470047B927 /* logo2.png in Resources */ = {isa = PBXBuildFile; fileRef = 03CD1E7619FAB1470047B927 /* logo2.png */; }; 03DF597D17884AAB00AC96AA /* github.png in Resources */ = {isa = PBXBuildFile; fileRef = 03DF597B17884AAB00AC96AA /* github.png */; }; 03DF597E17884AAB00AC96AA /* github@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 03DF597C17884AAB00AC96AA /* github@2x.png */; }; @@ -159,6 +160,7 @@ 03AE9CBD17861CBA00A6E3EF /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 03AE9CBF1786398200A6E3EF /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 03BCC0471895A2D300DF1FA3 /* puticon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = puticon.png; path = Resources/puticon.png; sourceTree = ""; }; + 03CA4EB72C0C78F800E211BD /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; }; 03CD1E7619FAB1470047B927 /* logo2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo2.png; sourceTree = ""; }; 03DF597B17884AAB00AC96AA /* github.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = github.png; path = Resources/github.png; sourceTree = ""; }; 03DF597C17884AAB00AC96AA /* github@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "github@2x.png"; path = "Resources/github@2x.png"; sourceTree = ""; }; @@ -189,6 +191,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 03CA4EB82C0C78F800E211BD /* UserNotifications.framework in Frameworks */, 0307180E1A054D8F0099847C /* Quartz.framework in Frameworks */, 03AE9CC01786398200A6E3EF /* Security.framework in Frameworks */, 03AE9CBE17861CBA00A6E3EF /* WebKit.framework in Frameworks */, @@ -332,6 +335,7 @@ 03F630C616D6B5D400D33848 /* Frameworks */ = { isa = PBXGroup; children = ( + 03CA4EB72C0C78F800E211BD /* UserNotifications.framework */, 0307180D1A054D8F0099847C /* Quartz.framework */, 03AE9CBF1786398200A6E3EF /* Security.framework */, 03AE9CBD17861CBA00A6E3EF /* WebKit.framework */, @@ -440,12 +444,12 @@ 03F630BC16D6B5D300D33848 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; CLASSPREFIX = Putio; - LastUpgradeCheck = 0500; + LastUpgradeCheck = 1540; ORGANIZATIONNAME = "Nicolas Oelgart"; TargetAttributes = { 03F630C316D6B5D400D33848 = { - DevelopmentTeam = 8JR6HMQNDE; SystemCapabilities = { com.apple.Keychain = { enabled = 1; @@ -462,6 +466,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, es, de, @@ -587,19 +592,37 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -608,11 +631,13 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.7; + SDKROOT = macosx; }; name = Debug; }; @@ -620,25 +645,44 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; - SDKROOT = macosx10.7; + SDKROOT = macosx; }; name = Release; }; @@ -646,22 +690,26 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = "put.io adder/put.io adder.entitlements"; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_TEAM = 8JR6HMQNDE; + ENABLE_HARDENED_RUNTIME = YES; GCC_OPTIMIZATION_LEVEL = s; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "put.io adder/put.io adder-Prefix.pch"; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; INFOPLIST_FILE = "put.io adder/put.io adder-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 14.5; + PRODUCT_BUNDLE_IDENTIFIER = "com.nicoswd.put-io-adder"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "x86_64 i386"; + VALID_ARCHS = arm64; WRAPPER_EXTENSION = app; }; name = Debug; @@ -670,22 +718,26 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = "put.io adder/put.io adder.entitlements"; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_TEAM = 8JR6HMQNDE; + ENABLE_HARDENED_RUNTIME = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "put.io adder/put.io adder-Prefix.pch"; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; INFOPLIST_FILE = "put.io adder/put.io adder-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 14.5; ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.nicoswd.put-io-adder"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = ""; - VALID_ARCHS = "x86_64 i386"; + VALID_ARCHS = arm64; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/put.io adder.xcodeproj/project.xcworkspace/xcuserdata/Nico.xcuserdatad/UserInterfaceState.xcuserstate b/put.io adder.xcodeproj/project.xcworkspace/xcuserdata/Nico.xcuserdatad/UserInterfaceState.xcuserstate index 6adeead..a872904 100644 Binary files a/put.io adder.xcodeproj/project.xcworkspace/xcuserdata/Nico.xcuserdatad/UserInterfaceState.xcuserstate and b/put.io adder.xcodeproj/project.xcworkspace/xcuserdata/Nico.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/put.io adder.xcodeproj/xcuserdata/Nico.xcuserdatad/xcschemes/put.io adder.xcscheme b/put.io adder.xcodeproj/xcuserdata/Nico.xcuserdatad/xcschemes/put.io adder.xcscheme index f17075b..8be9d40 100644 --- a/put.io adder.xcodeproj/xcuserdata/Nico.xcuserdatad/xcschemes/put.io adder.xcscheme +++ b/put.io adder.xcodeproj/xcuserdata/Nico.xcuserdatad/xcschemes/put.io adder.xcscheme @@ -1,6 +1,6 @@ - - + shouldUseLaunchSchemeArgsEnv = "YES"> + + - + - - - + - - + shouldUseLaunchSchemeArgsEnv = "YES"> + + - + - - - + - - + shouldUseLaunchSchemeArgsEnv = "YES"> + + - + - - - + 0) { + if (self.putioController.transfers.count > 0) { PKTransfer *currentTransfer; PKTransfer *newTransfer; - for (unsigned i = 0; i < putioController.transfers.count; i++) { - currentTransfer = (PKTransfer*)[putioController.transfers objectAtIndex:i]; + for (unsigned i = 0; i < self.putioController.transfers.count; i++) { + currentTransfer = (PKTransfer*)[self.putioController.transfers objectAtIndex:i]; for (unsigned j = 0; j < putioTransfers.count; j++) { newTransfer = (PKTransfer*)[putioTransfers objectAtIndex:j]; @@ -135,12 +135,12 @@ - (void)updateUserInfo id badgeText = nil; if (pendingDownloads == 0) { - putioController.message.stringValue = [NSString stringWithFormat:NSLocalizedString(@"HELPER_NO_PENDING_TRANSFERS", nil), completedDownloads]; + self.putioController.message.stringValue = [NSString stringWithFormat:NSLocalizedString(@"HELPER_NO_PENDING_TRANSFERS", nil), completedDownloads]; } else { if (pendingDownloads == 1) { - putioController.message.stringValue = [NSString stringWithFormat:NSLocalizedString(@"HELPER_PENDING_TRANSFERS_SINGULAR", nil), completedDownloads]; + self.putioController.message.stringValue = [NSString stringWithFormat:NSLocalizedString(@"HELPER_PENDING_TRANSFERS_SINGULAR", nil), completedDownloads]; } else { - putioController.message.stringValue = [NSString stringWithFormat:NSLocalizedString(@"HELPER_PENDING_TRANSFERS_PURAL", nil), pendingDownloads, completedDownloads]; + self.putioController.message.stringValue = [NSString stringWithFormat:NSLocalizedString(@"HELPER_PENDING_TRANSFERS_PURAL", nil), pendingDownloads, completedDownloads]; } badgeText = [NSString stringWithFormat:@"%d%%", percentDone]; @@ -149,7 +149,7 @@ - (void)updateUserInfo [[[NSApplication sharedApplication] dockTile] setBadgeLabel:badgeText]; } failure:^(NSError *error) { - putioController.message.stringValue = NSLocalizedString(@"HELPER_TRANSFERS_FAILED", nil); + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_TRANSFERS_FAILED", nil); }]; } @@ -245,10 +245,10 @@ - (void)addMagnet:(NSString *)magnetURL [self.putioAPI requestTorrentOrMagnetURLAtPath:magnetURL :^(id userInfoObject) { if ([[NSUserDefaults standardUserDefaults] boolForKey:@"close.magnet"]) { - putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ADDED_CLOSING", nil); + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ADDED_CLOSING", nil); closeTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:[NSApplication sharedApplication] selector:@selector(terminate:) userInfo:nil repeats:NO]; } else { - putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ADDED", nil); + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ADDED", nil); // if ([PutioHelper sharedHelper].putioController.transfersAreHidden) { // [putioController.toggleTransfers mouseUp:nil]; @@ -256,15 +256,15 @@ - (void)addMagnet:(NSString *)magnetURL } [self updateUserInfo]; - [putioController.activityIndicator stopAnimation:nil]; + [self.putioController.activityIndicator stopAnimation:nil]; } addFailure:^ { - putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ERROR", nil); - [putioController.activityIndicator stopAnimation:nil]; + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ERROR", nil); + [self.putioController.activityIndicator stopAnimation:nil]; } networkFailure:^(NSError *error) { // Put.io returns HTTP 400 if you're adding an URL that's already in the queue... // ... and thereby causing AFNetworking to throw a network error. - putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_DUPLICATE", nil); - [putioController.activityIndicator stopAnimation:nil]; + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_DUPLICATE", nil); + [self.putioController.activityIndicator stopAnimation:nil]; }]; } @@ -278,22 +278,22 @@ - (void)uploadTorrent:(NSString*)filePath [self.putioAPI uploadFile:filePath :^(id userInfoObject) { if ([[NSUserDefaults standardUserDefaults] boolForKey:@"close.torrent"]) { - putioController.message.stringValue = NSLocalizedString(@"HELPER_TORRENT_ADDED_CLOSING", nil); + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_TORRENT_ADDED_CLOSING", nil); closeTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:[NSApplication sharedApplication] selector:@selector(terminate:) userInfo:nil repeats:NO]; } else { - putioController.message.stringValue = NSLocalizedString(@"HELPER_TORRENT_ADDED", nil); + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_TORRENT_ADDED", nil); } [self updateUserInfo]; - [putioController.activityIndicator stopAnimation:nil]; + [self.putioController.activityIndicator stopAnimation:nil]; } addFailure: ^{ - putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ERROR", nil); - [putioController.activityIndicator stopAnimation:nil]; + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_MAGNET_ERROR", nil); + [self.putioController.activityIndicator stopAnimation:nil]; } networkFailure:^(NSError *error) { // Put.io returns HTTP 400 if you're adding an URL that's already in the queue... // ... and thereby causing AFNetworking to throw a network error. - putioController.message.stringValue = NSLocalizedString(@"HELPER_TORRENT_DUPLICATE", nil); - [putioController.activityIndicator stopAnimation:nil]; + self.putioController.message.stringValue = NSLocalizedString(@"HELPER_TORRENT_DUPLICATE", nil); + [self.putioController.activityIndicator stopAnimation:nil]; }]; } diff --git a/put.io adder/PutioMainController.m b/put.io adder/PutioMainController.m index 8d44e15..ee6a618 100644 --- a/put.io adder/PutioMainController.m +++ b/put.io adder/PutioMainController.m @@ -70,7 +70,9 @@ - (IBAction)openGithub:(id)sender - (IBAction)openPrefefrences:(id)sender { - [NSApp beginSheet:prefSheet modalForWindow:(NSWindow *)putiowindow modalDelegate:self didEndSelector:nil contextInfo:nil]; + [putiowindow beginSheet:prefSheet completionHandler:^(NSModalResponse returnCode) { + // Handle the response if needed + }]; } - (IBAction)closePreferences:(id)sender @@ -220,13 +222,10 @@ - (void)streamVideo:(NSMenuItem *)sender // NSBundle *bundle = [NSBundle bundleWithIdentifier:@"org.videolan.vlc"]; if (bundle == nil) { - NSAlert *alert = [NSAlert - alertWithMessageText:@"Error" - defaultButton:@"Okay" - alternateButton:nil - otherButton:nil - informativeTextWithFormat:@"Unable to find VLC.app in /Applications" - ]; + NSAlert *alert = [[NSAlert alloc] init]; + alert.messageText = @"Error"; + alert.informativeText = @"Unable to find VLC.app in /Applications"; + [alert addButtonWithTitle:@"Okay"]; [alert runModal]; return; } @@ -266,4 +265,4 @@ - (void)openFileOnPutIO [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: url]]; } -@end \ No newline at end of file +@end diff --git a/put.io adder/PutioTextField.m b/put.io adder/PutioTextField.m index a444560..946528f 100644 --- a/put.io adder/PutioTextField.m +++ b/put.io adder/PutioTextField.m @@ -12,21 +12,21 @@ @implementation PutioTextField - (void)awakeFromNib { - NSString *fontFilePath = [[NSBundle mainBundle] resourcePath]; - NSURL *fontsURL = [NSURL fileURLWithPath:fontFilePath]; + NSString *fontFilePath = [[NSBundle mainBundle] pathForResource:@"Montserrat-Bold" ofType:@"ttf"]; + NSURL *fontURL = [NSURL fileURLWithPath:fontFilePath]; - if (fontsURL != nil) { - FSRef fsRef; - CFURLGetFSRef((CFURLRef)fontsURL, &fsRef); + if (fontURL != nil) { + CFErrorRef error; + bool success = CTFontManagerRegisterFontsForURL((CFURLRef)fontURL, kCTFontManagerScopeProcess, &error); - OSStatus status = ATSFontActivateFromFileReference(&fsRef, kATSFontContextLocal, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, NULL); - - if (status != noErr) { - NSLog(@"Unable to load fonts"); + if (!success) { + CFStringRef errorDescription = CFErrorCopyDescription(error); + NSLog(@"Unable to load fonts: %@", errorDescription); + CFRelease(errorDescription); } else { self.font = [NSFont fontWithName:@"Montserrat-Bold" size:12]; } - } + } } -@end \ No newline at end of file +@end diff --git a/put.io adder/put.io adder-Info.plist b/put.io adder/put.io adder-Info.plist index c7b49a4..fef3f2a 100644 --- a/put.io adder/put.io adder-Info.plist +++ b/put.io adder/put.io adder-Info.plist @@ -30,15 +30,15 @@ CFBundleExecutable put.io adder CFBundleIdentifier - com.nicoswd.put-io-adder + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName - Put.IO Adder + put.io adder CFBundlePackageType APPL CFBundleShortVersionString - 3.0.4 + 3.0.5 CFBundleSignature ???? CFBundleURLTypes @@ -65,7 +65,7 @@ CFBundleVersion - 604 + 605 DTCompiler DTPlatformBuild @@ -75,7 +75,7 @@ DTSDKBuild 12D75 DTSDKName - macosx10.8 + macosx14.5 DTXcode 0462 DTXcodeBuild @@ -83,9 +83,9 @@ LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion - 10.8 + 14.5 NSHumanReadableCopyright - Copyright © 2014-2016 Nicolas Oelgart (nicoswd.com). All rights reserved. + Copyright © 2014-2024 Nicolas Oelgart (nicoswd.com). All rights reserved. NSMainNibFile MainMenu NSPrincipalClass