void DialogsProvider::vlmDialog()
{
- /* FIXME */
+ /* FIXME - Implement me */
/* VLMDialog::getInstance( p_intf )->toggleVisible(); */
}
void DialogsProvider::bookmarksDialog()
{
- /* FIXME */
+ /* FIXME - Implement me */
/* BookmarkDialog::getInstance( p_intf )->toggleVisible(); */
}
/****************************************************************************
* All the open/add stuff
+ * Open Dialog first - Simple Open then
****************************************************************************/
+void DialogsProvider::openDialog( int i_tab )
+{
+ OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf )->showTab( i_tab );
+}
void DialogsProvider::openDialog()
{
openDialog( OPEN_FILE_TAB );
{
openDialog( OPEN_CAPTURE_TAB );
}
-void DialogsProvider::openDialog( int i_tab )
-{
- OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf )->showTab( i_tab );
-}
+/* Same as the open one, but force the enqueue */
void DialogsProvider::PLAppendDialog()
{
- OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, ENQUEUE )
- ->showTab(0);
+ OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, ENQUEUE)->showTab(0);
}
+
+/* Unimplemmented yet - Usefull ? */
void DialogsProvider::MLAppendDialog()
{
}
-/**** Simple open ****/
-QStringList DialogsProvider::showSimpleOpen( QString help, int filters,
+/**
+ * Simple open
+ * Not used anymore. Let the code until we are sure we don't want it
+ * Two opens make it confusing for the user.
+ ***/
+QStringList DialogsProvider::showSimpleOpen( QString help,
+ int filters,
QString path )
{
QString fileTypes = "";
addFromSimple( true, true );
}
+/* Directory */
+
+/**
+ * Open a directory,
+ * pl helps you to choose from playlist or media library,
+ * go to start or enqueue
+ **/
+static void openDirectory( intf_thread_t* p_intf, bool pl, bool go )
+{
+ QString dir = QFileDialog::getExistingDirectory ( 0, _("Open directory") );
+ if (!dir.isEmpty()) {
+ input_item_t *p_input = input_ItemNewExt( THEPL, qtu(dir), NULL,
+ 0, NULL, -1 );
+
+ playlist_AddInput( THEPL, p_input,
+ go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
+ PLAYLIST_END, pl, VLC_FALSE );
+ input_Read( THEPL, p_input, VLC_FALSE );
+ }
+}
+
+void DialogsProvider::openDirDialog()
+{
+ openDirectory( p_intf, true, true );
+}
+
+void DialogsProvider::PLAppendDir()
+{
+ openDirectory( p_intf, true, false );
+}
+
+void DialogsProvider::MLAppendDir()
+{
+ openDirectory( p_intf, false , false );
+}
+
/****************
* Playlist *
****************/
delete qfd;
}
-static void openDirectory( intf_thread_t* p_intf, bool pl, bool go )
-{
- QString dir = QFileDialog::getExistingDirectory ( 0,
- _("Open directory") );
-
- if (!dir.isEmpty()) {
- input_item_t *p_input = input_ItemNewExt( THEPL, qtu(dir), NULL,
- 0, NULL, -1 );
-
- playlist_AddInput( THEPL, p_input,
- go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
- PLAYLIST_END, pl, VLC_FALSE );
- input_Read( THEPL, p_input, VLC_FALSE );
- }
-}
-
-void DialogsProvider::PLAppendDir()
-{
- openDirectory( p_intf, true, false );
-}
-
-void DialogsProvider::MLAppendDir()
-{
- openDirectory( p_intf, false , false );
-}
-
/****************************************************************************
* Sout emulation
****************************************************************************/
+//FIXME !!
void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only )
{
SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf,
playlist_ServicesDiscoveryAdd( THEPL, psz_sd );
else
playlist_ServicesDiscoveryRemove( THEPL, psz_sd );
-
free( psz_sd );
}
-
void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
{
InteractionDialog *qdialog;
void DialogsProvider::hideMenus()
{
- /* TODO */
+ /* TODO
+ * Simplify the main Interface
+ */
}
void DialogsProvider::switchToSkins()
/*****************************************************************************
* All normal menus
+ * Simple Code
*****************************************************************************/
#define BAR_ADD( func, title ) { \
CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() ); \
THEDP->menusUpdateMapper->setMapping( menu, f ); }
+/**
+ * Main Menu Bar Creation
+ **/
void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
bool playlist, bool adv_controls_enabled,
bool visual_selector_enabled )
sigemptyset( &set );
sigaddset( &set, SIGCHLD );
pthread_sigmask( SIG_UNBLOCK, &set, NULL );
-#endif
+#endif /* WIN32 */
QMenuBar *bar = mi->menuBar();
#ifndef WIN32
pthread_sigmask( SIG_BLOCK, &set, NULL );
-#endif
+#endif /* WIN32 */
BAR_ADD( FileMenu(), qtr("&Media") );
if( playlist )
{
BAR_ADD( HelpMenu(), qtr("&Help" ) );
}
+
+/**
+ * Media (File) Menu
+ * Opening, streaming and quit
+ **/
QMenu *QVLCMenu::FileMenu()
{
QMenu *menu = new QMenu();
DP_SADD( menu, qtr("Open &File..." ), "",
":/pixmaps/vlc_file-asym_16px.png", openFileDialog(), "Ctrl+O" );
+
+ /* Folder vs. Directory */
+#ifdef WIN32
+ DP_SADD( menu, qtr( "Open Folder..." ), "",
+ ":/pixmaps/vlc_folder-grey_16px.png", openDirDialog(), "Ctrl+F" );
+#else
+ DP_SADD( menu, qtr( "Open Directory..." ), "",
+ ":/pixmaps/vlc_folder-grey_16px.png", openDirDialog(), "Ctrl+F" );
+#endif /* WIN32 */
+
DP_SADD( menu, qtr("Open &Disc..." ), "", "", openDiscDialog(), "Ctrl+D" );
DP_SADD( menu, qtr("Open &Network..." ), "",
":/pixmaps/vlc_network_16px.png", openNetDialog(), "Ctrl+N" );
return menu;
}
+/* Playlist Menu, undocked when playlist is undocked */
QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf )
{
QMenu *menu = new QMenu();
return menu;
}
+/**
+ * Tools/View Menu
+ * This is kept in the same menu for now, but could change if it gets much
+ * longer.
+ **/
QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
bool adv_controls_enabled,
bool visual_selector_enabled, bool with_intf )
DP_SADD( menu, qtr( I_MENU_CODECINFO ) , "", ":/pixmaps/vlc_info_16px.png",
mediaCodecDialog(), "Ctrl+I" );
DP_SADD( menu, qtr( I_MENU_GOTOTIME ), "","", gotoTimeDialog(), "Ctrl+T" );
+#if 0 /* Not Implemented yet */
DP_SADD( menu, qtr( I_MENU_BOOKMARK ), "","", bookmarksDialog(), "Ctrl+B" );
DP_SADD( menu, qtr( I_MENU_VLM ), "","", vlmDialog(), "Ctrl+V" );
+#endif
menu->addSeparator();
if( mi )
mi, SLOT( advanced() ) );
adv->setCheckable( true );
if( adv_controls_enabled ) adv->setChecked( true );
-#if 0
+#if 0 /* For Visualisations. Not yet working */
adv = menu->addAction( qtr("Visualizations selector" ),
mi, SLOT( visual() ) );
adv->setCheckable( true );
}
DP_SADD( menu, qtr( I_MENU_EXT ), "","",extendedDialog(), "Ctrl+E" );
DP_SADD( menu, qtr( "Hide Menus..." ), "","",hideMenus(), "Ctrl+H" );
+
menu->addSeparator();
DP_SADD( menu, qtr("Preferences"), "", ":/pixmaps/vlc_preferences_16px.png",
prefsDialog(), "Ctrl+P" );
return menu;
}
+/**
+ * Interface Sub-Menu, to list extras interface and skins
+ **/
QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
{
vector<int> objects;
return menu;
}
+/**
+ * Main Audio Menu
+ */
QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
{
vector<int> objects;
return Populate( p_intf, current, varnames, objects );
}
-
+/**
+ * Main Video Menu
+ * Subtitles are part of Video.
+ **/
QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
{
vlc_object_t *p_object;
return Populate( p_intf, current, varnames, objects );
}
+/**
+ * Navigation Menu
+ * For DVD, MP4, MOV and other chapter based format
+ **/
QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
{
vlc_object_t *p_object;
return Populate( p_intf, current, varnames, objects );
}
+/**
+ * Service Discovery Menu
+ **/
QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
{
QMenu *menu = new QMenu();
while( p_parser->pp_shortcuts[++i] != NULL );
i--;
if( playlist_IsServicesDiscoveryLoaded( THEPL,
- i>=0?p_parser->pp_shortcuts[i] : p_parser->psz_object_name ) )
+ i>=0?p_parser->pp_shortcuts[i]
+ : p_parser->psz_object_name ) )
{
a->setChecked( true );
}
vlc_list_release( p_list );
return menu;
}
-
+/**
+ * Help/About Menu
+**/
QMenu *QVLCMenu::HelpMenu()
{
QMenu *menu = new QMenu();
- DP_SADD( menu, qtr("Help") , "", ":/pixmaps/vlc_help_16px.png", helpDialog(), "F1" );
+ DP_SADD( menu, qtr("Help") , "", ":/pixmaps/vlc_help_16px.png",
+ helpDialog(), "F1" );
menu->addSeparator();
DP_SADD( menu, qtr( I_MENU_ABOUT ), "", "", aboutDialog(), "Ctrl+F1");
return menu;
/*****************************************************************************
- * Popup menus *
+ * Popup menus - Right Click menus *
*****************************************************************************/
#define POPUP_BOILERPLATE \
unsigned int i_last_separator = 0; \
\
DP_SADD( menu, qtr("Quit"), "", "", quit() , "Ctrl+Q" );
+/* Video Tracks and Subtitles tracks */
void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
{
POPUP_BOILERPLATE;
CREATE_POPUP;
}
+/* Audio Tracks */
void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
{
POPUP_BOILERPLATE;
CREATE_POPUP;
}
-/* Navigation stuff, and general */
+/* Navigation stuff, and general menus (open) */
void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
{
POPUP_BOILERPLATE;
p_intf->p_sys->p_popup_menu = NULL;
}
+/* Main Menu that sticks everything together */
void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
{
if( show )
* Systray Menu *
************************************************************************/
-void QVLCMenu::updateSystrayMenu( MainInterface *mi, intf_thread_t *p_intf,
- bool b_force_visible )
+void QVLCMenu::updateSystrayMenu( MainInterface *mi,
+ intf_thread_t *p_intf,
+ bool b_force_visible )
{
POPUP_BOILERPLATE;
+
+ /* Get the systray menu and clean it */
QMenu *sysMenu = mi->getSysTrayMenu();
sysMenu->clear();
+
+ /* Hide / Show VLC and cone */
if( mi->isVisible() || b_force_visible )
{
sysMenu->addAction( QIcon( ":/vlc16.png" ),
qtr("Show VLC media player"), mi,
SLOT( toggleUpdateSystrayMenu() ) );
}
+
sysMenu->addSeparator();
POPUP_PLAY_ENTRIES( sysMenu );
+
sysMenu->addSeparator();
DP_SADD( sysMenu, qtr("&Open Media" ), "",
":/pixmaps/vlc_file-wide_16px.png", openFileDialog(), "" );
DP_SADD( sysMenu, qtr("&Quit") , "", ":/pixmaps/vlc_quit_16px.png",
quit(), "" );
+ /* Set the menu */
mi->getSysTray()->setContextMenu( sysMenu );
}