mirror of
https://github.com/qemu/qemu.git
synced 2025-08-09 19:15:32 +00:00
ui/cocoa: Suppress NSFileHandlingPanelOKButton deprecation warning
OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and would rather you use NSModalResponseOK, which was introduced in OS 10.9. Use the recommended new constant name, with a backward compatibility define if we're building on an older OSX. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: John Arbuckle <programmingkidx@gmail.com> Message-id: 20180529181523.19185-1-peter.maydell@linaro.org
This commit is contained in:
parent
e609fa71e8
commit
b5725385d1
12
ui/cocoa.m
12
ui/cocoa.m
@ -44,6 +44,9 @@
|
|||||||
#ifndef MAC_OS_X_VERSION_10_6
|
#ifndef MAC_OS_X_VERSION_10_6
|
||||||
#define MAC_OS_X_VERSION_10_6 1060
|
#define MAC_OS_X_VERSION_10_6 1060
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MAC_OS_X_VERSION_10_9
|
||||||
|
#define MAC_OS_X_VERSION_10_9 1090
|
||||||
|
#endif
|
||||||
#ifndef MAC_OS_X_VERSION_10_10
|
#ifndef MAC_OS_X_VERSION_10_10
|
||||||
#define MAC_OS_X_VERSION_10_10 101000
|
#define MAC_OS_X_VERSION_10_10 101000
|
||||||
#endif
|
#endif
|
||||||
@ -79,6 +82,13 @@
|
|||||||
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
||||||
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||||
#endif
|
#endif
|
||||||
|
/* 10.13 deprecates NSFileHandlingPanelOKButton in favour of
|
||||||
|
* NSModalResponseOK, which was introduced in 10.9. Define
|
||||||
|
* it for older versions.
|
||||||
|
*/
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
|
||||||
|
#define NSModalResponseOK NSFileHandlingPanelOKButton
|
||||||
|
#endif
|
||||||
|
|
||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
|
|
||||||
@ -1218,7 +1228,7 @@ - (void)changeDeviceMedia:(id)sender
|
|||||||
[openPanel setCanChooseFiles: YES];
|
[openPanel setCanChooseFiles: YES];
|
||||||
[openPanel setAllowsMultipleSelection: NO];
|
[openPanel setAllowsMultipleSelection: NO];
|
||||||
[openPanel setAllowedFileTypes: supportedImageFileTypes];
|
[openPanel setAllowedFileTypes: supportedImageFileTypes];
|
||||||
if([openPanel runModal] == NSFileHandlingPanelOKButton) {
|
if([openPanel runModal] == NSModalResponseOK) {
|
||||||
NSString * file = [[[openPanel URLs] objectAtIndex: 0] path];
|
NSString * file = [[[openPanel URLs] objectAtIndex: 0] path];
|
||||||
if(file == nil) {
|
if(file == nil) {
|
||||||
NSBeep();
|
NSBeep();
|
||||||
|
Loading…
Reference in New Issue
Block a user