[vlc-devel] commit: Qt menus: add faster/slower/normal rate (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Feb 20 14:22:54 CET 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at sasmira.jbkempf.com> | Fri Feb 20 10:22:46 2009 +0100| [d1ceadaf8bc7ccba0bc92d1d49d2c46d1f5f7fd5] | committer: Jean-Baptiste Kempf 

Qt menus: add faster/slower/normal rate

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d1ceadaf8bc7ccba0bc92d1d49d2c46d1f5f7fd5
---

 modules/gui/qt4/menus.cpp |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 1db4644..a87725d 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" ),
@@ -823,6 +842,9 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
     PopupMenuControlEntries( menu, p_intf, p_input );
 
     menu->addSeparator();
+    PopupMenuPlaylistControlEntries( menu, p_intf, p_input );
+
+    menu->addSeparator();
     PopupMenuStaticEntries( menu );
 
     p_intf->p_sys->p_popup_menu = 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" ),




More information about the vlc-devel mailing list