Set up extensions filter correctly in wxFileDialog in wxOSX
We need to call DoOnFilterSelected() to restrict the files that can be initially selected by the user to the filter. Closes #17415.
This commit is contained in:
@@ -69,6 +69,7 @@ wxMSW:
|
|||||||
wxOSX:
|
wxOSX:
|
||||||
|
|
||||||
- Remove extra borders around wxFilePickerCtrl (John Roberts).
|
- Remove extra borders around wxFilePickerCtrl (John Roberts).
|
||||||
|
- Set up extensions filter correctly in wxFileDialog (nick863).
|
||||||
- Turn off automatic quotes substitutions in wxTextCtrl (Xlord2).
|
- Turn off automatic quotes substitutions in wxTextCtrl (Xlord2).
|
||||||
|
|
||||||
|
|
||||||
|
@@ -606,7 +606,18 @@ int wxFileDialog::ShowModal()
|
|||||||
[oPanel setMessage:cf.AsNSString()];
|
[oPanel setMessage:cf.AsNSString()];
|
||||||
[oPanel setAllowsMultipleSelection: (HasFlag(wxFD_MULTIPLE) ? YES : NO )];
|
[oPanel setAllowsMultipleSelection: (HasFlag(wxFD_MULTIPLE) ? YES : NO )];
|
||||||
|
|
||||||
|
// Note that the test here is intentionally different from the one
|
||||||
|
// above, in the wxFD_SAVE case: we need to call DoOnFilterSelected()
|
||||||
|
// even for m_firstFileTypeFilter == 0, i.e. when using the default
|
||||||
|
// filter.
|
||||||
|
if ( m_firstFileTypeFilter >= 0 )
|
||||||
|
{
|
||||||
|
DoOnFilterSelected(m_firstFileTypeFilter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
[oPanel setAllowedFileTypes: (m_delegate == nil ? types : nil)];
|
[oPanel setAllowedFileTypes: (m_delegate == nil ? types : nil)];
|
||||||
|
}
|
||||||
if ( !m_dir.IsEmpty() )
|
if ( !m_dir.IsEmpty() )
|
||||||
[oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString()
|
[oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString()
|
||||||
isDirectory:YES]];
|
isDirectory:YES]];
|
||||||
|
Reference in New Issue
Block a user