Commit 08af2ba7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 Menu macro removal.

parent 5268bc2d
...@@ -78,12 +78,12 @@ void addMIMStaticEntry( intf_thread_t *p_intf, ...@@ -78,12 +78,12 @@ void addMIMStaticEntry( intf_thread_t *p_intf,
{ {
if( strlen( icon ) > 0 ) if( strlen( icon ) > 0 )
{ {
QAction *action = menu->addAction( text, THEMIM, SLOT( slot ) ); QAction *action = menu->addAction( text, THEMIM, member );
action->setIcon( QIcon( icon ) ); action->setIcon( QIcon( icon ) );
} }
else else
{ {
menu->addAction( text, THEMIM, SLOT( slot ) ); menu->addAction( text, THEMIM, member );
} }
} }
...@@ -213,6 +213,7 @@ QMenu *QVLCMenu::FileMenu() ...@@ -213,6 +213,7 @@ QMenu *QVLCMenu::FileMenu()
return menu; return menu;
} }
/* Playlist/MediaLibrary Control */
QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi ) QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi )
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
...@@ -235,6 +236,7 @@ QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi ) ...@@ -235,6 +236,7 @@ QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi )
* Tools/View Menu * Tools/View Menu
* This is kept in the same menu for now, but could change if it gets much * This is kept in the same menu for now, but could change if it gets much
* longer. * longer.
* This menu can be an interface menu but also a right click menu.
**/ **/
QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
MainInterface *mi, MainInterface *mi,
...@@ -481,28 +483,32 @@ QMenu *QVLCMenu::HelpMenu() ...@@ -481,28 +483,32 @@ QMenu *QVLCMenu::HelpMenu()
p_intf->p_sys->p_popup_menu = NULL; \ p_intf->p_sys->p_popup_menu = NULL; \
i_last_separator = 0; i_last_separator = 0;
#define POPUP_PLAY_ENTRIES( menu )\ void QVLCMenu::PopupMenuControlEntries( QMenu *menu,
if( p_input ) \ intf_thread_t *p_intf,
{ \ input_thread_t *p_input )
vlc_value_t val; \ {
var_Get( p_input, "state", &val ); \ if( p_input )
if( val.i_int == PLAYING_S ) \ {
addMIMStaticEntry( p_intf, menu, qtr( "Pause" ), "", \ vlc_value_t val;
":/pixmaps/pause_16px.png", SLOT( togglePlayPause() ) ); \ var_Get( p_input, "state", &val );
else \ if( val.i_int == PLAYING_S )
addMIMStaticEntry( p_intf, menu, qtr( "Play" ), "", \ addMIMStaticEntry( p_intf, menu, qtr( "Pause" ), "",
":/pixmaps/play_16px.png", SLOT( togglePlayPause() ) ); \ ":/pixmaps/pause_16px.png", SLOT( togglePlayPause() ) );
} \ else
else if( THEPL->items.i_size && THEPL->i_enabled ) \ addMIMStaticEntry( p_intf, menu, qtr( "Play" ), "",
addMIMStaticEntry( p_intf, menu, qtr( "Play" ), "", \ ":/pixmaps/play_16px.png", SLOT( togglePlayPause() ) );
":/pixmaps/play_16px.png", SLOT( togglePlayPause() ) ); \ }
\ else if( THEPL->items.i_size && THEPL->i_enabled )
addMIMStaticEntry( p_intf, menu, qtr( "Stop" ), "", \ addMIMStaticEntry( p_intf, menu, qtr( "Play" ), "",
":/pixmaps/stop_16px.png", SLOT( stop() ) ); \ ":/pixmaps/play_16px.png", SLOT( togglePlayPause() ) );
addMIMStaticEntry( p_intf, menu, qtr( "Previous" ), "", \
":/pixmaps/previous_16px.png", SLOT( prev() ) ); \ addMIMStaticEntry( p_intf, menu, qtr( "Stop" ), "",
addMIMStaticEntry( p_intf, menu, qtr( "Next" ), "", \ ":/pixmaps/stop_16px.png", SLOT( stop() ) );
addMIMStaticEntry( p_intf, menu, qtr( "Previous" ), "",
":/pixmaps/previous_16px.png", SLOT( prev() ) );
addMIMStaticEntry( p_intf, menu, qtr( "Next" ), "",
":/pixmaps/next_16px.png", SLOT( next() ) ); ":/pixmaps/next_16px.png", SLOT( next() ) );
}
void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu ) void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu )
{ {
...@@ -593,7 +599,7 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf ) ...@@ -593,7 +599,7 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
Populate( p_intf, menu, varnames, objects ); Populate( p_intf, menu, varnames, objects );
menu->addSeparator(); menu->addSeparator();
POPUP_PLAY_ENTRIES( menu ); PopupMenuControlEntries( menu, p_intf, p_input );
menu->addSeparator(); menu->addSeparator();
PopupMenuStaticEntries( p_intf, menu ); PopupMenuStaticEntries( p_intf, menu );
...@@ -647,7 +653,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -647,7 +653,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
Populate( p_intf, menu, varnames, objects ); Populate( p_intf, menu, varnames, objects );
menu->addSeparator(); menu->addSeparator();
POPUP_PLAY_ENTRIES( menu ); PopupMenuControlEntries( menu, p_intf, p_input );
menu->addSeparator(); menu->addSeparator();
PopupMenuStaticEntries( p_intf, menu ); PopupMenuStaticEntries( p_intf, menu );
...@@ -692,7 +698,7 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, ...@@ -692,7 +698,7 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi,
} }
sysMenu->addSeparator(); sysMenu->addSeparator();
POPUP_PLAY_ENTRIES( sysMenu ); PopupMenuControlEntries( sysMenu, p_intf, p_input );
sysMenu->addSeparator(); sysMenu->addSeparator();
addDPStaticEntry( sysMenu, qtr( "&Open Media" ), "", addDPStaticEntry( sysMenu, qtr( "&Open Media" ), "",
......
...@@ -92,6 +92,7 @@ public: ...@@ -92,6 +92,7 @@ public:
static void PopupMenu( intf_thread_t *, bool ); static void PopupMenu( intf_thread_t *, bool );
static void PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu ); static void PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu );
static void PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf, input_thread_t *p_input );
/* Systray */ /* Systray */
static void updateSystrayMenu( MainInterface *,intf_thread_t *, static void updateSystrayMenu( MainInterface *,intf_thread_t *,
bool b_force_visible = false); bool b_force_visible = false);
......
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