Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.8.6</string>
<string>0.8.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -59,7 +59,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>0.8.6</string>
<string>0.8.7</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key>
Expand Down
2 changes: 1 addition & 1 deletion Source/FileUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions Source/HostsListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -98,15 +98,15 @@ - (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) {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc postNotificationName:DraggedFileShouldBeRemovedNotification object:nil];
}
else {
[super draggedImage:image endedAt:screenPoint operation:operation];
[super draggingSession:session endedAtPoint:screenPoint operation:operation];
}
}

Expand Down
3 changes: 3 additions & 0 deletions Source/LocalHostsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions Source/Util.m
Original file line number Diff line number Diff line change
Expand Up @@ -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