X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fwxwidgets%2Fdialogs.cpp;h=e9c602d14b37e2aa0d6a0195e969a1c21cee89ed;hb=70e52acc320da5881287947224f3c28e0e379e12;hp=ef47cb76838b599901a6caa472be7936ceb94428;hpb=bbdd3d86f120181b34f30a4844e9e33a44196da2;p=vlc diff --git a/modules/gui/wxwidgets/dialogs.cpp b/modules/gui/wxwidgets/dialogs.cpp index ef47cb7683..e9c602d14b 100644 --- a/modules/gui/wxwidgets/dialogs.cpp +++ b/modules/gui/wxwidgets/dialogs.cpp @@ -33,7 +33,19 @@ #include #include -#include "wxwidgets.h" +#include "charset.h" + +#include "dialogs/vlm/vlm_panel.hpp" +#include "dialogs/bookmarks.hpp" +#include "dialogs/wizard.hpp" +#include "dialogs/playlist.hpp" +#include "dialogs/open.hpp" +#include "dialogs/updatevlc.hpp" +#include "dialogs/fileinfo.hpp" +#include "dialogs/iteminfo.hpp" +#include "dialogs/preferences.hpp" +#include "dialogs/messages.hpp" +#include "interface.hpp" /* include the icon graphic */ #include "../../../share/vlc32x32.xpm" @@ -51,6 +63,7 @@ private: /* Event handlers (these functions should _not_ be virtual) */ void OnUpdateVLC( wxCommandEvent& event ); + void OnVLM( wxCommandEvent& event ); void OnExit( wxCommandEvent& event ); void OnPlaylist( wxCommandEvent& event ); void OnMessages( wxCommandEvent& event ); @@ -91,6 +104,7 @@ public: wxFrame *p_bookmarks_dialog; wxFileDialog *p_file_generic_dialog; UpdateVLC *p_updatevlc_dialog; + VLMFrame *p_vlm_dialog; }; DEFINE_LOCAL_EVENT_TYPE( wxEVT_DIALOG ); @@ -130,6 +144,8 @@ BEGIN_EVENT_TABLE(DialogsProvider, wxFrame) DialogsProvider::OnExitThread) EVT_COMMAND(INTF_DIALOG_UPDATEVLC, wxEVT_DIALOG, DialogsProvider::OnUpdateVLC) + EVT_COMMAND(INTF_DIALOG_VLM, wxEVT_DIALOG, + DialogsProvider::OnVLM) END_EVENT_TABLE() wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent ) @@ -156,6 +172,7 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent ) p_bookmarks_dialog = NULL; p_dir_dialog = NULL; p_updatevlc_dialog = NULL; + p_vlm_dialog = NULL; /* Give our interface a nice little icon */ p_intf->p_sys->p_icon = new wxIcon( vlc_xpm ); @@ -190,7 +207,7 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent ) INIT( ID_PLAYLIST, p_playlist_dialog, new Playlist(p_intf,this), ShowPlaylist ); INIT( ID_MESSAGES, p_messages_dialog, new Messages(p_intf,this), Show ); INIT( ID_FILE_INFO, p_fileinfo_dialog, new FileInfo(p_intf,this), Show ); - INIT( ID_BOOKMARKS, p_bookmarks_dialog, BookmarksDialog(p_intf,this), Show); + INIT( ID_BOOKMARKS, p_bookmarks_dialog, new BookmarksDialog(p_intf,this), Show); #undef INIT } @@ -214,7 +231,7 @@ DialogsProvider::~DialogsProvider() #undef UPDATE - PopEventHandler(true); + PopEventHandler(true); /* Clean up */ if( p_open_dialog ) delete p_open_dialog; @@ -227,6 +244,7 @@ DialogsProvider::~DialogsProvider() if( p_wizard_dialog ) delete p_wizard_dialog; if( p_bookmarks_dialog ) delete p_bookmarks_dialog; if( p_updatevlc_dialog ) delete p_updatevlc_dialog; + if( p_vlm_dialog ) delete p_vlm_dialog; if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon; @@ -318,7 +336,7 @@ void DialogsProvider::OnBookmarks( wxCommandEvent& WXUNUSED(event) ) { /* Show/hide the open dialog */ if( !p_bookmarks_dialog ) - p_bookmarks_dialog = BookmarksDialog( p_intf, this ); + p_bookmarks_dialog = new BookmarksDialog( p_intf, this ); if( p_bookmarks_dialog ) { @@ -405,7 +423,7 @@ void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event ) for( size_t i = 0; i < paths.GetCount(); i++ ) { - char *psz_utf8 = FromUTF32( paths[i].wc_str() ); + char *psz_utf8 = wxFromLocale( paths[i] ); if( event.GetInt() ) playlist_Add( p_playlist, psz_utf8, psz_utf8, PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), @@ -413,7 +431,7 @@ void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event ) else playlist_Add( p_playlist, psz_utf8, psz_utf8, PLAYLIST_APPEND, PLAYLIST_END ); - free( psz_utf8 ); + wxLocaleFree( psz_utf8 ); } } @@ -436,11 +454,11 @@ void DialogsProvider::OnOpenDirectory( wxCommandEvent& event ) if( p_dir_dialog && p_dir_dialog->ShowModal() == wxID_OK ) { wxString path = p_dir_dialog->GetPath(); - char *psz_utf8 = FromUTF32( path.wc_str() ); + char *psz_utf8 = wxFromLocale( path ); playlist_Add( p_playlist, psz_utf8, psz_utf8, PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0), PLAYLIST_END ); - free( psz_utf8 ); + wxLocaleFree( psz_utf8 ); } vlc_object_release( p_playlist ); @@ -501,3 +519,15 @@ void DialogsProvider::OnUpdateVLC( wxCommandEvent& WXUNUSED(event) ) p_updatevlc_dialog->Show( !p_updatevlc_dialog->IsShown() ); } } + +void DialogsProvider::OnVLM( wxCommandEvent& WXUNUSED(event) ) +{ + /* Show/hide the file info window */ + if( !p_vlm_dialog ) + p_vlm_dialog = new VLMFrame( p_intf, this ); + + if( p_vlm_dialog ) + { + p_vlm_dialog->Show( !p_vlm_dialog->IsShown() ); + } +}