Skip to content

Commit

Permalink
Reenable SSH/SSL file picker accessory view by default on OS X 10.11+ (
Browse files Browse the repository at this point in the history
  • Loading branch information
dmoagx committed Jan 28, 2017
1 parent bd75d9a commit ed51940
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Source/SPConnectionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ - (void)setShowsHiddenFiles:(BOOL)flag;
@end
#endif

#if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_11
@interface NSOpenPanel (NSOpenPanel_ElCaptian)

@property (getter=isAccessoryViewDisclosed) BOOL accessoryViewDisclosed;

@end
#endif

/**
* This is a utility function to validate SSL key/certificate files
* @param fileData The contents of the file
Expand Down Expand Up @@ -468,6 +476,10 @@ - (IBAction)chooseKeyLocation:(NSButton *)sender
keySelectionPanel = [[NSOpenPanel openPanel] retain]; // retain/release needed on OS X ≤ 10.6 according to Apple doc
[keySelectionPanel setShowsHiddenFiles:[prefs boolForKey:SPHiddenKeyFileVisibilityKey]];
[keySelectionPanel setAccessoryView:accessoryView];
//on os x 10.11+ the accessory view will be hidden by default and has to be made visible
if(accessoryView && [keySelectionPanel respondsToSelector:@selector(setAccessoryViewDisclosed:)]) {
[keySelectionPanel setAccessoryViewDisclosed:YES];
}
[keySelectionPanel setDelegate:self];
[keySelectionPanel beginSheetModalForWindow:[dbDocument parentWindow] completionHandler:^(NSInteger returnCode)
{
Expand Down
3 changes: 3 additions & 0 deletions Source/SPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ void _SPClear(id *addr);
#ifndef __MAC_10_10
#define __MAC_10_10 101000
#endif
#ifndef __MAC_10_11
#define __MAC_10_11 101100
#endif

// This enum is available since 10.5 but only got a "name" in 10.10
#if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_10
Expand Down

0 comments on commit ed51940

Please sign in to comment.