mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 16:22:21 +00:00
using MacPass code style. Removed auto-open of path control as this annoys if MacPass gets focus
This commit is contained in:
@@ -21,26 +21,25 @@
|
||||
//
|
||||
|
||||
#import "MPKeyfilePathControlDelegate.h"
|
||||
|
||||
@implementation MPKeyfilePathControlDelegate
|
||||
|
||||
- (NSDragOperation)pathControl:(NSPathControl *)pathControl validateDrop:(id<NSDraggingInfo>)info {
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (void)pathControl:(NSPathControl *)pathControl willDisplayOpenPanel:(NSOpenPanel *)openPanel {
|
||||
}
|
||||
|
||||
- (void)pathControlDidBecomeKey:(NSPathControl *)control {
|
||||
if(control.URL) return;
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
panel.allowedFileTypes = control.allowedTypes;
|
||||
if([panel runModal] != NSModalResponseOK) return;
|
||||
|
||||
control.URL = panel.URL;
|
||||
});
|
||||
// if(control.URL) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
// panel.allowedFileTypes = control.allowedTypes;
|
||||
// if([panel runModal] != NSModalResponseOK) {
|
||||
// return;
|
||||
// }
|
||||
// control.URL = panel.URL;
|
||||
// });
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user