diff --git a/Gas Mask.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Gas Mask.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d18c63f..1d3e60b 100755 --- a/Gas Mask.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Gas Mask.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/sparkle-project/Sparkle.git", "state" : { - "revision" : "7918c1c8fc68baa37917eeaa67286b077ad5e393", - "version" : "1.27.1" + "revision" : "dda155c7d3ef38c53d29f8584cb2aad2a1a54dba", + "version" : "2.3.2" } } ], diff --git a/Info.plist b/Info.plist index bee1ca8..9a5c422 100755 --- a/Info.plist +++ b/Info.plist @@ -42,7 +42,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.6 + 0.8.7 CFBundleSignature ???? CFBundleURLTypes @@ -59,7 +59,7 @@ CFBundleVersion - 0.8.6 + 0.8.7 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} LSUIElement diff --git a/Source/FileUtil.m b/Source/FileUtil.m index d5136e3..4386ce4 100755 --- a/Source/FileUtil.m +++ b/Source/FileUtil.m @@ -27,7 +27,7 @@ @implementation FileUtil + (NSString*)dataDirectory { if (dataDirectory == nil) { - NSArray *array = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); + NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); dataDirectory = [[array objectAtIndex:0] stringByAppendingString:@"/Gas Mask/"]; } return dataDirectory; diff --git a/Source/HostsListView.m b/Source/HostsListView.m index e2c22b0..0dc6817 100755 --- a/Source/HostsListView.m +++ b/Source/HostsListView.m @@ -40,12 +40,12 @@ @implementation HostsListView - (void)awakeFromNib { - [self registerForDraggedTypes:[NSArray arrayWithObjects:NSPasteboardTypeString, NSFilenamesPboardType, nil]]; + [self registerForDraggedTypes:[NSArray arrayWithObjects:NSPasteboardTypeString, NSPasteboardTypeFileURL, nil]]; [self setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES]; [self setDraggingSourceOperationMask:NSDragOperationEvery forLocal:NO]; - [self setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList]; - + [self setStyle:NSTableViewStyleSourceList]; + NSTableColumn *tableColumn = [self tableColumnWithIdentifier:kColumnIdName]; cell = [[Cell alloc] init]; [cell setEditable:YES]; @@ -98,7 +98,7 @@ - (void)removeBadgesFromGroups #pragma mark - #pragma mark NSDraggingSource -- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation +- (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation { // Dragged item ended up in Trash if (operation == NSDragOperationDelete) { @@ -106,7 +106,7 @@ - (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NS [nc postNotificationName:DraggedFileShouldBeRemovedNotification object:nil]; } else { - [super draggedImage:image endedAt:screenPoint operation:operation]; + [super draggingSession:session endedAtPoint:screenPoint operation:operation]; } } diff --git a/Source/LocalHostsController.m b/Source/LocalHostsController.m index 6eff81f..815bb71 100755 --- a/Source/LocalHostsController.m +++ b/Source/LocalHostsController.m @@ -76,6 +76,9 @@ - (void)loadFiles } [hostsFiles addObject:hosts]; + // grossly sorting array every time we add a host? Probably there is a better way. + NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]; + [hostsFiles sortUsingDescriptors:[NSArray arrayWithObject:sort]]; } } } diff --git a/Source/Util.m b/Source/Util.m index 2193bd4..9e0d19b 100755 --- a/Source/Util.m +++ b/Source/Util.m @@ -54,8 +54,12 @@ + (BOOL) restartDNSResponder + (BOOL) isDarkMode { - NSAppearance *appearance = NSAppearance.currentAppearance; - return appearance.name == NSAppearanceNameDarkAqua; + NSAppearance *currentAppearance = NSAppearance.currentDrawingAppearance; + if (@available(macOS 10.14, *)) { + return currentAppearance.name == NSAppearanceNameDarkAqua; + } else { + return [[NSColor controlTextColor] isEqual:[NSColor whiteColor]]; + } } @end