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 );
189 adv = menu->addAction( qtr("Visualizations selector" ),
190 mi, SLOT( visual() ) );
191 adv->setCheckable( true );
192 if( visual_selector_enabled ) adv->setChecked( true );
194 menu->addSeparator();
195 DP_SADD( qtr("Preferences"), "", "", prefsDialog() );
199 QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
202 vector<const char *> varnames;
203 /** \todo add "switch to XXX" */
204 varnames.push_back( "intf-add" );
205 objects.push_back( p_intf->i_object_id );
207 QMenu *menu = Populate( p_intf, current, varnames, objects );
209 if( !p_intf->pf_show_dialog )
211 menu->addSeparator();
212 menu->addAction( qtr("Switch to skins"), THEDP, SLOT(switchToSkins()) );
215 CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() );
216 THEDP->menusUpdateMapper->setMapping( menu, 4 );
220 QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
223 vector<const char *> varnames;
225 vlc_object_t *p_object = (vlc_object_t *)vlc_object_find( p_intf,
226 VLC_OBJECT_INPUT, FIND_ANYWHERE );
227 if( p_object != NULL )
229 PUSH_VAR( "audio-es" );
230 vlc_object_release( p_object );
233 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
237 AudioAutoMenuBuilder( p_object, objects, varnames );
238 vlc_object_release( p_object );
240 return Populate( p_intf, current, varnames, objects );
244 QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
246 vlc_object_t *p_object;
248 vector<const char *> varnames;
250 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
252 if( p_object != NULL )
254 PUSH_VAR( "video-es" );
255 PUSH_VAR( "spu-es" );
256 vlc_object_release( p_object );
259 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
261 if( p_object != NULL )
263 VideoAutoMenuBuilder( p_object, objects, varnames );
264 vlc_object_release( p_object );
266 return Populate( p_intf, current, varnames, objects );
269 QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
271 vlc_object_t *p_object;
273 vector<const char *> varnames;
276 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
278 if( p_object != NULL )
280 InputAutoMenuBuilder( p_object, objects, varnames );
281 PUSH_VAR( "prev-title"); PUSH_VAR ( "next-title" );
282 PUSH_VAR( "prev-chapter"); PUSH_VAR( "next-chapter" );
283 vlc_object_release( p_object );
285 return Populate( p_intf, current, varnames, objects );
288 QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
290 QMenu *menu = new QMenu();
291 menu->setTitle( qtr( "Additional sources" ) );
292 vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
295 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
297 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object ;
298 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
301 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
303 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object;
304 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
306 QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
307 a->setCheckable( true );
308 /* hack to handle submodules properly */
310 while( p_parser->pp_shortcuts[++i] != NULL );
312 if( playlist_IsServicesDiscoveryLoaded( THEPL,
313 i>=0?p_parser->pp_shortcuts[i] : p_parser->psz_object_name ) )
315 a->setChecked( true );
317 CONNECT( a , triggered(), THEDP->SDMapper, map() );
318 THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
319 p_parser->psz_object_name );
320 menu->addAction( a );
323 vlc_list_release( p_list );
327 /*****************************************************************************
329 *****************************************************************************/
330 #define POPUP_BOILERPLATE \
331 unsigned int i_last_separator = 0; \
332 vector<int> objects; \
333 vector<const char *> varnames; \
334 input_thread_t *p_input = THEMIM->getInput();
336 #define CREATE_POPUP \
337 QMenu *menu = new QMenu(); \
338 Populate( p_intf, menu, varnames, objects ); \
339 p_intf->p_sys->p_popup_menu = menu; \
340 menu->popup( QCursor::pos() ); \
341 p_intf->p_sys->p_popup_menu = NULL; \
342 i_last_separator = 0;
344 #define POPUP_STATIC_ENTRIES \
346 MIM_SADD( qtr("Stop"), "", "", stop() ); \
347 MIM_SADD( qtr("Previous"), "", "", prev() ); \
348 MIM_SADD( qtr("Next"), "", "", next() ); \
351 var_Get( p_input, "state", &val ); \
352 if( val.i_int == PAUSE_S ) \
353 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
355 MIM_SADD( qtr("Pause"), "", "", togglePlayPause() ) \
357 else if( THEPL->i_size && THEPL->i_enabled ) \
358 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
360 QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); \
361 intfmenu->setTitle( qtr("Interfaces" ) ); \
362 menu->addMenu( intfmenu ); \
364 QMenu *toolsmenu = ToolsMenu( p_intf, NULL, false, false ); \
365 toolsmenu->setTitle( qtr("Tools" ) ); \
366 menu->addMenu( toolsmenu ); \
368 void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
373 vlc_object_yield( p_input );
374 varnames.push_back( "video-es" );
375 objects.push_back( p_input->i_object_id );
376 varnames.push_back( "spu-es" );
377 objects.push_back( p_input->i_object_id );
378 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
379 VLC_OBJECT_VOUT, FIND_CHILD );
382 VideoAutoMenuBuilder( p_vout, objects, varnames );
383 vlc_object_release( p_vout );
385 vlc_object_release( p_input );
390 void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
395 vlc_object_yield( p_input );
396 varnames.push_back( "audio-es" );
397 objects.push_back( p_input->i_object_id );
398 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
399 VLC_OBJECT_AOUT, FIND_ANYWHERE );
402 AudioAutoMenuBuilder( p_aout, objects, varnames );
403 vlc_object_release( p_aout );
405 vlc_object_release( p_input );
410 /* Navigation stuff, and general */
411 void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
416 vlc_object_yield( p_input );
417 varnames.push_back( "audio-es" );
418 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
422 QMenu *menu = new QMenu();
423 Populate( p_intf, menu, varnames, objects );
424 menu->addSeparator();
425 POPUP_STATIC_ENTRIES;
427 p_intf->p_sys->p_popup_menu = menu;
428 menu->popup( QCursor::pos() );
429 p_intf->p_sys->p_popup_menu = NULL;
432 void QVLCMenu::PopupMenu( intf_thread_t *p_intf )
437 vlc_object_yield( p_input );
438 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
442 varnames.push_back( "video-es" );
443 objects.push_back( p_input->i_object_id );
444 varnames.push_back( "spu-es" );
445 objects.push_back( p_input->i_object_id );
446 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
447 VLC_OBJECT_VOUT, FIND_CHILD );
450 VideoAutoMenuBuilder( p_vout, objects, varnames );
451 vlc_object_release( p_vout );
455 varnames.push_back( "audio-es" );
456 objects.push_back( p_input->i_object_id );
457 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
458 VLC_OBJECT_AOUT, FIND_ANYWHERE );
461 AudioAutoMenuBuilder( p_aout, objects, varnames );
462 vlc_object_release( p_aout );
466 QMenu *menu = new QMenu();
467 Populate( p_intf, menu, varnames, objects );
468 menu->addSeparator();
469 POPUP_STATIC_ENTRIES;
471 p_intf->p_sys->p_popup_menu = menu;
472 menu->popup( QCursor::pos() );
473 p_intf->p_sys->p_popup_menu = NULL;
477 #undef PUSH_SEPARATOR
479 /*************************************************************************
480 * Builders for automenus
481 *************************************************************************/
482 QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current,
483 vector< const char *> & varnames,
484 vector<int> & objects, bool append )
486 QMenu *menu = current;
494 vlc_object_t *p_object;
495 vlc_bool_t b_section_empty = VLC_FALSE;
498 #define APPEND_EMPTY { QAction *action = menu->addAction( qtr("Empty" ) ); \
499 action->setEnabled( false ); }
501 for( i = 0; i < (int)objects.size() ; i++ )
503 if( !varnames[i] || !*varnames[i] )
505 if( b_section_empty )
507 menu->addSeparator();
508 b_section_empty = VLC_TRUE;
512 if( objects[i] == 0 )
514 /// \bug What is this ?
515 // Append( menu, varnames[i], NULL );
516 b_section_empty = VLC_FALSE;
520 p_object = (vlc_object_t *)vlc_object_get( p_intf,
522 if( p_object == NULL ) continue;
524 b_section_empty = VLC_FALSE;
525 /* Ugly specific stuff */
526 if( strstr(varnames[i], "intf-add" ) )
527 CreateItem( menu, varnames[i], p_object, false );
529 CreateItem( menu, varnames[i], p_object, true );
530 vlc_object_release( p_object );
533 /* Special case for empty menus */
534 if( menu->actions().size() == 0 || b_section_empty )
540 /*****************************************************************************
542 *****************************************************************************/
544 static bool IsMenuEmpty( const char *psz_var, vlc_object_t *p_object,
547 vlc_value_t val, val_list;
548 int i_type, i_result, i;
550 /* Check the type of the object variable */
551 i_type = var_Type( p_object, psz_var );
553 /* Check if we want to display the variable */
554 if( !(i_type & VLC_VAR_HASCHOICE) ) return FALSE;
556 var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL );
557 if( val.i_int == 0 ) return TRUE;
559 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE )
561 /* Very evil hack ! intf-switch can have only one value */
562 if( !strcmp( psz_var, "intf-switch" ) ) return FALSE;
563 if( val.i_int == 1 && b_root ) return TRUE;
567 /* Check children variables in case of VLC_VAR_VARIABLE */
568 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST, &val_list, NULL ) < 0 )
573 for( i = 0, i_result = TRUE; i < val_list.p_list->i_count; i++ )
575 if( !IsMenuEmpty( val_list.p_list->p_values[i].psz_string,
583 /* clean up everything */
584 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, NULL );
589 void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
590 vlc_object_t *p_object, bool b_submenu )
592 vlc_value_t val, text;
595 /* Check the type of the object variable */
596 i_type = var_Type( p_object, psz_var );
598 switch( i_type & VLC_VAR_TYPE )
602 case VLC_VAR_VARIABLE:
604 case VLC_VAR_INTEGER:
608 /* Variable doesn't exist or isn't handled */
612 /* Make sure we want to display the variable */
613 if( IsMenuEmpty( psz_var, p_object ) ) return;
615 /* Get the descriptive name of the variable */
616 var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
618 if( i_type & VLC_VAR_HASCHOICE )
620 /* Append choices menu */
623 QMenu *submenu = new QMenu();
624 submenu->setTitle( qfu( text.psz_string ?
625 text.psz_string : psz_var ) );
626 if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0)
627 menu->addMenu( submenu );
630 CreateChoicesMenu( menu, psz_var, p_object, true );
631 FREENULL( text.psz_string );
635 #define TEXT_OR_VAR qfu ( text.psz_string ? text.psz_string : psz_var )
637 switch( i_type & VLC_VAR_TYPE )
640 var_Get( p_object, psz_var, &val );
641 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_NORMAL,
642 p_object->i_object_id, val, i_type );
646 var_Get( p_object, psz_var, &val );
647 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_CHECK,
648 p_object->i_object_id, val, i_type, val.b_bool );
651 FREENULL( text.psz_string );
655 int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
656 vlc_object_t *p_object, bool b_root )
658 vlc_value_t val, val_list, text_list;
661 /* Check the type of the object variable */
662 i_type = var_Type( p_object, psz_var );
664 /* Make sure we want to display the variable */
665 if( IsMenuEmpty( psz_var, p_object, b_root ) ) return VLC_EGENERIC;
667 switch( i_type & VLC_VAR_TYPE )
671 case VLC_VAR_VARIABLE:
673 case VLC_VAR_INTEGER:
677 /* Variable doesn't exist or isn't handled */
681 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST,
682 &val_list, &text_list ) < 0 )
686 #define NORMAL_OR_RADIO i_type & VLC_VAR_ISCOMMAND ? ITEM_NORMAL: ITEM_RADIO
687 #define NOTCOMMAND !(i_type & VLC_VAR_ISCOMMAND)
688 #define CURVAL val_list.p_list->p_values[i]
689 #define CURTEXT text_list.p_list->p_values[i].psz_string
691 for( i = 0; i < val_list.p_list->i_count; i++ )
693 vlc_value_t another_val;
695 QMenu *subsubmenu = new QMenu();
697 switch( i_type & VLC_VAR_TYPE )
699 case VLC_VAR_VARIABLE:
700 CreateChoicesMenu( subsubmenu, CURVAL.psz_string, p_object, false );
701 subsubmenu->setTitle( qfu( CURTEXT ? CURTEXT :CURVAL.psz_string ) );
702 submenu->addMenu( subsubmenu );
706 var_Get( p_object, psz_var, &val );
707 another_val.psz_string = strdup( CURVAL.psz_string );
708 menutext = qfu( CURTEXT ? CURTEXT : another_val.psz_string );
709 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
710 p_object->i_object_id, another_val, i_type,
711 NOTCOMMAND && val.psz_string &&
712 !strcmp( val.psz_string, CURVAL.psz_string ) );
714 if( val.psz_string ) free( val.psz_string );
717 case VLC_VAR_INTEGER:
718 var_Get( p_object, psz_var, &val );
719 if( CURTEXT ) menutext = qfu( CURTEXT );
720 else menutext.sprintf( "%d", CURVAL.i_int);
721 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
722 p_object->i_object_id, CURVAL, i_type,
723 NOTCOMMAND && CURVAL.i_int == val.i_int );
727 var_Get( p_object, psz_var, &val );
728 if( CURTEXT ) menutext = qfu( CURTEXT );
729 else menutext.sprintf( "%.2f", CURVAL.f_float );
730 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
731 p_object->i_object_id, CURVAL, i_type,
732 NOTCOMMAND && CURVAL.f_float == val.f_float );
741 /* clean up everything */
742 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
744 #undef NORMAL_OR_RADIO
751 void QVLCMenu::CreateAndConnect( QMenu *menu, const char *psz_var,
752 QString text, QString help,
753 int i_item_type, int i_object_id,
754 vlc_value_t val, int i_val_type,
757 QAction *action = new QAction( text, menu );
758 action->setText( text );
759 action->setToolTip( help );
761 if( i_item_type == ITEM_CHECK )
763 action->setCheckable( true );
765 else if( i_item_type == ITEM_RADIO )
767 action->setCheckable( true );
769 currentGroup = new QActionGroup(menu);
770 currentGroup->addAction( action );
775 action->setChecked( true );
777 MenuItemData *itemData = new MenuItemData( i_object_id, i_val_type,
779 CONNECT( action, triggered(), THEDP->menusMapper, map() );
780 THEDP->menusMapper->setMapping( action, itemData );
781 menu->addAction( action );
784 void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data )
786 MenuItemData *itemData = qobject_cast<MenuItemData *>(data);
787 vlc_object_t *p_object = (vlc_object_t *)vlc_object_get( p_intf,
788 itemData->i_object_id );
789 if( p_object == NULL ) return;
791 var_Set( p_object, itemData->psz_var, itemData->val );
792 vlc_object_release( p_object );