Commit dfb262bd authored by Clément Stenac's avatar Clément Stenac

File type filters and implementation in WX. Refs:#24

Thanks to Steven Sheehy and sorry for the delay :)
parent f30c349b
...@@ -176,3 +176,14 @@ VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) ); ...@@ -176,3 +176,14 @@ VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) );
/* Useful text messages shared by interfaces */ /* Useful text messages shared by interfaces */
#define INTF_ABOUT_MSG LICENSE_MSG #define INTF_ABOUT_MSG LICENSE_MSG
#define EXTENSIONS_AUDIO "*.a52;*.aac;*.ac3;*.dts;*.flac;*.m4a;*.m4p;*.mka;" \
"*.mod;*.mp1;*.mp2;*.mp3;*.ogg;*.spx;*.wav;*.wma;*.xm"
#define EXTENSIONS_VIDEO "*.asf;*.avi;*.divx;*.dv;*.m1v;*.m2v;*.m4v;*.mkv;" \
"*.mov;*.mp2;*.mp4;*.mpeg;*.mpeg1;*.mpeg2;*.mpeg4;" \
"*.mpg;*.ogg;*.ogm;*.ps;*.ts;*.vob;*.wmv"
#define EXTENSIONS_PLAYLIST "*.asx;*.b4s;*.m3u;*.pls;*.vlc;*.xspf"
#define EXTENSIONS_SUBTITLE "*.idx;*.srt;*.sub;*.utf"
...@@ -430,6 +430,12 @@ void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event ) ...@@ -430,6 +430,12 @@ void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event )
p_file_dialog = new wxFileDialog( NULL, wxU(_("Open File")), p_file_dialog = new wxFileDialog( NULL, wxU(_("Open File")),
wxT(""), wxT(""), wxT("*"), wxOPEN | wxMULTIPLE ); wxT(""), wxT(""), wxT("*"), wxOPEN | wxMULTIPLE );
p_file_dialog->SetWildcard(wxU(_("All Files (*.*)|*"
"|Sound Files (*.mp3, *.ogg, etc.)|" EXTENSIONS_AUDIO
"|Video Files (*.avi, *.mpg, etc.)|" EXTENSIONS_VIDEO
"|Playlist Files (*.m3u, *.pls, etc.)|" EXTENSIONS_PLAYLIST
"|Subtitle Files (*.srt, *.sub, etc.)|" EXTENSIONS_SUBTITLE)));
if( p_file_dialog && p_file_dialog->ShowModal() == wxID_OK ) if( p_file_dialog && p_file_dialog->ShowModal() == wxID_OK )
{ {
wxArrayString paths; wxArrayString paths;
......
...@@ -1262,6 +1262,12 @@ void OpenDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) ) ...@@ -1262,6 +1262,12 @@ void OpenDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) )
file_dialog = new wxFileDialog( this, wxU(_("Open File")), file_dialog = new wxFileDialog( this, wxU(_("Open File")),
wxT(""), wxT(""), wxT("*"), wxOPEN | wxMULTIPLE ); wxT(""), wxT(""), wxT("*"), wxOPEN | wxMULTIPLE );
p_file_dialog->SetWildcard(wxU(_("All Files (*.*)|*"
"|Sound Files (*.mp3, *.ogg, etc.)|" EXTENSIONS_AUDIO
"|Video Files (*.avi, *.mpg, etc.)|" EXTENSIONS_VIDEO
"|Playlist Files (*.m3u, *.pls, etc.)|" EXTENSIONS_PLAYLIST
"|Subtitle Files (*.srt, *.sub, etc.)|" EXTENSIONS_SUBTITLE)));
if( file_dialog && file_dialog->ShowModal() == wxID_OK ) if( file_dialog && file_dialog->ShowModal() == wxID_OK )
{ {
wxArrayString paths; wxArrayString paths;
......
...@@ -971,7 +971,7 @@ void Playlist::OnSave( wxCommandEvent& WXUNUSED(event) ) ...@@ -971,7 +971,7 @@ void Playlist::OnSave( wxCommandEvent& WXUNUSED(event) )
void Playlist::OnOpen( wxCommandEvent& WXUNUSED(event) ) void Playlist::OnOpen( wxCommandEvent& WXUNUSED(event) )
{ {
wxFileDialog dialog( this, wxU(_("Open playlist")), wxT(""), wxT(""), wxFileDialog dialog( this, wxU(_("Open playlist")), wxT(""), wxT(""),
wxT("All playlists|*.pls;*.m3u;*.asx;*.b4s;*.xspf|XSPF playlist|*.xspf|M3U files|*.m3u"), wxOPEN ); wxT("All playlists|" EXTENSIONS_PLAYLIST "|XSPF playlist|*.xspf|M3U files|*.m3u"), wxOPEN );
if( dialog.ShowModal() == wxID_OK ) if( dialog.ShowModal() == wxID_OK )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment