Commit 4936cc77 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Add a folder opening option with an icon, due to popular request,

    Clean some code, comment it and cosmetics.
    Fix also a cosmetic button bug spotted by funman.
parent 88b35bff
...@@ -73,11 +73,11 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput, ...@@ -73,11 +73,11 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
uriLine = new QLineEdit; uriLine = new QLineEdit;
QLabel *uriLabel = new QLabel( qtr( "Location :" ) ); QLabel *uriLabel = new QLabel( qtr( "Location :" ) );
layout->addWidget( IT, 0, 0, 1, 7 ); layout->addWidget( IT, 0, 0, 1, 8 );
layout->addWidget( closeButton, 2, 6 );
layout->addWidget( saveMetaButton, 2, 5 );
layout->addWidget( uriLabel, 1, 0, 1, 1 ); layout->addWidget( uriLabel, 1, 0, 1, 1 );
layout->addWidget( uriLine, 1, 1, 1, 6 ); layout->addWidget( uriLine, 1, 1, 1, 7 );
layout->addWidget( saveMetaButton, 2, 6 );
layout->addWidget( closeButton, 2, 7 );
BUTTONACT( closeButton, close() ); BUTTONACT( closeButton, close() );
......
...@@ -155,7 +155,7 @@ void DialogsProvider::gotoTimeDialog() ...@@ -155,7 +155,7 @@ void DialogsProvider::gotoTimeDialog()
void DialogsProvider::vlmDialog() void DialogsProvider::vlmDialog()
{ {
/* FIXME */ /* FIXME - Implement me */
/* VLMDialog::getInstance( p_intf )->toggleVisible(); */ /* VLMDialog::getInstance( p_intf )->toggleVisible(); */
} }
...@@ -181,14 +181,19 @@ void DialogsProvider::mediaCodecDialog() ...@@ -181,14 +181,19 @@ void DialogsProvider::mediaCodecDialog()
void DialogsProvider::bookmarksDialog() void DialogsProvider::bookmarksDialog()
{ {
/* FIXME */ /* FIXME - Implement me */
/* BookmarkDialog::getInstance( p_intf )->toggleVisible(); */ /* BookmarkDialog::getInstance( p_intf )->toggleVisible(); */
} }
/**************************************************************************** /****************************************************************************
* All the open/add stuff * 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() void DialogsProvider::openDialog()
{ {
openDialog( OPEN_FILE_TAB ); openDialog( OPEN_FILE_TAB );
...@@ -209,22 +214,25 @@ void DialogsProvider::openCaptureDialog() ...@@ -209,22 +214,25 @@ void DialogsProvider::openCaptureDialog()
{ {
openDialog( OPEN_CAPTURE_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() void DialogsProvider::PLAppendDialog()
{ {
OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, ENQUEUE ) OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, ENQUEUE)->showTab(0);
->showTab(0);
} }
/* Unimplemmented yet - Usefull ? */
void DialogsProvider::MLAppendDialog() 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 path )
{ {
QString fileTypes = ""; QString fileTypes = "";
...@@ -283,6 +291,42 @@ void DialogsProvider::simpleOpenDialog() ...@@ -283,6 +291,42 @@ void DialogsProvider::simpleOpenDialog()
addFromSimple( true, true ); 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 * * Playlist *
****************/ ****************/
...@@ -338,37 +382,12 @@ void DialogsProvider::savePlaylist() ...@@ -338,37 +382,12 @@ void DialogsProvider::savePlaylist()
delete qfd; 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 * Sout emulation
****************************************************************************/ ****************************************************************************/
//FIXME !!
void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only ) void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only )
{ {
SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf, SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf,
...@@ -447,11 +466,9 @@ void DialogsProvider::SDMenuAction( QString data ) ...@@ -447,11 +466,9 @@ void DialogsProvider::SDMenuAction( QString data )
playlist_ServicesDiscoveryAdd( THEPL, psz_sd ); playlist_ServicesDiscoveryAdd( THEPL, psz_sd );
else else
playlist_ServicesDiscoveryRemove( THEPL, psz_sd ); playlist_ServicesDiscoveryRemove( THEPL, psz_sd );
free( psz_sd ); free( psz_sd );
} }
void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg ) void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
{ {
InteractionDialog *qdialog; InteractionDialog *qdialog;
...@@ -486,7 +503,9 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg ) ...@@ -486,7 +503,9 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
void DialogsProvider::hideMenus() void DialogsProvider::hideMenus()
{ {
/* TODO */ /* TODO
* Simplify the main Interface
*/
} }
void DialogsProvider::switchToSkins() void DialogsProvider::switchToSkins()
......
...@@ -125,6 +125,11 @@ private: ...@@ -125,6 +125,11 @@ private:
void addFromSimple( bool, bool ); void addFromSimple( bool, bool );
public slots: public slots:
void doInteraction( intf_dialog_args_t * );
void menuAction( QObject *);
void menuUpdateAction( QObject *);
void SDMenuAction( QString );
void playlistDialog(); void playlistDialog();
void bookmarksDialog(); void bookmarksDialog();
void mediaInfoDialog(); void mediaInfoDialog();
...@@ -132,35 +137,38 @@ public slots: ...@@ -132,35 +137,38 @@ public slots:
void prefsDialog(); void prefsDialog();
void extendedDialog(); void extendedDialog();
void messagesDialog(); void messagesDialog();
void vlmDialog();
void helpDialog();
void aboutDialog();
void gotoTimeDialog();
void simpleOpenDialog();
void simplePLAppendDialog(); void simplePLAppendDialog();
void simpleMLAppendDialog(); void simpleMLAppendDialog();
void simpleOpenDialog();
void openDialog(); void openDialog();
void openDialog(int ); void openDialog( int );
void openDiscDialog();
void openFileDialog(); void openFileDialog();
void openNetDialog(); void openNetDialog();
void openCaptureDialog(); void openCaptureDialog();
void openDiscDialog(); void openDirDialog();
void PLAppendDialog(); void PLAppendDialog();
void MLAppendDialog(); void MLAppendDialog();
void doInteraction( intf_dialog_args_t * ); void PLAppendDir();
void menuAction( QObject *); void MLAppendDir();
void menuUpdateAction( QObject *);
void SDMenuAction( QString );
void streamingDialog( QString mrl = "", bool b_stream = true ); void streamingDialog( QString mrl = "", bool b_stream = true );
void openThenStreamingDialogs(); void openThenStreamingDialogs();
void openThenTranscodingDialogs(); void openThenTranscodingDialogs();
void openPlaylist(); void openPlaylist();
void savePlaylist(); void savePlaylist();
void PLAppendDir();
void MLAppendDir();
void quit();
void hideMenus(); void hideMenus();
void switchToSkins(); void switchToSkins();
void gotoTimeDialog(); void quit();
void vlmDialog();
void helpDialog();
void aboutDialog();
}; };
#endif #endif
...@@ -152,6 +152,7 @@ static int AudioAutoMenuBuilder( vlc_object_t *p_object, ...@@ -152,6 +152,7 @@ static int AudioAutoMenuBuilder( vlc_object_t *p_object,
/***************************************************************************** /*****************************************************************************
* All normal menus * All normal menus
* Simple Code
*****************************************************************************/ *****************************************************************************/
#define BAR_ADD( func, title ) { \ #define BAR_ADD( func, title ) { \
...@@ -163,6 +164,9 @@ static int AudioAutoMenuBuilder( vlc_object_t *p_object, ...@@ -163,6 +164,9 @@ static int AudioAutoMenuBuilder( vlc_object_t *p_object,
CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() ); \ CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() ); \
THEDP->menusUpdateMapper->setMapping( menu, f ); } THEDP->menusUpdateMapper->setMapping( menu, f ); }
/**
* Main Menu Bar Creation
**/
void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf, void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
bool playlist, bool adv_controls_enabled, bool playlist, bool adv_controls_enabled,
bool visual_selector_enabled ) bool visual_selector_enabled )
...@@ -176,11 +180,11 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf, ...@@ -176,11 +180,11 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
sigemptyset( &set ); sigemptyset( &set );
sigaddset( &set, SIGCHLD ); sigaddset( &set, SIGCHLD );
pthread_sigmask( SIG_UNBLOCK, &set, NULL ); pthread_sigmask( SIG_UNBLOCK, &set, NULL );
#endif #endif /* WIN32 */
QMenuBar *bar = mi->menuBar(); QMenuBar *bar = mi->menuBar();
#ifndef WIN32 #ifndef WIN32
pthread_sigmask( SIG_BLOCK, &set, NULL ); pthread_sigmask( SIG_BLOCK, &set, NULL );
#endif #endif /* WIN32 */
BAR_ADD( FileMenu(), qtr("&Media") ); BAR_ADD( FileMenu(), qtr("&Media") );
if( playlist ) if( playlist )
{ {
...@@ -194,11 +198,26 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf, ...@@ -194,11 +198,26 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
BAR_ADD( HelpMenu(), qtr("&Help" ) ); BAR_ADD( HelpMenu(), qtr("&Help" ) );
} }
/**
* Media (File) Menu
* Opening, streaming and quit
**/
QMenu *QVLCMenu::FileMenu() QMenu *QVLCMenu::FileMenu()
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
DP_SADD( menu, qtr("Open &File..." ), "", DP_SADD( menu, qtr("Open &File..." ), "",
":/pixmaps/vlc_file-asym_16px.png", openFileDialog(), "Ctrl+O" ); ":/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 &Disc..." ), "", "", openDiscDialog(), "Ctrl+D" );
DP_SADD( menu, qtr("Open &Network..." ), "", DP_SADD( menu, qtr("Open &Network..." ), "",
":/pixmaps/vlc_network_16px.png", openNetDialog(), "Ctrl+N" ); ":/pixmaps/vlc_network_16px.png", openNetDialog(), "Ctrl+N" );
...@@ -216,6 +235,7 @@ QMenu *QVLCMenu::FileMenu() ...@@ -216,6 +235,7 @@ QMenu *QVLCMenu::FileMenu()
return menu; return menu;
} }
/* Playlist Menu, undocked when playlist is undocked */
QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf ) QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf )
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
...@@ -230,6 +250,11 @@ QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf ) ...@@ -230,6 +250,11 @@ QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf )
return menu; 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, QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
bool adv_controls_enabled, bool adv_controls_enabled,
bool visual_selector_enabled, bool with_intf ) bool visual_selector_enabled, bool with_intf )
...@@ -248,8 +273,10 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, ...@@ -248,8 +273,10 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
DP_SADD( menu, qtr( I_MENU_CODECINFO ) , "", ":/pixmaps/vlc_info_16px.png", DP_SADD( menu, qtr( I_MENU_CODECINFO ) , "", ":/pixmaps/vlc_info_16px.png",
mediaCodecDialog(), "Ctrl+I" ); mediaCodecDialog(), "Ctrl+I" );
DP_SADD( menu, qtr( I_MENU_GOTOTIME ), "","", gotoTimeDialog(), "Ctrl+T" ); 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_BOOKMARK ), "","", bookmarksDialog(), "Ctrl+B" );
DP_SADD( menu, qtr( I_MENU_VLM ), "","", vlmDialog(), "Ctrl+V" ); DP_SADD( menu, qtr( I_MENU_VLM ), "","", vlmDialog(), "Ctrl+V" );
#endif
menu->addSeparator(); menu->addSeparator();
if( mi ) if( mi )
...@@ -258,7 +285,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, ...@@ -258,7 +285,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
mi, SLOT( advanced() ) ); mi, SLOT( advanced() ) );
adv->setCheckable( true ); adv->setCheckable( true );
if( adv_controls_enabled ) adv->setChecked( true ); if( adv_controls_enabled ) adv->setChecked( true );
#if 0 #if 0 /* For Visualisations. Not yet working */
adv = menu->addAction( qtr("Visualizations selector" ), adv = menu->addAction( qtr("Visualizations selector" ),
mi, SLOT( visual() ) ); mi, SLOT( visual() ) );
adv->setCheckable( true ); adv->setCheckable( true );
...@@ -268,12 +295,16 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, ...@@ -268,12 +295,16 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
} }
DP_SADD( menu, qtr( I_MENU_EXT ), "","",extendedDialog(), "Ctrl+E" ); DP_SADD( menu, qtr( I_MENU_EXT ), "","",extendedDialog(), "Ctrl+E" );
DP_SADD( menu, qtr( "Hide Menus..." ), "","",hideMenus(), "Ctrl+H" ); DP_SADD( menu, qtr( "Hide Menus..." ), "","",hideMenus(), "Ctrl+H" );
menu->addSeparator(); menu->addSeparator();
DP_SADD( menu, qtr("Preferences"), "", ":/pixmaps/vlc_preferences_16px.png", DP_SADD( menu, qtr("Preferences"), "", ":/pixmaps/vlc_preferences_16px.png",
prefsDialog(), "Ctrl+P" ); prefsDialog(), "Ctrl+P" );
return menu; return menu;
} }
/**
* Interface Sub-Menu, to list extras interface and skins
**/
QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current ) QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
{ {
vector<int> objects; vector<int> objects;
...@@ -296,6 +327,9 @@ QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -296,6 +327,9 @@ QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
return menu; return menu;
} }
/**
* Main Audio Menu
*/
QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current ) QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
{ {
vector<int> objects; vector<int> objects;
...@@ -319,7 +353,10 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current ) ...@@ -319,7 +353,10 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
return Populate( p_intf, current, varnames, 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 ) QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
{ {
vlc_object_t *p_object; vlc_object_t *p_object;
...@@ -345,6 +382,10 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -345,6 +382,10 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
return Populate( p_intf, current, varnames, objects ); 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 ) QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
{ {
vlc_object_t *p_object; vlc_object_t *p_object;
...@@ -364,6 +405,9 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -364,6 +405,9 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
return Populate( p_intf, current, varnames, objects ); return Populate( p_intf, current, varnames, objects );
} }
/**
* Service Discovery Menu
**/
QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
...@@ -389,7 +433,8 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) ...@@ -389,7 +433,8 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
while( p_parser->pp_shortcuts[++i] != NULL ); while( p_parser->pp_shortcuts[++i] != NULL );
i--; i--;
if( playlist_IsServicesDiscoveryLoaded( THEPL, 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 ); a->setChecked( true );
} }
...@@ -402,11 +447,14 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) ...@@ -402,11 +447,14 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
vlc_list_release( p_list ); vlc_list_release( p_list );
return menu; return menu;
} }
/**
* Help/About Menu
**/
QMenu *QVLCMenu::HelpMenu() QMenu *QVLCMenu::HelpMenu()
{ {
QMenu *menu = new QMenu(); 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(); menu->addSeparator();
DP_SADD( menu, qtr( I_MENU_ABOUT ), "", "", aboutDialog(), "Ctrl+F1"); DP_SADD( menu, qtr( I_MENU_ABOUT ), "", "", aboutDialog(), "Ctrl+F1");
return menu; return menu;
...@@ -414,7 +462,7 @@ QMenu *QVLCMenu::HelpMenu() ...@@ -414,7 +462,7 @@ QMenu *QVLCMenu::HelpMenu()
/***************************************************************************** /*****************************************************************************
* Popup menus * * Popup menus - Right Click menus *
*****************************************************************************/ *****************************************************************************/
#define POPUP_BOILERPLATE \ #define POPUP_BOILERPLATE \
unsigned int i_last_separator = 0; \ unsigned int i_last_separator = 0; \
...@@ -478,6 +526,7 @@ QMenu *QVLCMenu::HelpMenu() ...@@ -478,6 +526,7 @@ QMenu *QVLCMenu::HelpMenu()
\ \
DP_SADD( menu, qtr("Quit"), "", "", quit() , "Ctrl+Q" ); DP_SADD( menu, qtr("Quit"), "", "", quit() , "Ctrl+Q" );
/* Video Tracks and Subtitles tracks */
void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf ) void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
{ {
POPUP_BOILERPLATE; POPUP_BOILERPLATE;
...@@ -500,6 +549,7 @@ void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf ) ...@@ -500,6 +549,7 @@ void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
CREATE_POPUP; CREATE_POPUP;
} }
/* Audio Tracks */
void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf ) void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
{ {
POPUP_BOILERPLATE; POPUP_BOILERPLATE;
...@@ -520,7 +570,7 @@ void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf ) ...@@ -520,7 +570,7 @@ void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
CREATE_POPUP; CREATE_POPUP;
} }
/* Navigation stuff, and general */ /* Navigation stuff, and general menus (open) */
void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf ) void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
{ {
POPUP_BOILERPLATE; POPUP_BOILERPLATE;
...@@ -542,6 +592,7 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf ) ...@@ -542,6 +592,7 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
p_intf->p_sys->p_popup_menu = NULL; p_intf->p_sys->p_popup_menu = NULL;
} }
/* Main Menu that sticks everything together */
void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
{ {
if( show ) if( show )
...@@ -602,12 +653,17 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -602,12 +653,17 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
* Systray Menu * * Systray Menu *
************************************************************************/ ************************************************************************/
void QVLCMenu::updateSystrayMenu( MainInterface *mi, intf_thread_t *p_intf, void QVLCMenu::updateSystrayMenu( MainInterface *mi,
bool b_force_visible ) intf_thread_t *p_intf,
bool b_force_visible )
{ {
POPUP_BOILERPLATE; POPUP_BOILERPLATE;
/* Get the systray menu and clean it */
QMenu *sysMenu = mi->getSysTrayMenu(); QMenu *sysMenu = mi->getSysTrayMenu();
sysMenu->clear(); sysMenu->clear();
/* Hide / Show VLC and cone */
if( mi->isVisible() || b_force_visible ) if( mi->isVisible() || b_force_visible )
{ {
sysMenu->addAction( QIcon( ":/vlc16.png" ), sysMenu->addAction( QIcon( ":/vlc16.png" ),
...@@ -620,14 +676,17 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, intf_thread_t *p_intf, ...@@ -620,14 +676,17 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, intf_thread_t *p_intf,
qtr("Show VLC media player"), mi, qtr("Show VLC media player"), mi,
SLOT( toggleUpdateSystrayMenu() ) ); SLOT( toggleUpdateSystrayMenu() ) );
} }
sysMenu->addSeparator(); sysMenu->addSeparator();
POPUP_PLAY_ENTRIES( sysMenu ); POPUP_PLAY_ENTRIES( sysMenu );
sysMenu->addSeparator(); sysMenu->addSeparator();
DP_SADD( sysMenu, qtr("&Open Media" ), "", DP_SADD( sysMenu, qtr("&Open Media" ), "",
":/pixmaps/vlc_file-wide_16px.png", openFileDialog(), "" ); ":/pixmaps/vlc_file-wide_16px.png", openFileDialog(), "" );
DP_SADD( sysMenu, qtr("&Quit") , "", ":/pixmaps/vlc_quit_16px.png", DP_SADD( sysMenu, qtr("&Quit") , "", ":/pixmaps/vlc_quit_16px.png",
quit(), "" ); quit(), "" );
/* Set the menu */
mi->getSysTray()->setContextMenu( sysMenu ); mi->getSysTray()->setContextMenu( sysMenu );
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<file>pixmaps/vlc_quit_16px.png</file> <file>pixmaps/vlc_quit_16px.png</file>
<file>pixmaps/vlc_file-asym_16px.png</file> <file>pixmaps/vlc_file-asym_16px.png</file>
<file>pixmaps/vlc_file-wide_16px.png</file> <file>pixmaps/vlc_file-wide_16px.png</file>
<file>pixmaps/vlc_folder-grey_16px.png</file>
<file>pixmaps/vlc_capture-card_16px.png</file> <file>pixmaps/vlc_capture-card_16px.png</file>
<file>pixmaps/vlc_preferences_16px.png</file> <file>pixmaps/vlc_preferences_16px.png</file>
<file>pixmaps/vlc_stream_16px.png</file> <file>pixmaps/vlc_stream_16px.png</file>
......
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