Permalink
Browse files

Reenable SSH/SSL file picker accessory view by default on OS X 10.11+ (

  • Loading branch information...
dmoagx committed Jan 28, 2017
1 parent bd75d9a commit ed5194021547e62ba2bd3ef40a287543888ad837
Showing with 15 additions and 0 deletions.
  1. +12 −0 Source/SPConnectionController.m
  2. +3 −0 Source/SPConstants.h
@@ -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
@@ -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)
{
View
@@ -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

0 comments on commit ed51940

Please sign in to comment.