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 *****************************************************************************/
25 #include "dialogs_provider.hpp"
26 #include "input_manager.hpp"
30 #include <QActionGroup>
31 #include <QSignalMapper>
40 static QActionGroup *currentGroup;
41 static char ** pp_sds;
43 // Add static entries to menus
44 #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 ) ); } }
45 #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 ) ); } }
48 /*****************************************************************************
49 * Definitions of variables for the dynamic menus
50 *****************************************************************************/
51 #define PUSH_VAR( var ) varnames.push_back( var ); \
52 objects.push_back( p_object->i_object_id )
54 #define PUSH_SEPARATOR if( objects.size() != i_last_separator ) { \
55 objects.push_back( 0 ); varnames.push_back( "" ); \
56 i_last_separator = objects.size(); }
58 static int InputAutoMenuBuilder( vlc_object_t *p_object,
60 vector<const char *> &varnames )
62 PUSH_VAR( "bookmark");
64 PUSH_VAR ("chapter" );
65 PUSH_VAR( "program" );
66 PUSH_VAR( "navigation" );
67 PUSH_VAR( "dvd_menus" );
71 static int VideoAutoMenuBuilder( vlc_object_t *p_object,
73 vector<const char *> &varnames )
75 PUSH_VAR( "fullscreen" );
77 PUSH_VAR( "deinterlace" );
78 PUSH_VAR( "aspect-ratio" );
80 PUSH_VAR( "video-on-top" );
81 PUSH_VAR( "directx-wallpaper" );
82 PUSH_VAR( "video-snapshot" );
84 vlc_object_t *p_dec_obj = (vlc_object_t *)vlc_object_find( p_object,
87 if( p_dec_obj != NULL )
89 PUSH_VAR( "ffmpeg-pp-q" );
90 vlc_object_release( p_dec_obj );
95 static int AudioAutoMenuBuilder( vlc_object_t *p_object,
97 vector<const char *> &varnames )
99 PUSH_VAR( "audio-device" );
100 PUSH_VAR( "audio-channels" );
101 PUSH_VAR( "visual" );
102 PUSH_VAR( "equalizer" );
106 /*****************************************************************************
108 *****************************************************************************/
110 #define BAR_ADD( func, title ) { \
111 QMenu *menu = func; menu->setTitle( title ); bar->addMenu( menu ); }
113 #define BAR_DADD( func, title, id ) { \
114 QMenu *menu = func; menu->setTitle( title ); bar->addMenu( menu ); \
115 MenuFunc *f = new MenuFunc( menu, id ); \
116 connect( menu, SIGNAL( aboutToShow() ), \
117 THEDP->menusUpdateMapper, SLOT(map()) ); \
118 THEDP->menusUpdateMapper->setMapping( menu, f ); }
120 void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
122 BAR_ADD( FileMenu(), qtr("File") );
123 BAR_ADD( ToolsMenu( p_intf ), qtr("Tools") );
124 BAR_DADD( VideoMenu( p_intf, NULL ), qtr("Video"), 1 );
125 BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
126 BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
128 // BAR_ADD( HelpMenu(), qtr("Help" ) );
131 void QVLCMenu::createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
133 QMenu *manageMenu = new QMenu();
134 manageMenu->setTitle( qtr("Operations") );
136 QMenu *subPlaylist = new QMenu();
137 subPlaylist->setTitle( qtr("Add to current playlist") );
138 subPlaylist->addAction( "&File...", THEDP,
139 SLOT( simplePLAppendDialog() ) );
140 subPlaylist->addAction( "&Advanced add...", THEDP,
141 SLOT( PLAppendDialog() ) );
142 manageMenu->addMenu( subPlaylist );
143 manageMenu->addSeparator();
145 QMenu *subML = new QMenu();
146 subML->setTitle( qtr("Add to Media library") );
147 subML->addAction( "&File...", THEDP,
148 SLOT( simpleMLAppendDialog() ) );
149 subML->addAction( "Directory", THEDP, SLOT( openMLDirectory() ));
150 subML->addAction( "&Advanced add...", THEDP,
151 SLOT( MLAppendDialog() ) );
152 manageMenu->addMenu( subML );
153 manageMenu->addAction( "Open playlist file", THEDP, SLOT( openPlaylist() ));
154 manageMenu->addSeparator();
156 // manageMenu->addMenu( SDMenu( p_intf ) );
158 bar->addMenu( manageMenu );
161 QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
163 QMenu *menu = new QMenu();
164 menu->setTitle( qtr( "Services Discovery" ) );
165 playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
168 assert( p_playlist );
169 vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
172 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
174 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object ;
175 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
178 if( i_num ) pp_sds = (char **)calloc( i_num, sizeof(void *) );
179 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
181 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object;
182 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
184 QAction *a = menu->addAction(
185 qfu( p_parser->psz_longname ?
186 p_parser->psz_longname :
187 ( p_parser->psz_shortname ?
188 p_parser->psz_shortname :
189 p_parser->psz_object_name ) ) );
190 a->setCheckable( true );
191 /* hack to handle submodules properly */
193 while( p_parser->pp_shortcuts[++i] != NULL );
195 if( playlist_IsServicesDiscoveryLoaded( p_playlist,
196 i>=0?p_parser->pp_shortcuts[i] : p_parser->psz_object_name ) )
198 a->setChecked( true );
200 pp_sds[i_num++] = i>=0? p_parser->pp_shortcuts[i] :
201 p_parser->psz_object_name;
204 vlc_list_release( p_list );
205 vlc_object_release( p_playlist );
209 QMenu *QVLCMenu::FileMenu()
211 QMenu *menu = new QMenu();
212 DP_SADD( qtr("Quick &Open File...") , "", "", simpleOpenDialog() );
213 DP_SADD( qtr("&Advanced Open..." ), "", "", openDialog() );
214 menu->addSeparator();
215 DP_SADD( qtr("Streaming..."), "", "", streamingDialog() );
216 menu->addSeparator();
217 DP_SADD( qtr("&Quit") , "", "", quit() );
221 QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, bool with_intf )
223 QMenu *menu = new QMenu();
226 QMenu *intfmenu = InterfacesMenu( p_intf, NULL );
227 intfmenu->setTitle( qtr("Interfaces" ) );
228 menu->addMenu( intfmenu );
229 /** \todo ADD EXT GUI HERE */
230 menu->addSeparator();
232 DP_SADD( qtr("Messages" ), "", "", messagesDialog() );
233 DP_SADD( qtr("Information") , "", "", streaminfoDialog() );
234 DP_SADD( qtr("Bookmarks"), "", "", bookmarksDialog() );
235 menu->addSeparator();
236 DP_SADD( qtr("Preferences"), "", "", prefsDialog() );
240 QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
243 vector<const char *> varnames;
244 /** \todo add "switch to XXX" */
245 varnames.push_back( "intf-add" );
246 objects.push_back( p_intf->i_object_id );
248 QMenu *menu = Populate( p_intf, current, varnames, objects );
249 connect( menu, SIGNAL( aboutToShow() ),
250 THEDP->menusUpdateMapper, SLOT(map()) );
251 THEDP->menusUpdateMapper->setMapping( menu, 4 );
256 QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
259 vector<const char *> varnames;
261 vlc_object_t *p_object = (vlc_object_t *)vlc_object_find( p_intf,
262 VLC_OBJECT_INPUT, FIND_ANYWHERE );
263 if( p_object != NULL )
265 PUSH_VAR( "audio-es" );
266 vlc_object_release( p_object );
269 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
273 AudioAutoMenuBuilder( p_object, objects, varnames );
274 vlc_object_release( p_object );
276 return Populate( p_intf, current, varnames, objects );
280 QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
282 vlc_object_t *p_object;
284 vector<const char *> varnames;
286 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
288 if( p_object != NULL )
290 PUSH_VAR( "video-es" );
291 PUSH_VAR( "spu-es" );
292 vlc_object_release( p_object );
295 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
297 if( p_object != NULL )
299 VideoAutoMenuBuilder( p_object, objects, varnames );
300 vlc_object_release( p_object );
302 return Populate( p_intf, current, varnames, objects );
305 QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
307 vlc_object_t *p_object;
309 vector<const char *> varnames;
312 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
314 if( p_object != NULL )
316 InputAutoMenuBuilder( p_object, objects, varnames );
317 PUSH_VAR( "prev-title"); PUSH_VAR ( "next-title" );
318 PUSH_VAR( "prev-chapter"); PUSH_VAR( "next-chapter" );
319 vlc_object_release( p_object );
321 return Populate( p_intf, current, varnames, objects );
325 /*****************************************************************************
327 *****************************************************************************/
328 #define POPUP_BOILERPLATE \
329 unsigned int i_last_separator = 0; \
330 vector<int> objects; \
331 vector<const char *> varnames; \
332 input_thread_t *p_input = THEMIM->getInput();
334 #define CREATE_POPUP \
335 QMenu *menu = new QMenu(); \
336 Populate( p_intf, menu, varnames, objects ); \
337 p_intf->p_sys->p_popup_menu = menu; \
338 menu->popup( QCursor::pos() ); \
339 p_intf->p_sys->p_popup_menu = NULL; \
340 i_last_separator = 0;
342 #define POPUP_STATIC_ENTRIES \
344 MIM_SADD( qtr("Stop"), "", "", stop() ); \
345 MIM_SADD( qtr("Previous"), "", "", prev() ); \
346 MIM_SADD( qtr("Next"), "", "", next() ); \
349 var_Get( p_input, "state", &val ); \
350 if( val.i_int == PAUSE_S ) \
351 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
353 MIM_SADD( qtr("Pause"), "", "", togglePlayPause() ) \
355 else if( THEPL->i_size && THEPL->i_enabled ) \
356 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
358 QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); \
359 intfmenu->setTitle( qtr("Interfaces" ) ); \
360 menu->addMenu( intfmenu ); \
362 QMenu *toolsmenu = ToolsMenu( p_intf, false ); \
363 toolsmenu->setTitle( qtr("Tools" ) ); \
364 menu->addMenu( toolsmenu ); \
366 void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
371 vlc_object_yield( p_input );
372 varnames.push_back( "video-es" );
373 objects.push_back( p_input->i_object_id );
374 varnames.push_back( "spu-es" );
375 objects.push_back( p_input->i_object_id );
376 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
377 VLC_OBJECT_VOUT, FIND_CHILD );
380 VideoAutoMenuBuilder( p_vout, objects, varnames );
381 vlc_object_release( p_vout );
383 vlc_object_release( p_input );
388 void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
393 vlc_object_yield( p_input );
394 varnames.push_back( "audio-es" );
395 objects.push_back( p_input->i_object_id );
396 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
397 VLC_OBJECT_AOUT, FIND_ANYWHERE );
400 AudioAutoMenuBuilder( p_aout, objects, varnames );
401 vlc_object_release( p_aout );
403 vlc_object_release( p_input );
408 /* Navigation stuff, and general */
409 void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
414 vlc_object_yield( p_input );
415 varnames.push_back( "audio-es" );
416 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
420 QMenu *menu = new QMenu();
421 Populate( p_intf, menu, varnames, objects );
422 menu->addSeparator();
423 POPUP_STATIC_ENTRIES;
425 p_intf->p_sys->p_popup_menu = menu;
426 menu->popup( QCursor::pos() );
427 p_intf->p_sys->p_popup_menu = NULL;
430 void QVLCMenu::PopupMenu( intf_thread_t *p_intf )
435 vlc_object_yield( p_input );
436 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
440 varnames.push_back( "video-es" );
441 objects.push_back( p_input->i_object_id );
442 varnames.push_back( "spu-es" );
443 objects.push_back( p_input->i_object_id );
444 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
445 VLC_OBJECT_VOUT, FIND_CHILD );
448 VideoAutoMenuBuilder( p_vout, objects, varnames );
449 vlc_object_release( p_vout );
453 varnames.push_back( "audio-es" );
454 objects.push_back( p_input->i_object_id );
455 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
456 VLC_OBJECT_AOUT, FIND_ANYWHERE );
459 AudioAutoMenuBuilder( p_aout, objects, varnames );
460 vlc_object_release( p_aout );
464 QMenu *menu = new QMenu();
465 Populate( p_intf, menu, varnames, objects );
466 menu->addSeparator();
467 POPUP_STATIC_ENTRIES;
469 p_intf->p_sys->p_popup_menu = menu;
470 menu->popup( QCursor::pos() );
471 p_intf->p_sys->p_popup_menu = NULL;
475 #undef PUSH_SEPARATOR
477 /*************************************************************************
478 * Builders for automenus
479 *************************************************************************/
480 QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current,
481 vector< const char *> & varnames,
482 vector<int> & objects, bool append )
484 QMenu *menu = current;
492 vlc_object_t *p_object;
493 vlc_bool_t b_section_empty = VLC_FALSE;
496 #define APPEND_EMPTY { QAction *action = menu->addAction( qtr("Empty" ) ); \
497 action->setEnabled( false ); }
499 for( i = 0; i < (int)objects.size() ; i++ )
501 if( !varnames[i] || !*varnames[i] )
503 if( b_section_empty )
505 menu->addSeparator();
506 b_section_empty = VLC_TRUE;
510 if( objects[i] == 0 )
512 /// \bug What is this ?
513 // Append( menu, varnames[i], NULL );
514 b_section_empty = VLC_FALSE;
518 p_object = (vlc_object_t *)vlc_object_get( p_intf,
520 if( p_object == NULL ) continue;
522 b_section_empty = VLC_FALSE;
523 /* Ugly specific stuff */
524 if( strstr(varnames[i], "intf-add" ) )
525 CreateItem( menu, varnames[i], p_object, false );
527 CreateItem( menu, varnames[i], p_object, true );
528 vlc_object_release( p_object );
531 /* Special case for empty menus */
532 if( menu->actions().size() == 0 || b_section_empty )
538 /*****************************************************************************
540 *****************************************************************************/
542 static bool IsMenuEmpty( const char *psz_var, vlc_object_t *p_object,
545 vlc_value_t val, val_list;
546 int i_type, i_result, i;
548 /* Check the type of the object variable */
549 i_type = var_Type( p_object, psz_var );
551 /* Check if we want to display the variable */
552 if( !(i_type & VLC_VAR_HASCHOICE) ) return FALSE;
554 var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL );
555 if( val.i_int == 0 ) return TRUE;
557 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE )
559 /* Very evil hack ! intf-switch can have only one value */
560 if( !strcmp( psz_var, "intf-switch" ) ) return FALSE;
561 if( val.i_int == 1 && b_root ) return TRUE;
565 /* Check children variables in case of VLC_VAR_VARIABLE */
566 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST, &val_list, NULL ) < 0 )
571 for( i = 0, i_result = TRUE; i < val_list.p_list->i_count; i++ )
573 if( !IsMenuEmpty( val_list.p_list->p_values[i].psz_string,
581 /* clean up everything */
582 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, NULL );
587 void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
588 vlc_object_t *p_object, bool b_submenu )
590 vlc_value_t val, text;
593 /* Check the type of the object variable */
594 i_type = var_Type( p_object, psz_var );
596 switch( i_type & VLC_VAR_TYPE )
600 case VLC_VAR_VARIABLE:
602 case VLC_VAR_INTEGER:
606 /* Variable doesn't exist or isn't handled */
610 /* Make sure we want to display the variable */
611 if( IsMenuEmpty( psz_var, p_object ) ) return;
613 /* Get the descriptive name of the variable */
614 var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
616 if( i_type & VLC_VAR_HASCHOICE )
618 /* Append choices menu */
621 QMenu *submenu = new QMenu();
622 submenu->setTitle( qfu( text.psz_string ?
623 text.psz_string : psz_var ) );
624 if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0)
625 menu->addMenu( submenu );
628 CreateChoicesMenu( menu, psz_var, p_object, true );
629 FREENULL( text.psz_string );
633 #define TEXT_OR_VAR qfu ( text.psz_string ? text.psz_string : psz_var )
635 switch( i_type & VLC_VAR_TYPE )
638 var_Get( p_object, psz_var, &val );
639 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_NORMAL,
640 p_object->i_object_id, val, i_type );
644 var_Get( p_object, psz_var, &val );
645 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_CHECK,
646 p_object->i_object_id, val, i_type, val.b_bool );
649 FREENULL( text.psz_string );
653 int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
654 vlc_object_t *p_object, bool b_root )
656 vlc_value_t val, val_list, text_list;
659 /* Check the type of the object variable */
660 i_type = var_Type( p_object, psz_var );
662 /* Make sure we want to display the variable */
663 if( IsMenuEmpty( psz_var, p_object, b_root ) ) return VLC_EGENERIC;
665 switch( i_type & VLC_VAR_TYPE )
669 case VLC_VAR_VARIABLE:
671 case VLC_VAR_INTEGER:
675 /* Variable doesn't exist or isn't handled */
679 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST,
680 &val_list, &text_list ) < 0 )
684 #define NORMAL_OR_RADIO i_type & VLC_VAR_ISCOMMAND ? ITEM_NORMAL: ITEM_RADIO
685 #define NOTCOMMAND !(i_type & VLC_VAR_ISCOMMAND)
686 #define CURVAL val_list.p_list->p_values[i]
687 #define CURTEXT text_list.p_list->p_values[i].psz_string
689 for( i = 0; i < val_list.p_list->i_count; i++ )
691 vlc_value_t another_val;
693 QMenu *subsubmenu = new QMenu();
695 switch( i_type & VLC_VAR_TYPE )
697 case VLC_VAR_VARIABLE:
698 CreateChoicesMenu( subsubmenu, CURVAL.psz_string, p_object, false );
699 subsubmenu->setTitle( qfu( CURTEXT ? CURTEXT :CURVAL.psz_string ) );
700 submenu->addMenu( subsubmenu );
704 var_Get( p_object, psz_var, &val );
705 another_val.psz_string = strdup( CURVAL.psz_string );
706 menutext = qfu( CURTEXT ? CURTEXT : another_val.psz_string );
707 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
708 p_object->i_object_id, another_val, i_type,
709 NOTCOMMAND && val.psz_string &&
710 !strcmp( val.psz_string, CURVAL.psz_string ) );
712 if( val.psz_string ) free( val.psz_string );
715 case VLC_VAR_INTEGER:
716 var_Get( p_object, psz_var, &val );
717 if( CURTEXT ) menutext = qfu( CURTEXT );
718 else menutext.sprintf( "%d", CURVAL.i_int);
719 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
720 p_object->i_object_id, CURVAL, i_type,
721 NOTCOMMAND && CURVAL.i_int == val.i_int );
725 var_Get( p_object, psz_var, &val );
726 if( CURTEXT ) menutext = qfu( CURTEXT );
727 else menutext.sprintf( "%.2f", CURVAL.f_float );
728 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
729 p_object->i_object_id, CURVAL, i_type,
730 NOTCOMMAND && CURVAL.f_float == val.f_float );
739 /* clean up everything */
740 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
742 #undef NORMAL_OR_RADIO
749 void QVLCMenu::CreateAndConnect( QMenu *menu, const char *psz_var,
750 QString text, QString help,
751 int i_item_type, int i_object_id,
752 vlc_value_t val, int i_val_type,
755 QAction *action = new QAction( text, menu );
756 action->setText( text );
757 action->setToolTip( help );
759 if( i_item_type == ITEM_CHECK )
761 action->setCheckable( true );
763 else if( i_item_type == ITEM_RADIO )
765 action->setCheckable( true );
767 currentGroup = new QActionGroup(menu);
768 currentGroup->addAction( action );
773 action->setChecked( true );
775 MenuItemData *itemData = new MenuItemData( i_object_id, i_val_type,
777 connect( action, SIGNAL(triggered()), THEDP->menusMapper, SLOT(map()) );
778 THEDP->menusMapper->setMapping( action, itemData );
779 menu->addAction( action );
782 void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data )
784 MenuItemData *itemData = qobject_cast<MenuItemData *>(data);
785 vlc_object_t *p_object = (vlc_object_t *)vlc_object_get( p_intf,
786 itemData->i_object_id );
787 if( p_object == NULL ) return;
789 var_Set( p_object, itemData->psz_var, itemData->val );
790 vlc_object_release( p_object );