Commit 76a63d03 authored by Clément Stenac's avatar Clément Stenac

Add a (default enabled) skinned-playlist option

It will show the dialogs provider playlist instead of the "playlist_window" window
parent 02a21822
...@@ -51,6 +51,7 @@ typedef CmdDialogs<14> CmdDlgDirectory; ...@@ -51,6 +51,7 @@ typedef CmdDialogs<14> CmdDlgDirectory;
typedef CmdDialogs<15> CmdDlgStreamingWizard; typedef CmdDialogs<15> CmdDlgStreamingWizard;
typedef CmdDialogs<16> CmdDlgPlaytreeLoad; typedef CmdDialogs<16> CmdDlgPlaytreeLoad;
typedef CmdDialogs<17> CmdDlgPlaytreeSave; typedef CmdDialogs<17> CmdDlgPlaytreeSave;
typedef CmdDialogs<18> CmdDlgPlaylist;
/// Generic "Open dialog" command /// Generic "Open dialog" command
...@@ -118,6 +119,9 @@ class CmdDialogs: public CmdGeneric ...@@ -118,6 +119,9 @@ class CmdDialogs: public CmdGeneric
case 15: case 15:
pDialogs->showStreamingWizard(); pDialogs->showStreamingWizard();
break; break;
case 18:
pDialogs->showPlaylist();
break;
default: default:
msg_Warn( getIntf(), "unknown dialog type" ); msg_Warn( getIntf(), "unknown dialog type" );
break; break;
......
...@@ -214,24 +214,34 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme ) ...@@ -214,24 +214,34 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
{ {
int leftPos = rAction.find( ".show()" ); int leftPos = rAction.find( ".show()" );
string windowId = rAction.substr( 0, leftPos ); string windowId = rAction.substr( 0, leftPos );
TopWindow *pWin = pTheme->getWindowById( windowId );
if( pWin ) if( windowId == "playlist_window" &&
!config_GetInt( getIntf(), "skinned-playlist") )
{ {
pCommand = new CmdShowWindow( getIntf(), pTheme->getWindowManager(), pCommand = new CmdDlgPlaylist( getIntf() );
*pWin );
} }
else else
{ {
// It was maybe the id of a popup TopWindow *pWin = pTheme->getWindowById( windowId );
Popup *pPopup = pTheme->getPopupById( windowId ); if( pWin )
if( pPopup )
{ {
pCommand = new CmdShowPopup( getIntf(), *pPopup ); pCommand = new CmdShowWindow( getIntf(),
pTheme->getWindowManager(),
*pWin );
} }
else else
{ {
msg_Err( getIntf(), "unknown window or popup (%s)", // It was maybe the id of a popup
windowId.c_str() ); Popup *pPopup = pTheme->getPopupById( windowId );
if( pPopup )
{
pCommand = new CmdShowPopup( getIntf(), *pPopup );
}
else
{
msg_Err( getIntf(), "unknown window or popup (%s)",
windowId.c_str() );
}
} }
} }
} }
...@@ -239,15 +249,24 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme ) ...@@ -239,15 +249,24 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
{ {
int leftPos = rAction.find( ".hide()" ); int leftPos = rAction.find( ".hide()" );
string windowId = rAction.substr( 0, leftPos ); string windowId = rAction.substr( 0, leftPos );
TopWindow *pWin = pTheme->getWindowById( windowId ); if( windowId == "playlist_window" &&
if( pWin ) ! config_GetInt( getIntf(), "skinned-playlist") )
{ {
pCommand = new CmdHideWindow( getIntf(), pTheme->getWindowManager(), pCommand = new CmdDlgPlaylist( getIntf() );
*pWin );
} }
else else
{ {
msg_Err( getIntf(), "unknown window (%s)", windowId.c_str() ); TopWindow *pWin = pTheme->getWindowById( windowId );
if( pWin )
{
pCommand = new CmdHideWindow( getIntf(),
pTheme->getWindowManager(),
*pWin );
}
else
{
msg_Err( getIntf(), "unknown window (%s)", windowId.c_str() );
}
} }
} }
......
...@@ -242,6 +242,14 @@ void Dialogs::showPlaylistSave() ...@@ -242,6 +242,14 @@ void Dialogs::showPlaylistSave()
showPlaylistSaveCB, kSAVE ); showPlaylistSaveCB, kSAVE );
} }
void Dialogs::showPlaylist()
{
if( m_pProvider && m_pProvider->pf_show_dialog )
{
m_pProvider->pf_show_dialog( m_pProvider, INTF_DIALOG_PLAYLIST,
0, 0 );
}
}
void Dialogs::showFileSimple( bool play ) void Dialogs::showFileSimple( bool play )
{ {
......
...@@ -86,6 +86,9 @@ class Dialogs: public SkinObject ...@@ -86,6 +86,9 @@ class Dialogs: public SkinObject
/// Show the Streaming Wizard dialog /// Show the Streaming Wizard dialog
void showStreamingWizard(); void showStreamingWizard();
/// Show the Playlist
void showPlaylist();
/// Show the popup menu /// Show the popup menu
void showPopupMenu( bool bShow ); void showPopupMenu( bool bShow );
......
...@@ -365,6 +365,9 @@ vlc_module_begin(); ...@@ -365,6 +365,9 @@ vlc_module_begin();
add_bool( "skins2-transparency", VLC_FALSE, NULL, SKINS2_TRANSPARENCY, add_bool( "skins2-transparency", VLC_FALSE, NULL, SKINS2_TRANSPARENCY,
SKINS2_TRANSPARENCY_LONG, VLC_FALSE ); SKINS2_TRANSPARENCY_LONG, VLC_FALSE );
#endif #endif
add_bool( "skinned-playlist", VLC_TRUE, NULL, SKINS2_TRANSPARENCY,
SKINS2_TRANSPARENCY_LONG, VLC_FALSE );
set_shortname( _("Skins")); set_shortname( _("Skins"));
set_description( _("Skinnable Interface") ); set_description( _("Skinnable Interface") );
set_capability( "interface", 30 ); set_capability( "interface", 30 );
......
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