Commit e92bf3b7 authored by Olivier Teulière's avatar Olivier Teulière

* 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
parent 9a19fa79
...@@ -683,6 +683,9 @@ difficulty to understand how VLC skins work.</para> ...@@ -683,6 +683,9 @@ difficulty to understand how VLC skins work.</para>
<listitem><para> <listitem><para>
<emphasis>dialog.file()</emphasis>: Show the "Open File" dialog box, with many options (stream output, subtitles, etc...). <emphasis>dialog.file()</emphasis>: Show the "Open File" dialog box, with many options (stream output, subtitles, etc...).
</para></listitem> </para></listitem>
<listitem><para>
<emphasis>dialog.directory()</emphasis>: Show the "Open Directory" dialog box (new after VLC 0.8.2).
</para></listitem>
<listitem><para> <listitem><para>
<emphasis>dialog.disc()</emphasis>: Show the "Open Disc" dialog box. <emphasis>dialog.disc()</emphasis>: Show the "Open Disc" dialog box.
</para></listitem> </para></listitem>
...@@ -698,6 +701,9 @@ difficulty to understand how VLC skins work.</para> ...@@ -698,6 +701,9 @@ difficulty to understand how VLC skins work.</para>
<listitem><para> <listitem><para>
<emphasis>dialogs.fileInfo()</emphasis>: Show the "File Info" dialog box. <emphasis>dialogs.fileInfo()</emphasis>: Show the "File Info" dialog box.
</para></listitem> </para></listitem>
<listitem><para>
<emphasis>dialogs.streamingWizard()</emphasis>: Show the "Streaming Wizard" dialog box (new after VLC 0.8.2).
</para></listitem>
<listitem><para> <listitem><para>
<emphasis>dialogs.popup()</emphasis>: Show the popup menu, (already available with a right-click on a <link linkend="Image">Image</link> control). <emphasis>dialogs.popup()</emphasis>: Show the popup menu, (already available with a right-click on a <link linkend="Image">Image</link> control).
</para></listitem> </para></listitem>
......
...@@ -46,6 +46,8 @@ typedef CmdDialogs<10> CmdDlgHidePopupMenu; ...@@ -46,6 +46,8 @@ typedef CmdDialogs<10> CmdDlgHidePopupMenu;
typedef CmdDialogs<11> CmdDlgAdd; typedef CmdDialogs<11> CmdDlgAdd;
typedef CmdDialogs<12> CmdDlgPlaylistLoad; typedef CmdDialogs<12> CmdDlgPlaylistLoad;
typedef CmdDialogs<13> CmdDlgPlaylistSave; typedef CmdDialogs<13> CmdDlgPlaylistSave;
typedef CmdDialogs<14> CmdDlgDirectory;
typedef CmdDialogs<15> CmdDlgStreamingWizard;
/// Generic "Open dialog" command /// Generic "Open dialog" command
...@@ -107,6 +109,12 @@ class CmdDialogs: public CmdGeneric ...@@ -107,6 +109,12 @@ class CmdDialogs: public CmdGeneric
case 13: case 13:
pDialogs->showPlaylistSave(); pDialogs->showPlaylistSave();
break; break;
case 14:
pDialogs->showDirectory( true );
break;
case 15:
pDialogs->showStreamingWizard();
break;
default: default:
msg_Warn( getIntf(), "Unknown dialog type" ); msg_Warn( getIntf(), "Unknown dialog type" );
break; break;
......
...@@ -50,11 +50,13 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf ) ...@@ -50,11 +50,13 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
REGISTER_CMD( "dialogs.changeSkin()", CmdDlgChangeSkin ) REGISTER_CMD( "dialogs.changeSkin()", CmdDlgChangeSkin )
REGISTER_CMD( "dialogs.fileSimple()", CmdDlgFileSimple ) REGISTER_CMD( "dialogs.fileSimple()", CmdDlgFileSimple )
REGISTER_CMD( "dialogs.file()", CmdDlgFile ) REGISTER_CMD( "dialogs.file()", CmdDlgFile )
REGISTER_CMD( "dialogs.directory()", CmdDlgDirectory )
REGISTER_CMD( "dialogs.disc()", CmdDlgDisc ) REGISTER_CMD( "dialogs.disc()", CmdDlgDisc )
REGISTER_CMD( "dialogs.net()", CmdDlgNet ) REGISTER_CMD( "dialogs.net()", CmdDlgNet )
REGISTER_CMD( "dialogs.messages()", CmdDlgMessages ) REGISTER_CMD( "dialogs.messages()", CmdDlgMessages )
REGISTER_CMD( "dialogs.prefs()", CmdDlgPrefs ) REGISTER_CMD( "dialogs.prefs()", CmdDlgPrefs )
REGISTER_CMD( "dialogs.fileInfo()", CmdDlgFileInfo ) REGISTER_CMD( "dialogs.fileInfo()", CmdDlgFileInfo )
REGISTER_CMD( "dialogs.streamingWizard()", CmdDlgStreamingWizard )
REGISTER_CMD( "dialogs.popup()", CmdDlgShowPopupMenu ) REGISTER_CMD( "dialogs.popup()", CmdDlgShowPopupMenu )
REGISTER_CMD( "playlist.load()", CmdDlgPlaylistLoad ) REGISTER_CMD( "playlist.load()", CmdDlgPlaylistLoad )
REGISTER_CMD( "playlist.save()", CmdDlgPlaylistSave ) REGISTER_CMD( "playlist.save()", CmdDlgPlaylistSave )
......
...@@ -263,6 +263,16 @@ void Dialogs::showFile( bool play ) ...@@ -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 ) void Dialogs::showDisc( bool play )
{ {
if( m_pProvider && m_pProvider->pf_show_dialog ) if( m_pProvider && m_pProvider->pf_show_dialog )
...@@ -303,9 +313,18 @@ void Dialogs::showPrefs() ...@@ -303,9 +313,18 @@ void Dialogs::showPrefs()
void Dialogs::showFileInfo() 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 );
} }
} }
......
...@@ -33,8 +33,7 @@ ...@@ -33,8 +33,7 @@
class Dialogs: public SkinObject class Dialogs: public SkinObject
{ {
public: public:
/// Get the instance of Dialogs /// Get the instance of Dialogs (or NULL if initialization failed)
/// Returns NULL if initialization failed
static Dialogs *instance( intf_thread_t *pIntf ); static Dialogs *instance( intf_thread_t *pIntf );
/// Delete the instance of Dialogs /// Delete the instance of Dialogs
...@@ -49,20 +48,29 @@ class Dialogs: public SkinObject ...@@ -49,20 +48,29 @@ class Dialogs: public SkinObject
/// Show the Save Playlist dialog /// Show the Save Playlist dialog
void showPlaylistSave(); void showPlaylistSave();
/// Show the Quick Open File dialog. /** Show the Quick Open File dialog.
/// If play is false, just add the item in the playlist * If play is false, just add the item in the playlist
*/
void showFileSimple( bool play ); void showFileSimple( bool play );
/// Show the Open File dialog /** Show the Open File dialog
/// If play is false, just add the item in the playlist * If play is false, just add the item in the playlist
*/
void showFile( bool play ); void showFile( bool play );
/// Show the Open Disc dialog /** Show the Open Directory dialog
/// If play is false, just add the item in the playlist * 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 ); void showDisc( bool play );
/// Show the Open Network Stream dialog /** Show the Open Network Stream dialog
/// If play is false, just add the item in the playlist * If play is false, just add the item in the playlist
*/
void showNet( bool play ); void showNet( bool play );
/// Show the Messages dialog /// Show the Messages dialog
...@@ -74,6 +82,9 @@ class Dialogs: public SkinObject ...@@ -74,6 +82,9 @@ class Dialogs: public SkinObject
/// Show the FileInfo dialog /// Show the FileInfo dialog
void showFileInfo(); void showFileInfo();
/// Show the Streaming Wizard dialog
void showStreamingWizard();
/// Show the popup menu /// Show the popup menu
void showPopupMenu( bool bShow ); void showPopupMenu( bool bShow );
...@@ -96,9 +107,10 @@ class Dialogs: public SkinObject ...@@ -96,9 +107,10 @@ class Dialogs: public SkinObject
/// Initialization method /// Initialization method
bool init(); bool init();
/// Show a generic open/save dialog, initialized with the given /** Show a generic open/save dialog, initialized with the given
/// parameters * parameters
/// The 'flags' parameter is a logical or of the flags_t values * The 'flags' parameter is a logical or of the flags_t values
*/
void showFileGeneric( const string &rTitle, const string &rExtensions, void showFileGeneric( const string &rTitle, const string &rExtensions,
DlgCallback callback, int flags ); DlgCallback callback, int flags );
......
...@@ -81,7 +81,7 @@ void GenericLayout::onControlRelease( const CtrlGeneric &rCtrl ) ...@@ -81,7 +81,7 @@ void GenericLayout::onControlRelease( const CtrlGeneric &rCtrl )
void GenericLayout::addControl( CtrlGeneric *pControl, void GenericLayout::addControl( CtrlGeneric *pControl,
const Position &rPosition, int layer ) const Position &rPosition, int layer )
{ {
if( pControl ) if( pControl )
{ {
......
...@@ -88,6 +88,7 @@ enum ...@@ -88,6 +88,7 @@ enum
MenuDummy_Event = wxID_HIGHEST + 1000, MenuDummy_Event = wxID_HIGHEST + 1000,
OpenFileSimple_Event = wxID_HIGHEST + 1100, OpenFileSimple_Event = wxID_HIGHEST + 1100,
OpenFile_Event, OpenFile_Event,
OpenDirectory_Event,
OpenDisc_Event, OpenDisc_Event,
OpenNet_Event, OpenNet_Event,
OpenCapture_Event, OpenCapture_Event,
...@@ -114,6 +115,7 @@ END_EVENT_TABLE() ...@@ -114,6 +115,7 @@ END_EVENT_TABLE()
BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler) BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler)
EVT_MENU(OpenFileSimple_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenFileSimple_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenFile_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenFile_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenDirectory_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenDisc_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenDisc_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenNet_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenNet_Event, MenuEvtHandler::OnShowDialog)
EVT_MENU(OpenCapture_Event, MenuEvtHandler::OnShowDialog) EVT_MENU(OpenCapture_Event, MenuEvtHandler::OnShowDialog)
...@@ -128,6 +130,7 @@ wxMenu *OpenStreamMenu( intf_thread_t *p_intf ) ...@@ -128,6 +130,7 @@ wxMenu *OpenStreamMenu( intf_thread_t *p_intf )
wxMenu *menu = new wxMenu; wxMenu *menu = new wxMenu;
menu->Append( OpenFileSimple_Event, wxU(_("Quick &Open File...")) ); menu->Append( OpenFileSimple_Event, wxU(_("Quick &Open File...")) );
menu->Append( OpenFile_Event, wxU(_("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( OpenDisc_Event, wxU(_("Open &Disc...")) );
menu->Append( OpenNet_Event, wxU(_("Open &Network Stream...")) ); menu->Append( OpenNet_Event, wxU(_("Open &Network Stream...")) );
menu->Append( OpenCapture_Event, wxU(_("Open &Capture Device...")) ); menu->Append( OpenCapture_Event, wxU(_("Open &Capture Device...")) );
...@@ -891,6 +894,9 @@ void MenuEvtHandler::OnShowDialog( wxCommandEvent& event ) ...@@ -891,6 +894,9 @@ void MenuEvtHandler::OnShowDialog( wxCommandEvent& event )
case OpenFile_Event: case OpenFile_Event:
i_id = INTF_DIALOG_FILE; i_id = INTF_DIALOG_FILE;
break; break;
case OpenDirectory_Event:
i_id = INTF_DIALOG_DIRECTORY;
break;
case OpenDisc_Event: case OpenDisc_Event:
i_id = INTF_DIALOG_DISC; i_id = INTF_DIALOG_DISC;
break; break;
......
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