mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-16 04:42:36 +00:00
Fixed #1206 that would cancel version browsing in time machine if the key file open panel is shown
This commit is contained in:
@@ -68,12 +68,25 @@ NSString *const MPPathControlDidSetURLNotification = @"MPPathControlDidSetURLNot
|
||||
if([self.delegate respondsToSelector:@selector(pathControl:willDisplayOpenPanel:)]) {
|
||||
[self.delegate pathControl:self willDisplayOpenPanel:panel];
|
||||
}
|
||||
// fall back to modal sheet when browsing Versions. Otherwise we would get kicked out of the TimeMachien UI
|
||||
// #1206 See Unable to use Time Machine function when have a KeyFile
|
||||
// Setting NSDocumentRevisionsDebugMode=1 will prevent TimeMachien from exiting even when the openPanel is not shown as sheet
|
||||
NSDocument *document = self.window.windowController.document;
|
||||
if(document.isInViewingMode) {
|
||||
[panel beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse result) {
|
||||
if(result == NSModalResponseOK) {
|
||||
self.URL = panel.URLs.firstObject;
|
||||
}
|
||||
}];
|
||||
}
|
||||
else {
|
||||
[panel beginWithCompletionHandler:^(NSModalResponse result) {
|
||||
if(result == NSModalResponseOK) {
|
||||
self.URL = panel.URLs.firstObject;
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)pathControl:(NSPathControl *)pathControl willDisplayOpenPanel:(NSOpenPanel *)openPanel {
|
||||
openPanel.animationBehavior = NSWindowAnimationBehaviorDocumentWindow;
|
||||
|
||||
Reference in New Issue
Block a user