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>
<listitem><para>
<emphasis>dialog.file()</emphasis>: Show the "Open File" dialog box, with many options (stream output, subtitles, etc...).
</para></listitem>
<listitem><para>
<emphasis>dialog.directory()</emphasis>: Show the "Open Directory" dialog box (new after VLC 0.8.2).
</para></listitem>
<listitem><para>
<emphasis>dialog.disc()</emphasis>: Show the "Open Disc" dialog box.
</para></listitem>
......@@ -698,6 +701,9 @@ difficulty to understand how VLC skins work.</para>
<listitem><para>
<emphasis>dialogs.fileInfo()</emphasis>: Show the "File Info" dialog box.
</para></listitem>
<listitem><para>
<emphasis>dialogs.streamingWizard()</emphasis>: Show the "Streaming Wizard" dialog box (new after VLC 0.8.2).
</para></listitem>
<listitem><para>
<emphasis>dialogs.popup()</emphasis>: Show the popup menu, (already available with a right-click on a <link linkend="Image">Image</link> control).
</para></listitem>
......
......@@ -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;
......
......@@ -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 )
......
......@@ -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 )
......@@ -310,6 +320,15 @@ void Dialogs::showFileInfo()
}
void Dialogs::showStreamingWizard()
{
if( m_pProvider && m_pProvider->pf_show_dialog )
{
m_pProvider->pf_show_dialog( m_pProvider, INTF_DIALOG_WIZARD, 0, 0 );
}
}
void Dialogs::showPopupMenu( bool bShow )
{
if( m_pProvider && m_pProvider->pf_show_dialog )
......
......@@ -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 );
......
......@@ -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;
......
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