From e92bf3b72c8274aa5874a8cddb082e17f9560812 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Teuli=C3=A8re?= Date: Sun, 7 Aug 2005 10:56:07 +0000 Subject: [PATCH] * wxwidgets/menus.cpp: Added "Open Directory" in the wx popup menu * skins2: Added dialogs.directory() and dialogs.streamingWizard() actions * doc/skins/skins2-howto.xml: Updated the doc accordingly --- doc/skins/skins2-howto.xml | 6 ++++ modules/gui/skins2/commands/cmd_dialogs.hpp | 8 +++++ modules/gui/skins2/parser/interpreter.cpp | 2 ++ modules/gui/skins2/src/dialogs.cpp | 23 +++++++++++-- modules/gui/skins2/src/dialogs.hpp | 38 ++++++++++++++------- modules/gui/skins2/src/generic_layout.cpp | 2 +- modules/gui/wxwidgets/menus.cpp | 6 ++++ 7 files changed, 69 insertions(+), 16 deletions(-) diff --git a/doc/skins/skins2-howto.xml b/doc/skins/skins2-howto.xml index 22e94d8a3f..fcd70fae83 100644 --- a/doc/skins/skins2-howto.xml +++ b/doc/skins/skins2-howto.xml @@ -683,6 +683,9 @@ difficulty to understand how VLC skins work. dialog.file(): Show the "Open File" dialog box, with many options (stream output, subtitles, etc...). + + dialog.directory(): Show the "Open Directory" dialog box (new after VLC 0.8.2). + dialog.disc(): Show the "Open Disc" dialog box. @@ -698,6 +701,9 @@ difficulty to understand how VLC skins work. dialogs.fileInfo(): Show the "File Info" dialog box. + + dialogs.streamingWizard(): Show the "Streaming Wizard" dialog box (new after VLC 0.8.2). + dialogs.popup(): Show the popup menu, (already available with a right-click on a Image control). diff --git a/modules/gui/skins2/commands/cmd_dialogs.hpp b/modules/gui/skins2/commands/cmd_dialogs.hpp index d3862b9b1f..03c4dbc396 100644 --- a/modules/gui/skins2/commands/cmd_dialogs.hpp +++ b/modules/gui/skins2/commands/cmd_dialogs.hpp @@ -46,6 +46,8 @@ typedef CmdDialogs<10> CmdDlgHidePopupMenu; typedef CmdDialogs<11> CmdDlgAdd; typedef CmdDialogs<12> CmdDlgPlaylistLoad; typedef CmdDialogs<13> CmdDlgPlaylistSave; +typedef CmdDialogs<14> CmdDlgDirectory; +typedef CmdDialogs<15> CmdDlgStreamingWizard; /// Generic "Open dialog" command @@ -107,6 +109,12 @@ class CmdDialogs: public CmdGeneric case 13: pDialogs->showPlaylistSave(); break; + case 14: + pDialogs->showDirectory( true ); + break; + case 15: + pDialogs->showStreamingWizard(); + break; default: msg_Warn( getIntf(), "Unknown dialog type" ); break; diff --git a/modules/gui/skins2/parser/interpreter.cpp b/modules/gui/skins2/parser/interpreter.cpp index 0425b60e39..33cb53cd5c 100644 --- a/modules/gui/skins2/parser/interpreter.cpp +++ b/modules/gui/skins2/parser/interpreter.cpp @@ -50,11 +50,13 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf ) REGISTER_CMD( "dialogs.changeSkin()", CmdDlgChangeSkin ) REGISTER_CMD( "dialogs.fileSimple()", CmdDlgFileSimple ) REGISTER_CMD( "dialogs.file()", CmdDlgFile ) + REGISTER_CMD( "dialogs.directory()", CmdDlgDirectory ) REGISTER_CMD( "dialogs.disc()", CmdDlgDisc ) REGISTER_CMD( "dialogs.net()", CmdDlgNet ) REGISTER_CMD( "dialogs.messages()", CmdDlgMessages ) REGISTER_CMD( "dialogs.prefs()", CmdDlgPrefs ) REGISTER_CMD( "dialogs.fileInfo()", CmdDlgFileInfo ) + REGISTER_CMD( "dialogs.streamingWizard()", CmdDlgStreamingWizard ) REGISTER_CMD( "dialogs.popup()", CmdDlgShowPopupMenu ) REGISTER_CMD( "playlist.load()", CmdDlgPlaylistLoad ) REGISTER_CMD( "playlist.save()", CmdDlgPlaylistSave ) diff --git a/modules/gui/skins2/src/dialogs.cpp b/modules/gui/skins2/src/dialogs.cpp index 347fd9c689..713d8c3ebc 100644 --- a/modules/gui/skins2/src/dialogs.cpp +++ b/modules/gui/skins2/src/dialogs.cpp @@ -263,6 +263,16 @@ void Dialogs::showFile( bool play ) } +void Dialogs::showDirectory( bool play ) +{ + if( m_pProvider && m_pProvider->pf_show_dialog ) + { + m_pProvider->pf_show_dialog( m_pProvider, INTF_DIALOG_DIRECTORY, + (int)play, 0 ); + } +} + + void Dialogs::showDisc( bool play ) { if( m_pProvider && m_pProvider->pf_show_dialog ) @@ -303,9 +313,18 @@ void Dialogs::showPrefs() void Dialogs::showFileInfo() { - if( m_pProvider && m_pProvider->pf_show_dialog ) + if( m_pProvider && m_pProvider->pf_show_dialog ) + { + m_pProvider->pf_show_dialog( m_pProvider, INTF_DIALOG_FILEINFO, 0, 0 ); + } +} + + +void Dialogs::showStreamingWizard() +{ + if( m_pProvider && m_pProvider->pf_show_dialog ) { - m_pProvider->pf_show_dialog( m_pProvider, INTF_DIALOG_FILEINFO, 0, 0 ); + m_pProvider->pf_show_dialog( m_pProvider, INTF_DIALOG_WIZARD, 0, 0 ); } } diff --git a/modules/gui/skins2/src/dialogs.hpp b/modules/gui/skins2/src/dialogs.hpp index cf6fda5033..239f733998 100644 --- a/modules/gui/skins2/src/dialogs.hpp +++ b/modules/gui/skins2/src/dialogs.hpp @@ -33,8 +33,7 @@ class Dialogs: public SkinObject { public: - /// Get the instance of Dialogs - /// Returns NULL if initialization failed + /// Get the instance of Dialogs (or NULL if initialization failed) static Dialogs *instance( intf_thread_t *pIntf ); /// Delete the instance of Dialogs @@ -49,20 +48,29 @@ class Dialogs: public SkinObject /// Show the Save Playlist dialog void showPlaylistSave(); - /// Show the Quick Open File dialog. - /// If play is false, just add the item in the playlist + /** Show the Quick Open File dialog. + * If play is false, just add the item in the playlist + */ void showFileSimple( bool play ); - /// Show the Open File dialog - /// If play is false, just add the item in the playlist + /** Show the Open File dialog + * If play is false, just add the item in the playlist + */ void showFile( bool play ); - /// Show the Open Disc dialog - /// If play is false, just add the item in the playlist + /** Show the Open Directory dialog + * If play is false, just add the item in the playlist + */ + void showDirectory( bool play ); + + /** Show the Open Disc dialog + * If play is false, just add the item in the playlist + */ void showDisc( bool play ); - /// Show the Open Network Stream dialog - /// If play is false, just add the item in the playlist + /** Show the Open Network Stream dialog + * If play is false, just add the item in the playlist + */ void showNet( bool play ); /// Show the Messages dialog @@ -74,6 +82,9 @@ class Dialogs: public SkinObject /// Show the FileInfo dialog void showFileInfo(); + /// Show the Streaming Wizard dialog + void showStreamingWizard(); + /// Show the popup menu void showPopupMenu( bool bShow ); @@ -96,9 +107,10 @@ class Dialogs: public SkinObject /// Initialization method bool init(); - /// Show a generic open/save dialog, initialized with the given - /// parameters - /// The 'flags' parameter is a logical or of the flags_t values + /** Show a generic open/save dialog, initialized with the given + * parameters + * The 'flags' parameter is a logical or of the flags_t values + */ void showFileGeneric( const string &rTitle, const string &rExtensions, DlgCallback callback, int flags ); diff --git a/modules/gui/skins2/src/generic_layout.cpp b/modules/gui/skins2/src/generic_layout.cpp index e557f60d47..f89442453a 100644 --- a/modules/gui/skins2/src/generic_layout.cpp +++ b/modules/gui/skins2/src/generic_layout.cpp @@ -81,7 +81,7 @@ void GenericLayout::onControlRelease( const CtrlGeneric &rCtrl ) void GenericLayout::addControl( CtrlGeneric *pControl, - const Position &rPosition, int layer ) + const Position &rPosition, int layer ) { if( pControl ) { diff --git a/modules/gui/wxwidgets/menus.cpp b/modules/gui/wxwidgets/menus.cpp index b5ffdfca70..3e6ec89e34 100644 --- a/modules/gui/wxwidgets/menus.cpp +++ b/modules/gui/wxwidgets/menus.cpp @@ -88,6 +88,7 @@ enum MenuDummy_Event = wxID_HIGHEST + 1000, OpenFileSimple_Event = wxID_HIGHEST + 1100, OpenFile_Event, + OpenDirectory_Event, OpenDisc_Event, OpenNet_Event, OpenCapture_Event, @@ -114,6 +115,7 @@ END_EVENT_TABLE() BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler) EVT_MENU(OpenFileSimple_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenFile_Event, MenuEvtHandler::OnShowDialog) + EVT_MENU(OpenDirectory_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenDisc_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenNet_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenCapture_Event, MenuEvtHandler::OnShowDialog) @@ -128,6 +130,7 @@ wxMenu *OpenStreamMenu( intf_thread_t *p_intf ) wxMenu *menu = new wxMenu; menu->Append( OpenFileSimple_Event, wxU(_("Quick &Open File...")) ); menu->Append( OpenFile_Event, wxU(_("Open &File...")) ); + menu->Append( OpenDirectory_Event, wxU(_("Open D&irectory...")) ); menu->Append( OpenDisc_Event, wxU(_("Open &Disc...")) ); menu->Append( OpenNet_Event, wxU(_("Open &Network Stream...")) ); menu->Append( OpenCapture_Event, wxU(_("Open &Capture Device...")) ); @@ -891,6 +894,9 @@ void MenuEvtHandler::OnShowDialog( wxCommandEvent& event ) case OpenFile_Event: i_id = INTF_DIALOG_FILE; break; + case OpenDirectory_Event: + i_id = INTF_DIALOG_DIRECTORY; + break; case OpenDisc_Event: i_id = INTF_DIALOG_DISC; break; -- 2.39.2