diff options
author | culler <culler> | 2017-11-27 01:19:55 (GMT) |
---|---|---|
committer | culler <culler> | 2017-11-27 01:19:55 (GMT) |
commit | 18f5785d52c173bb4acf4b346ed375bd31cc83e3 (patch) | |
tree | 5f43f329d3bc1d14e5d15bfeeb2e9000072780a3 /macosx/tkMacOSXDialog.c | |
parent | 1a9ed03cff3ca2e3ce2fba690a478d0651c55d12 (diff) | |
download | tk-18f5785d52c173bb4acf4b346ed375bd31cc83e3.zip tk-18f5785d52c173bb4acf4b346ed375bd31cc83e3.tar.gz tk-18f5785d52c173bb4acf4b346ed375bd31cc83e3.tar.bz2 |
Remove all conditional code which requires a minimum deployment target
of OSX 10.5. Currently the build fails for 10.5 and it seems pointless
to try fixing it now, more than 8 years after Apple declared it obsolete.
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 96b1e0b..b98d6d8 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -169,7 +169,6 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = { * Construct a file URL from directory and filename. Either may * be nil. If both are nil, returns nil. */ -#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050 static NSURL *getFileURL(NSString *directory, NSString *filename) { NSURL *url = nil; if (directory) { @@ -180,7 +179,6 @@ static NSURL *getFileURL(NSString *directory, NSString *filename) { } return url; } -#endif #pragma mark TKApplication(TKDialog) @@ -716,17 +714,7 @@ Tk_GetOpenFileObjCmd( callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - parentIsKey = [parent isKeyWindow]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - [openpanel beginSheetForDirectory:directory - file:filename - types:openFileTypes - modalForWindow:parent - modalDelegate:NSApp - didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; -#else + parentIsKey = [parent isKeyWindow]; if (directory || filename ) { NSURL * fileURL = getFileURL(directory, filename); [openpanel setDirectoryURL:fileURL]; @@ -737,20 +725,14 @@ Tk_GetOpenFileObjCmd( { [NSApp tkFilePanelDidEnd:openpanel returnCode:returnCode contextInfo:callbackInfo ]; } ]; -#endif modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:openpanel]; } else { -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - modalReturnCode = [openpanel runModalForDirectory:directory - file:filename]; -#else if (directory || filename ) { NSURL * fileURL = getFileURL(directory, filename); [openpanel setDirectoryURL:fileURL]; } modalReturnCode = [openpanel runModal]; -#endif [NSApp tkFilePanelDidEnd:openpanel returnCode:modalReturnCode contextInfo:callbackInfo]; } @@ -1001,16 +983,7 @@ Tk_GetSaveFileObjCmd( parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { parentIsKey = [parent isKeyWindow]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - [savepanel beginSheetForDirectory:directory - file:filename - modalForWindow:parent - modalDelegate:NSApp - didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; -#else - if (directory) { + if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } /*check for file name, otherwise set to empty string; crashes with uncaught exception if set to nil*/ @@ -1024,12 +997,8 @@ Tk_GetSaveFileObjCmd( { [NSApp tkFilePanelDidEnd:savepanel returnCode:returnCode contextInfo:callbackInfo ]; } ]; -#endif modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:savepanel]; } else { -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - modalReturnCode = [savepanel runModalForDirectory:directory file:filename]; -#else if (directory) { [savepanel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; } @@ -1040,7 +1009,6 @@ Tk_GetSaveFileObjCmd( [savepanel setNameFieldStringValue:@""]; } modalReturnCode = [savepanel runModal]; -#endif [NSApp tkFilePanelDidEnd:savepanel returnCode:modalReturnCode contextInfo:callbackInfo]; } @@ -1172,30 +1140,17 @@ Tk_ChooseDirectoryObjCmd( } parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - parentIsKey = [parent isKeyWindow]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - [panel beginSheetForDirectory:directory - file:nil - modalForWindow:parent - modalDelegate:NSApp - didEndSelector: @selector(tkFilePanelDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; -#else + parentIsKey = [parent isKeyWindow]; [panel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; [panel beginSheetModalForWindow:parent completionHandler:^(NSInteger returnCode) { [NSApp tkFilePanelDidEnd:panel returnCode:returnCode contextInfo:callbackInfo ]; } ]; -#endif modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - modalReturnCode = [panel runModalForDirectory:directory file:nil]; -#else [panel setDirectoryURL:[NSURL fileURLWithPath:directory isDirectory:YES]]; modalReturnCode = [panel runModal]; -#endif [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } |