Changeset 5a601aac516e2e9256024746cdc50ae19ebe4925

Show
Ignore:
Timestamp:
17/06/08 17:16:55 (5 months ago)
Author:
Jean-Baptiste Kempf <jb@videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@videolan.org> 1213715815 -0700
git-parent:

[c7cd0ac4979a796904402309a4978de7416286ec]

git-author:
Jean-Baptiste Kempf <jb@videolan.org> 1213715791 -0700
Message:

Simplify and remove duplicate code.

Menus are the same on the right click and the main menu... Thanks for the users...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/menus.cpp

    r8674567 r5a601aa  
    22 * menus.cpp : Qt menus 
    33 ***************************************************************************** 
    4  * Copyright ( C ) 2006-2007 the VideoLAN team 
     4 * Copyright © 2006-2008 the VideoLAN team 
    55 * $Id$ 
    66 * 
     
    771771            vlc_object_yield( p_input ); 
    772772            InputAutoMenuBuilder( VLC_OBJECT( p_input ), objects, varnames ); 
    773  
    774             vlc_object_t *p_aout = ( vlc_object_t * ) 
    775                 vlc_object_find( p_input, VLC_OBJECT_AOUT, FIND_ANYWHERE ); 
    776             vlc_object_t *p_vout = ( vlc_object_t * ) 
    777                 vlc_object_find( p_input, VLC_OBJECT_VOUT, FIND_CHILD ); 
    778  
    779             /* Add a fullscreen switch button */ 
    780             if( p_vout ) 
    781             { 
    782                 vlc_value_t val; 
    783                 var_Get( p_vout, "fullscreen", &val ); 
    784                 val.b_bool = !val.b_bool; 
    785                 CreateAndConnect( menu, "fullscreen", qtr( "Fullscreen" ), "", 
    786                      ITEM_CHECK, p_vout->i_object_id, val, VLC_VAR_BOOL, 
    787                      !val.b_bool ); 
    788                 b_fullscreen = !val.b_bool; 
    789             } 
    790  
    791             /* Audio menu */ 
    792             AudioAutoMenuBuilder( p_aout, p_input, objects, varnames ); 
    793             if( p_aout ) 
    794                 vlc_object_release( p_aout ); 
    795             submenu = Populate( p_intf, NULL, varnames, objects ); 
    796             varnames.clear(); objects.clear(); 
    797             action = menu->addMenu( submenu ); 
    798             action->setText( qtr( "Audio" ) ); 
    799             if( submenu->isEmpty() ) 
     773            vlc_object_release( p_input ); 
     774 
     775            action = menu->addMenu( AudioMenu( p_intf, NULL ) ); 
     776            action->setText( qtr( "&Audio" ) ); 
     777            if( action->menu()->isEmpty() ) 
    800778                action->setEnabled( false ); 
    801779 
    802             /* Video menu */ 
    803             submenu = new QMenu(); 
    804             ACT_ADD( submenu, "video-es", qtr( "Video Track" ) ); 
    805             QMenu *subsubmenu = new QMenu( qtr( "&Subtitles Track" ), submenu ); 
    806             addDPStaticEntry( subsubmenu, qtr( "Load File..." ), "", "", 
    807                               SLOT( loadSubtitlesFile() ) ); 
    808             action = submenu->addMenu( subsubmenu ); 
    809             action->setData( "spu-es" ); 
    810  
    811             VideoAutoMenuBuilder( p_vout, p_input, objects, varnames ); 
    812             if( p_vout ) 
    813                 vlc_object_release( p_vout ); 
    814             Populate( p_intf, submenu, varnames, objects ); 
    815             varnames.clear(); objects.clear(); 
    816             action = menu->addMenu( submenu ); 
    817             action->setText( qtr( "Video" ) ); 
    818             if( submenu->isEmpty() ) 
     780            action = menu->addMenu( VideoMenu( p_intf, NULL ) ); 
     781            action->setText( qtr( "&Video" ) ); 
     782            if( action->menu()->isEmpty() ) 
    819783                action->setEnabled( false ); 
    820784 
    821             vlc_object_release( p_input ); 
     785            action = menu->addMenu( NavigMenu( p_intf, NULL ) ); 
     786            action->setText( qtr( "&Playback" ) ); 
     787            if( action->menu()->isEmpty() ) 
     788                action->setEnabled( false ); 
    822789        } 
    823790