1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: ClÃment Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
27 #include <QActionGroup>
28 #include <QSignalMapper>
30 #include "main_interface.hpp"
33 #include "dialogs_provider.hpp"
34 #include "input_manager.hpp"
43 static QActionGroup *currentGroup;
45 // Add static entries to menus
46 #define DP_SADD( text, help, icon, slot ) { if( strlen(icon) > 0 ) { QAction *action = menu->addAction( text, THEDP, SLOT( slot ) ); action->setIcon(QIcon(icon));} else { menu->addAction( text, THEDP, SLOT( slot ) ); } }
47 #define MIM_SADD( text, help, icon, slot ) { if( strlen(icon) > 0 ) { QAction *action = menu->addAction( text, THEMIM, SLOT( slot ) ); action->setIcon(QIcon(icon));} else { menu->addAction( text, THEMIM, SLOT( slot ) ); } }
50 /*****************************************************************************
51 * Definitions of variables for the dynamic menus
52 *****************************************************************************/
53 #define PUSH_VAR( var ) varnames.push_back( var ); \
54 objects.push_back( p_object->i_object_id )
56 #define PUSH_SEPARATOR if( objects.size() != i_last_separator ) { \
57 objects.push_back( 0 ); varnames.push_back( "" ); \
58 i_last_separator = objects.size(); }
60 static int InputAutoMenuBuilder( vlc_object_t *p_object,
62 vector<const char *> &varnames )
64 PUSH_VAR( "bookmark");
66 PUSH_VAR ("chapter" );
67 PUSH_VAR( "program" );
68 PUSH_VAR( "navigation" );
69 PUSH_VAR( "dvd_menus" );
73 static int VideoAutoMenuBuilder( vlc_object_t *p_object,
75 vector<const char *> &varnames )
77 PUSH_VAR( "fullscreen" );
79 PUSH_VAR( "deinterlace" );
80 PUSH_VAR( "aspect-ratio" );
82 PUSH_VAR( "video-on-top" );
83 PUSH_VAR( "directx-wallpaper" );
84 PUSH_VAR( "video-snapshot" );
86 vlc_object_t *p_dec_obj = (vlc_object_t *)vlc_object_find( p_object,
89 if( p_dec_obj != NULL )
91 vlc_object_t *p_object = p_dec_obj;
92 PUSH_VAR( "ffmpeg-pp-q" );
93 vlc_object_release( p_dec_obj );
98 static int AudioAutoMenuBuilder( vlc_object_t *p_object,
100 vector<const char *> &varnames )
102 PUSH_VAR( "audio-device" );
103 PUSH_VAR( "audio-channels" );
104 PUSH_VAR( "visual" );
105 PUSH_VAR( "equalizer" );
109 /*****************************************************************************
111 *****************************************************************************/
113 #define BAR_ADD( func, title ) { \
114 QMenu *menu = func; menu->setTitle( title ); bar->addMenu( menu ); }
116 #define BAR_DADD( func, title, id ) { \
117 QMenu *menu = func; menu->setTitle( title ); bar->addMenu( menu ); \
118 MenuFunc *f = new MenuFunc( menu, id ); \
119 CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() ); \
120 THEDP->menusUpdateMapper->setMapping( menu, f ); }
122 void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
123 bool playlist, bool adv_controls_enabled,
124 bool visual_selector_enabled )
126 QMenuBar *bar = mi->menuBar();
127 BAR_ADD( FileMenu(), qtr("Media") );
130 BAR_ADD( PlaylistMenu( mi,p_intf ), qtr("Playlist" ) );
132 BAR_ADD( ToolsMenu( p_intf, mi, adv_controls_enabled,
133 visual_selector_enabled ), qtr("Tools") );
134 BAR_DADD( VideoMenu( p_intf, NULL ), qtr("Video"), 1 );
135 BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
136 BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
138 // BAR_ADD( HelpMenu(), qtr("Help" ) );
140 QMenu *QVLCMenu::FileMenu()
142 QMenu *menu = new QMenu();
143 DP_SADD( qtr("Quick &Open File...") , "", "", simpleOpenDialog() );
144 DP_SADD( qtr("&Advanced Open..." ), "", "", openDialog() );
145 menu->addSeparator();
146 DP_SADD( qtr("Streaming..."), "", "", streamingDialog() );
147 menu->addSeparator();
148 DP_SADD( qtr("&Quit") , "", "", quit() );
152 QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf )
154 QMenu *menu = new QMenu();
155 menu->addMenu( SDMenu( p_intf ) );
156 menu->addSeparator();
158 DP_SADD( qtr( "Open playlist file"), "", "", openPlaylist() );
159 // DP_SADD( qtr( "Save playlist to file" ), "", "", savePlaylist() );
160 menu->addSeparator();
161 menu->addAction( qtr("Undock from interface"), mi,
162 SLOT( undockPlaylist() ) );
166 QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
167 bool adv_controls_enabled,
168 bool visual_selector_enabled, bool with_intf )
170 QMenu *menu = new QMenu();
173 QMenu *intfmenu = InterfacesMenu( p_intf, NULL );
174 intfmenu->setTitle( qtr("Interfaces" ) );
175 menu->addMenu( intfmenu );
176 menu->addSeparator();
178 DP_SADD( qtr("Messages" ), "", "", messagesDialog() );
179 DP_SADD( qtr("Information") , "", "", streaminfoDialog() );
180 DP_SADD( qtr("Bookmarks"), "", "", bookmarksDialog() );
181 DP_SADD( qtr("Extended settings"), "","",extendedDialog() );
184 menu->addSeparator();
185 QAction *adv = menu->addAction( qtr("Advanced controls" ),
186 mi, SLOT( advanced() ) );
187 adv->setCheckable( true );
188 if( adv_controls_enabled ) adv->setChecked( true );
190 adv = menu->addAction( qtr("Visualizations selector" ),
191 mi, SLOT( visual() ) );
192 adv->setCheckable( true );
193 if( visual_selector_enabled ) adv->setChecked( true );
196 menu->addSeparator();
197 DP_SADD( qtr("Preferences"), "", "", prefsDialog() );
201 QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
204 vector<const char *> varnames;
205 /** \todo add "switch to XXX" */
206 varnames.push_back( "intf-add" );
207 objects.push_back( p_intf->i_object_id );
209 QMenu *menu = Populate( p_intf, current, varnames, objects );
211 if( !p_intf->pf_show_dialog )
213 menu->addSeparator();
214 menu->addAction( qtr("Switch to skins"), THEDP, SLOT(switchToSkins()) );
217 CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() );
218 THEDP->menusUpdateMapper->setMapping( menu, 4 );
222 QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
225 vector<const char *> varnames;
227 vlc_object_t *p_object = (vlc_object_t *)vlc_object_find( p_intf,
228 VLC_OBJECT_INPUT, FIND_ANYWHERE );
229 if( p_object != NULL )
231 PUSH_VAR( "audio-es" );
232 vlc_object_release( p_object );
235 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
239 AudioAutoMenuBuilder( p_object, objects, varnames );
240 vlc_object_release( p_object );
242 return Populate( p_intf, current, varnames, objects );
246 QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
248 vlc_object_t *p_object;
250 vector<const char *> varnames;
252 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
254 if( p_object != NULL )
256 PUSH_VAR( "video-es" );
257 PUSH_VAR( "spu-es" );
258 vlc_object_release( p_object );
261 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
263 if( p_object != NULL )
265 VideoAutoMenuBuilder( p_object, objects, varnames );
266 vlc_object_release( p_object );
268 return Populate( p_intf, current, varnames, objects );
271 QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
273 vlc_object_t *p_object;
275 vector<const char *> varnames;
278 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
280 if( p_object != NULL )
282 InputAutoMenuBuilder( p_object, objects, varnames );
283 PUSH_VAR( "prev-title"); PUSH_VAR ( "next-title" );
284 PUSH_VAR( "prev-chapter"); PUSH_VAR( "next-chapter" );
285 vlc_object_release( p_object );
287 return Populate( p_intf, current, varnames, objects );
290 QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
292 QMenu *menu = new QMenu();
293 menu->setTitle( qtr( "Additional sources" ) );
294 vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
297 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
299 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object ;
300 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
303 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
305 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object;
306 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
308 QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
309 a->setCheckable( true );
310 /* hack to handle submodules properly */
312 while( p_parser->pp_shortcuts[++i] != NULL );
314 if( playlist_IsServicesDiscoveryLoaded( THEPL,
315 i>=0?p_parser->pp_shortcuts[i] : p_parser->psz_object_name ) )
317 a->setChecked( true );
319 CONNECT( a , triggered(), THEDP->SDMapper, map() );
320 THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
321 p_parser->psz_object_name );
322 menu->addAction( a );
325 vlc_list_release( p_list );
329 /*****************************************************************************
331 *****************************************************************************/
332 #define POPUP_BOILERPLATE \
333 unsigned int i_last_separator = 0; \
334 vector<int> objects; \
335 vector<const char *> varnames; \
336 input_thread_t *p_input = THEMIM->getInput();
338 #define CREATE_POPUP \
339 QMenu *menu = new QMenu(); \
340 Populate( p_intf, menu, varnames, objects ); \
341 p_intf->p_sys->p_popup_menu = menu; \
342 menu->popup( QCursor::pos() ); \
343 p_intf->p_sys->p_popup_menu = NULL; \
344 i_last_separator = 0;
346 #define POPUP_STATIC_ENTRIES \
348 MIM_SADD( qtr("Stop"), "", "", stop() ); \
349 MIM_SADD( qtr("Previous"), "", "", prev() ); \
350 MIM_SADD( qtr("Next"), "", "", next() ); \
353 var_Get( p_input, "state", &val ); \
354 if( val.i_int == PAUSE_S ) \
355 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
357 MIM_SADD( qtr("Pause"), "", "", togglePlayPause() ) \
359 else if( THEPL->items.i_size && THEPL->i_enabled ) \
360 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
362 QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); \
363 intfmenu->setTitle( qtr("Interfaces" ) ); \
364 menu->addMenu( intfmenu ); \
366 QMenu *toolsmenu = ToolsMenu( p_intf, NULL, false, false ); \
367 toolsmenu->setTitle( qtr("Tools" ) ); \
368 menu->addMenu( toolsmenu ); \
370 void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
375 vlc_object_yield( p_input );
376 varnames.push_back( "video-es" );
377 objects.push_back( p_input->i_object_id );
378 varnames.push_back( "spu-es" );
379 objects.push_back( p_input->i_object_id );
380 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
381 VLC_OBJECT_VOUT, FIND_CHILD );
384 VideoAutoMenuBuilder( p_vout, objects, varnames );
385 vlc_object_release( p_vout );
387 vlc_object_release( p_input );
392 void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
397 vlc_object_yield( p_input );
398 varnames.push_back( "audio-es" );
399 objects.push_back( p_input->i_object_id );
400 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
401 VLC_OBJECT_AOUT, FIND_ANYWHERE );
404 AudioAutoMenuBuilder( p_aout, objects, varnames );
405 vlc_object_release( p_aout );
407 vlc_object_release( p_input );
412 /* Navigation stuff, and general */
413 void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
418 vlc_object_yield( p_input );
419 varnames.push_back( "audio-es" );
420 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
424 QMenu *menu = new QMenu();
425 Populate( p_intf, menu, varnames, objects );
426 menu->addSeparator();
427 POPUP_STATIC_ENTRIES;
429 p_intf->p_sys->p_popup_menu = menu;
430 menu->popup( QCursor::pos() );
431 p_intf->p_sys->p_popup_menu = NULL;
434 void QVLCMenu::PopupMenu( intf_thread_t *p_intf )
439 vlc_object_yield( p_input );
440 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
444 varnames.push_back( "video-es" );
445 objects.push_back( p_input->i_object_id );
446 varnames.push_back( "spu-es" );
447 objects.push_back( p_input->i_object_id );
448 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
449 VLC_OBJECT_VOUT, FIND_CHILD );
452 VideoAutoMenuBuilder( p_vout, objects, varnames );
453 vlc_object_release( p_vout );
457 varnames.push_back( "audio-es" );
458 objects.push_back( p_input->i_object_id );
459 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
460 VLC_OBJECT_AOUT, FIND_ANYWHERE );
463 AudioAutoMenuBuilder( p_aout, objects, varnames );
464 vlc_object_release( p_aout );
468 QMenu *menu = new QMenu();
469 Populate( p_intf, menu, varnames, objects );
470 menu->addSeparator();
471 POPUP_STATIC_ENTRIES;
473 p_intf->p_sys->p_popup_menu = menu;
474 menu->popup( QCursor::pos() );
475 p_intf->p_sys->p_popup_menu = NULL;
479 #undef PUSH_SEPARATOR
481 /*************************************************************************
482 * Builders for automenus
483 *************************************************************************/
484 QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current,
485 vector< const char *> & varnames,
486 vector<int> & objects, bool append )
488 QMenu *menu = current;
496 vlc_object_t *p_object;
497 vlc_bool_t b_section_empty = VLC_FALSE;
500 #define APPEND_EMPTY { QAction *action = menu->addAction( qtr("Empty" ) ); \
501 action->setEnabled( false ); }
503 for( i = 0; i < (int)objects.size() ; i++ )
505 if( !varnames[i] || !*varnames[i] )
507 if( b_section_empty )
509 menu->addSeparator();
510 b_section_empty = VLC_TRUE;
514 if( objects[i] == 0 )
516 /// \bug What is this ?
517 // Append( menu, varnames[i], NULL );
518 b_section_empty = VLC_FALSE;
522 p_object = (vlc_object_t *)vlc_object_get( p_intf,
524 if( p_object == NULL ) continue;
526 b_section_empty = VLC_FALSE;
527 /* Ugly specific stuff */
528 if( strstr(varnames[i], "intf-add" ) )
529 CreateItem( menu, varnames[i], p_object, false );
531 CreateItem( menu, varnames[i], p_object, true );
532 vlc_object_release( p_object );
535 /* Special case for empty menus */
536 if( menu->actions().size() == 0 || b_section_empty )
542 /*****************************************************************************
544 *****************************************************************************/
546 static bool IsMenuEmpty( const char *psz_var, vlc_object_t *p_object,
549 vlc_value_t val, val_list;
550 int i_type, i_result, i;
552 /* Check the type of the object variable */
553 i_type = var_Type( p_object, psz_var );
555 /* Check if we want to display the variable */
556 if( !(i_type & VLC_VAR_HASCHOICE) ) return FALSE;
558 var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL );
559 if( val.i_int == 0 ) return TRUE;
561 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE )
563 /* Very evil hack ! intf-switch can have only one value */
564 if( !strcmp( psz_var, "intf-switch" ) ) return FALSE;
565 if( val.i_int == 1 && b_root ) return TRUE;
569 /* Check children variables in case of VLC_VAR_VARIABLE */
570 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST, &val_list, NULL ) < 0 )
575 for( i = 0, i_result = TRUE; i < val_list.p_list->i_count; i++ )
577 if( !IsMenuEmpty( val_list.p_list->p_values[i].psz_string,
585 /* clean up everything */
586 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, NULL );
591 void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
592 vlc_object_t *p_object, bool b_submenu )
594 vlc_value_t val, text;
597 /* Check the type of the object variable */
598 i_type = var_Type( p_object, psz_var );
600 switch( i_type & VLC_VAR_TYPE )
604 case VLC_VAR_VARIABLE:
606 case VLC_VAR_INTEGER:
610 /* Variable doesn't exist or isn't handled */
614 /* Make sure we want to display the variable */
615 if( IsMenuEmpty( psz_var, p_object ) ) return;
617 /* Get the descriptive name of the variable */
618 var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
620 if( i_type & VLC_VAR_HASCHOICE )
622 /* Append choices menu */
625 QMenu *submenu = new QMenu();
626 submenu->setTitle( qfu( text.psz_string ?
627 text.psz_string : psz_var ) );
628 if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0)
629 menu->addMenu( submenu );
632 CreateChoicesMenu( menu, psz_var, p_object, true );
633 FREENULL( text.psz_string );
637 #define TEXT_OR_VAR qfu ( text.psz_string ? text.psz_string : psz_var )
639 switch( i_type & VLC_VAR_TYPE )
642 var_Get( p_object, psz_var, &val );
643 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_NORMAL,
644 p_object->i_object_id, val, i_type );
648 var_Get( p_object, psz_var, &val );
649 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_CHECK,
650 p_object->i_object_id, val, i_type, val.b_bool );
653 FREENULL( text.psz_string );
657 int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
658 vlc_object_t *p_object, bool b_root )
660 vlc_value_t val, val_list, text_list;
663 /* Check the type of the object variable */
664 i_type = var_Type( p_object, psz_var );
666 /* Make sure we want to display the variable */
667 if( IsMenuEmpty( psz_var, p_object, b_root ) ) return VLC_EGENERIC;
669 switch( i_type & VLC_VAR_TYPE )
673 case VLC_VAR_VARIABLE:
675 case VLC_VAR_INTEGER:
679 /* Variable doesn't exist or isn't handled */
683 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST,
684 &val_list, &text_list ) < 0 )
688 #define NORMAL_OR_RADIO i_type & VLC_VAR_ISCOMMAND ? ITEM_NORMAL: ITEM_RADIO
689 #define NOTCOMMAND !(i_type & VLC_VAR_ISCOMMAND)
690 #define CURVAL val_list.p_list->p_values[i]
691 #define CURTEXT text_list.p_list->p_values[i].psz_string
693 for( i = 0; i < val_list.p_list->i_count; i++ )
695 vlc_value_t another_val;
697 QMenu *subsubmenu = new QMenu();
699 switch( i_type & VLC_VAR_TYPE )
701 case VLC_VAR_VARIABLE:
702 CreateChoicesMenu( subsubmenu, CURVAL.psz_string, p_object, false );
703 subsubmenu->setTitle( qfu( CURTEXT ? CURTEXT :CURVAL.psz_string ) );
704 submenu->addMenu( subsubmenu );
708 var_Get( p_object, psz_var, &val );
709 another_val.psz_string = strdup( CURVAL.psz_string );
710 menutext = qfu( CURTEXT ? CURTEXT : another_val.psz_string );
711 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
712 p_object->i_object_id, another_val, i_type,
713 NOTCOMMAND && val.psz_string &&
714 !strcmp( val.psz_string, CURVAL.psz_string ) );
716 if( val.psz_string ) free( val.psz_string );
719 case VLC_VAR_INTEGER:
720 var_Get( p_object, psz_var, &val );
721 if( CURTEXT ) menutext = qfu( CURTEXT );
722 else menutext.sprintf( "%d", CURVAL.i_int);
723 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
724 p_object->i_object_id, CURVAL, i_type,
725 NOTCOMMAND && CURVAL.i_int == val.i_int );
729 var_Get( p_object, psz_var, &val );
730 if( CURTEXT ) menutext = qfu( CURTEXT );
731 else menutext.sprintf( "%.2f", CURVAL.f_float );
732 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
733 p_object->i_object_id, CURVAL, i_type,
734 NOTCOMMAND && CURVAL.f_float == val.f_float );
743 /* clean up everything */
744 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
746 #undef NORMAL_OR_RADIO
753 void QVLCMenu::CreateAndConnect( QMenu *menu, const char *psz_var,
754 QString text, QString help,
755 int i_item_type, int i_object_id,
756 vlc_value_t val, int i_val_type,
759 QAction *action = new QAction( text, menu );
760 action->setText( text );
761 action->setToolTip( help );
763 if( i_item_type == ITEM_CHECK )
765 action->setCheckable( true );
767 else if( i_item_type == ITEM_RADIO )
769 action->setCheckable( true );
771 currentGroup = new QActionGroup(menu);
772 currentGroup->addAction( action );
777 action->setChecked( true );
779 MenuItemData *itemData = new MenuItemData( i_object_id, i_val_type,
781 CONNECT( action, triggered(), THEDP->menusMapper, map() );
782 THEDP->menusMapper->setMapping( action, itemData );
783 menu->addAction( action );
786 void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data )
788 MenuItemData *itemData = qobject_cast<MenuItemData *>(data);
789 vlc_object_t *p_object = (vlc_object_t *)vlc_object_get( p_intf,
790 itemData->i_object_id );
791 if( p_object == NULL ) return;
793 var_Set( p_object, itemData->psz_var, itemData->val );
794 vlc_object_release( p_object );