Disable deprecation warnings for NS{Open,Save}Panel methods.

They will need to be replaced with the newer equivalents, but for now getting
dozens of warnings for each wxOSX build is just annoying, so get rid of them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-08-24 15:32:16 +00:00
parent 626aadf02f
commit 73c319ccde
2 changed files with 27 additions and 2 deletions

View File

@ -76,6 +76,12 @@ WX_NSOpenPanel wxDirDialog::OSXCreatePanel() const
return oPanel;
}
// We use several deprecated methods of NSOpenPanel in the code below, we
// should replace them with newer equivalents now that we don't support OS X
// versions which didn't have them (pre 10.6), but until then, get rid of
// the warning.
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
void wxDirDialog::ShowWindowModal()
{
wxNonOwnedWindow* parentWindow = NULL;
@ -133,4 +139,6 @@ void wxDirDialog::ModalFinishedCallback(void* panel, int returnCode)
SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED );
}
wxGCC_WARNING_RESTORE(deprecated-declarations)
#endif // wxUSE_DIRDLG

View File

@ -112,13 +112,18 @@ bool HasAppKit_10_6()
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
{
BOOL showObject = YES;
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
NSString* resolvedLink = [[NSFileManager defaultManager] pathContentOfSymbolicLinkAtPath:filename];
if ( resolvedLink != nil )
filename = resolvedLink;
NSDictionary* fileAttribs = [[NSFileManager defaultManager]
fileAttributesAtPath:filename traverseLink:YES];
wxGCC_WARNING_RESTORE(deprecated-declarations)
if (fileAttribs)
{
// check for packages
@ -335,6 +340,8 @@ void wxFileDialog::ShowWindowModal()
wxASSERT_MSG(parentWindow, "Window modal display requires parent.");
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
NSArray* types = GetTypesFromFilter( m_wildCard, m_filterNames, m_filterExtensions ) ;
if ( HasFlag(wxFD_SAVE) )
{
@ -378,6 +385,8 @@ void wxFileDialog::ShowWindowModal()
didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo: nil];
}
wxGCC_WARNING_RESTORE(deprecated-declarations)
}
// Create a panel with the file type drop down list
@ -582,6 +591,8 @@ int wxFileDialog::ShowModal()
}
}
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
if ( HasFlag(wxFD_SAVE) )
{
NSSavePanel* sPanel = [NSSavePanel savePanel];
@ -650,11 +661,15 @@ int wxFileDialog::ShowModal()
ModalFinishedCallback(oPanel, returnCode);
}
wxGCC_WARNING_RESTORE(deprecated-declarations)
return GetReturnCode();
}
void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode)
{
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
int result = wxID_CANCEL;
if (HasFlag(wxFD_SAVE))
{
@ -709,6 +724,8 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode)
if ( m_isNativeWindowWrapper )
UnsubclassWin();
[(NSSavePanel*) panel setAccessoryView:nil];
wxGCC_WARNING_RESTORE(deprecated-declarations)
}
#endif // wxUSE_FILEDLG