]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/menus.cpp
Fix erroneously commited chunk
[vlc] / modules / gui / qt4 / menus.cpp
index e9de26e3c3b3742d1ffaac3823c65b58cad9f896..db14f8e41188973b1bd846c0fafb0b4ca432cc3a 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2006-2007 the VideoLAN team
  * $Id$
  *
- * Authors: Clément Stenac <zorglub@videolan.org>
+ * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -241,10 +241,12 @@ QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf )
 {
     QMenu *menu = new QMenu();
     menu->addMenu( SDMenu( p_intf ) );
+    menu->addAction ( QIcon(":/pixmaps/vlc_playlist_16px.png"),
+                      qtr( "Show Playlist"), mi, SLOT( playlist() ) );
     menu->addSeparator();
 
-    DP_SADD( menu, qtr( I_PL_LOAD ), "", "", openPlaylist(), "Ctrl+L" );
-    DP_SADD( menu, qtr( I_PL_SAVE ), "", "", savePlaylist(), "Ctrl+K" );
+    DP_SADD( menu, qtr( I_PL_LOAD ), "", "", openPlaylist(), "Ctrl+X" );
+    DP_SADD( menu, qtr( I_PL_SAVE ), "", "", savePlaylist(), "Ctrl+Y" );
     menu->addSeparator();
     menu->addAction( qtr("Undock from interface"), mi,
             SLOT( undockPlaylist() ), qtr("Ctrl+U") );
@@ -287,8 +289,9 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
         adv->setCheckable( true );
         if( adv_controls_enabled ) adv->setChecked( true );
 
-       DP_SADD( menu, qtr( "Hide Menus..." ), "","",hideMenus(), "Ctrl+H" );
-       menu->addSeparator();
+        menu->addAction( qtr( "Hide Menus..." ), mi, SLOT( toggleMenus() ),
+                qtr( "Ctrl+H") );
+        menu->addSeparator();
 
 #if 0 /* For Visualisations. Not yet working */
         adv = menu->addAction( qtr("Visualizations selector" ),
@@ -296,8 +299,9 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
         adv->setCheckable( true );
         if( visual_selector_enabled ) adv->setChecked( true );
 #endif
-       menu->addAction ( QIcon(":/pixmaps/vlc_playlist_16px.png"),
-                         qtr( "Playlist"), mi, SLOT( playlist() ) );
+        menu->addAction ( QIcon(":/pixmaps/vlc_playlist_16px.png"),
+                          qtr( "Playlist"), mi, SLOT( playlist() ),
+                          qtr( "Ctrl+L") );
     }
     DP_SADD( menu, qtr( I_MENU_EXT ), "", ":/pixmaps/vlc_settings_16px.png",
                  extendedDialog() ,  "Ctrl+E"  );
@@ -424,31 +428,29 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
     for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
     {
         module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object ;
-        if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
+        if( module_IsCapable( p_parser, "services_discovery" ) )
             i_num++;
     }
     for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
     {
         module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object;
-        if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
-        {
-            QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
-            a->setCheckable( true );
-            /* hack to handle submodules properly */
-            int i = -1;
-            while( p_parser->pp_shortcuts[++i] != NULL );
-            i--;
-            if( playlist_IsServicesDiscoveryLoaded( THEPL,
-                        i>=0?p_parser->pp_shortcuts[i]
-                        : p_parser->psz_object_name ) )
-            {
-                a->setChecked( true );
-            }
-            CONNECT( a , triggered(), THEDP->SDMapper, map() );
-            THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
-                    p_parser->psz_object_name );
-            menu->addAction( a );
-        }
+        if( !module_IsCapable( p_parser, "services_discovery" ) )
+            continue;
+
+        QAction *a = new QAction( qfu( module_GetLongName( p_parser ) ), menu );
+        a->setCheckable( true );
+        /* hack to handle submodules properly */
+        int i = -1;
+        while( p_parser->pp_shortcuts[++i] != NULL );
+        i--;
+        if( playlist_IsServicesDiscoveryLoaded( THEPL,
+                    i>=0?p_parser->pp_shortcuts[i]
+                    : module_GetObjName( p_parser ) ) )
+            a->setChecked( true );
+        CONNECT( a , triggered(), THEDP->SDMapper, map() );
+        THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
+                                              module_GetObjName( p_parser ) );
+        menu->addAction( a );
     }
     vlc_list_release( p_list );
     return menu;