From d1ceadaf8bc7ccba0bc92d1d49d2c46d1f5f7fd5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Fri, 20 Feb 2009 10:22:46 +0100 Subject: [PATCH] Qt menus: add faster/slower/normal rate --- modules/gui/qt4/menus.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp index 1db4644363..a87725dc5f 100644 --- a/modules/gui/qt4/menus.cpp +++ b/modules/gui/qt4/menus.cpp @@ -721,9 +721,12 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf, input_thread_t *p_input ) { + QAction *action; + + /* Play or Pause action and icon */ if( !p_input || var_GetInteger( p_input, "state" ) != PLAYING_S ) { - QAction *action = menu->addAction( qtr( "Play" ), + action = menu->addAction( qtr( "Play" ), ActionsManager::getInstance( p_intf ), SLOT( play() ) ); action->setIcon( QIcon( ":/play" ) ); } @@ -733,8 +736,24 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, ":/pause", SLOT( togglePlayPause() ) ); } + /* Stop */ addMIMStaticEntry( p_intf, menu, qtr( "Stop" ), ":/stop", SLOT( stop() ) ); + + /* Faster/Slower */ + action = menu->addAction( qtr( "Faster" ), THEMIM->getIM(), SLOT( faster() ) ); + action->setIcon( QIcon( ":/faster") ); + menu->addAction( qtr( "Normal Speed" ), THEMIM->getIM(), SLOT( normalRate() ) ); + action = menu->addAction( qtr( "Slower" ), THEMIM->getIM(), SLOT( slower() ) ); + action->setIcon( QIcon( ":/slower") ); +} + + +void QVLCMenu::PopupMenuPlaylistControlEntries( QMenu *menu, + intf_thread_t *p_intf, + input_thread_t *p_input ) +{ + /* Next / Previous */ addMIMStaticEntry( p_intf, menu, qtr( "Previous" ), ":/previous", SLOT( prev() ) ); addMIMStaticEntry( p_intf, menu, qtr( "Next" ), @@ -822,6 +841,9 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf ) menu->addSeparator(); PopupMenuControlEntries( menu, p_intf, p_input ); + menu->addSeparator(); + PopupMenuPlaylistControlEntries( menu, p_intf, p_input ); + menu->addSeparator(); PopupMenuStaticEntries( menu ); @@ -850,6 +872,9 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) PopupMenuControlEntries( menu, p_intf, p_input ); menu->addSeparator(); + PopupMenuPlaylistControlEntries( menu, p_intf, p_input ); + menu->addSeparator(); + if( p_input ) { vout_thread_t *p_vout = THEMIM->getVout(); @@ -989,6 +1014,7 @@ void QVLCMenu::updateSystrayMenu( MainInterface *mi, sysMenu->addSeparator(); PopupMenuControlEntries( sysMenu, p_intf, p_input ); + PopupMenuPlaylistControlEntries( sysMenu, p_intf, p_input ); sysMenu->addSeparator(); addDPStaticEntry( sysMenu, qtr( "&Open Media" ), -- 2.39.2