static QActionGroup *currentGroup;
+/* HACK for minimalView to go around a Qt bug/feature
+ * that doesn't update the QAction checked state when QMenu is hidden */
+QAction *QVLCMenu::minimalViewAction = NULL;
+
// Add static entries to menus
void addDPStaticEntry( QMenu *menu,
const QString text,
PUSH_INPUTVAR( "audio-es" );
PUSH_VAR( "audio-device" );
PUSH_VAR( "audio-channels" );
- PUSH_VAR( "equalizer" );
PUSH_VAR( "visual" );
return VLC_SUCCESS;
}
QMenu *menu = new QMenu();
addDPStaticEntry( menu, qtr( "&Open File..." ), "",
- ":/pixmaps/file-asym_16px.png", SLOT( openFileDialog() ), "Ctrl+O" );
+ ":/file-asym", SLOT( openFileDialog() ), "Ctrl+O" );
addDPStaticEntry( menu, qtr( I_OPEN_FOLDER ), "",
- ":/pixmaps/folder-grey_16px.png", SLOT( PLAppendDir() ), "Ctrl+F" );
+ ":/folder-grey", SLOT( PLAppendDir() ), "Ctrl+F" );
addDPStaticEntry( menu, qtr( "Open &Disc..." ), "",
- ":/pixmaps/disc_16px.png", SLOT( openDiscDialog() ), "Ctrl+D" );
+ ":/disc", SLOT( openDiscDialog() ), "Ctrl+D" );
addDPStaticEntry( menu, qtr( "Open &Network..." ), "",
- ":/pixmaps/network_16px.png", SLOT( openNetDialog() ), "Ctrl+N" );
+ ":/network", SLOT( openNetDialog() ), "Ctrl+N" );
addDPStaticEntry( menu, qtr( "Open &Capture Device..." ), "",
- ":/pixmaps/capture-card_16px.png", SLOT( openCaptureDialog() ),
+ ":/capture-card", SLOT( openCaptureDialog() ),
"Ctrl+C" );
menu->addSeparator();
addDPStaticEntry( menu, qtr( "&Streaming..." ), "",
- ":/pixmaps/menus_stream_16px.png", SLOT( openThenStreamingDialogs() ),
+ ":/stream", SLOT( openThenStreamingDialogs() ),
"Ctrl+S" );
addDPStaticEntry( menu, qtr( "Conve&rt / Save..." ), "", "",
SLOT( openThenTranscodingDialogs() ), "Ctrl+R" );
menu->addSeparator();
addDPStaticEntry( menu, qtr( "&Quit" ) , "",
- ":/pixmaps/menus_quit_16px.png", SLOT( quit() ), "Ctrl+Q" );
+ ":/quit", SLOT( quit() ), "Ctrl+Q" );
return menu;
}
{
QMenu *menu = new QMenu();
menu->addMenu( SDMenu( p_intf ) );
- menu->addAction( QIcon( ":/pixmaps/playlist_16px.png" ),
+ menu->addAction( QIcon( ":/playlist_menu" ),
qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
menu->addSeparator();
QMenu *menu = new QMenu( current );
if( mi )
{
- menu->addAction( QIcon( ":/pixmaps/playlist_16px.png" ),
- qtr( "Playlist..." ), mi, SLOT( togglePlaylist() ),
- qtr( "Ctrl+L" ) );
+ QAction *act=
+ menu->addAction( QIcon( ":/playlist_menu" ), qtr( "Play&list..." ),
+ mi, SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
+ act->setData( "_static_" );
}
- addDPStaticEntry( menu, qtr( I_MENU_EXT ), "",
- ":/pixmaps/menus_settings_16px.png", SLOT( extendedDialog() ),
- "Ctrl+E" );
+ addDPStaticEntry( menu, qtr( I_MENU_EXT ), "", ":/settings",
+ SLOT( extendedDialog() ), "Ctrl+E" );
menu->addSeparator();
if( with_intf )
{
QMenu *intfmenu = InterfacesMenu( p_intf, menu );
- intfmenu->setTitle( qtr( "Add Interfaces" ) );
MenuFunc *f = new MenuFunc( intfmenu, 4 );
CONNECT( intfmenu, aboutToShow(), THEDP->menusUpdateMapper, map() );
THEDP->menusUpdateMapper->setMapping( intfmenu, f );
- menu->addMenu( intfmenu );
menu->addSeparator();
}
if( mi )
{
/* Minimal View */
- QAction *action = menu->addAction( qtr( "Minimal View..." ), mi,
+ QAction *action = menu->addAction( qtr( "Mi&nimal View..." ), mi,
SLOT( toggleMinimalView() ), qtr( "Ctrl+H" ) );
action->setCheckable( true );
+ action->setData( "_static_" );
if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE )
action->setChecked( true );
+ minimalViewAction = action; /* HACK for minimalView */
/* FullScreen View */
- action = menu->addAction( qtr( "Fullscreen Interface" ), mi,
+ action = menu->addAction( qtr( "&Fullscreen Interface" ), mi,
SLOT( toggleFullScreen() ), QString( "F11" ) );
action->setCheckable( true );
+ action->setData( "_static_" );
/* Advanced Controls */
- action = menu->addAction( qtr( "Advanced Controls" ), mi,
+ action = menu->addAction( qtr( "&Advanced Controls" ), mi,
SLOT( toggleAdvanced() ) );
action->setCheckable( true );
+ action->setData( "_static_" );
if( mi->getControlsVisibilityStatus() & CONTROLS_ADVANCED )
action->setChecked( true );
#if 0 /* For Visualisations. Not yet working */
menu->addSeparator();
addDPStaticEntry( menu, qtr( I_MENU_MSG ), "",
- ":/pixmaps/menus_messages_16px.png", SLOT( messagesDialog() ),
+ ":/messages", SLOT( messagesDialog() ),
"Ctrl+M" );
- addDPStaticEntry( menu, qtr( I_MENU_INFO ) , "", "",
+ addDPStaticEntry( menu, qtr( I_MENU_INFO ) , "", ":/info",
SLOT( mediaInfoDialog() ), "Ctrl+I" );
addDPStaticEntry( menu, qtr( I_MENU_CODECINFO ) , "",
- ":/pixmaps/menus_info_16px.png", SLOT( mediaCodecDialog() ), "Ctrl+J" );
+ ":/info", SLOT( mediaCodecDialog() ), "Ctrl+J" );
addDPStaticEntry( menu, qtr( I_MENU_BOOKMARK ), "","",
SLOT( bookmarksDialog() ), "Ctrl+B" );
#ifdef ENABLE_VLM
#endif
menu->addSeparator();
- addDPStaticEntry( menu, qtr( "Preferences..." ), "",
- ":/pixmaps/menus_preferences_16px.png", SLOT( prefsDialog() ), "Ctrl+P" );
+ addDPStaticEntry( menu, qtr( "&Preferences..." ), "",
+ ":/preferences", SLOT( prefsDialog() ), "Ctrl+P" );
return menu;
}
varnames.push_back( "intf-add" );
objects.push_back( p_intf->i_object_id );
- QMenu *submenu = new QMenu( current );
- QMenu *menu = Populate( p_intf, submenu, varnames, objects );
-
- return menu;
+ return Populate( p_intf, current, varnames, objects );
}
/**
ACT_ADD( current, "audio-es", qtr( "Audio &Track" ) );
ACT_ADD( current, "audio-device", qtr( "Audio &Device" ) );
ACT_ADD( current, "audio-channels", qtr( "Audio &Channels" ) );
- ACT_ADD( current, "equalizer", qtr( "&Equalizer" ) );
current->addSeparator();
ACT_ADD( current, "visual", qtr( "&Visualizations" ) );
}
ACT_ADD( current, "crop", qtr( "&Crop" ) );
ACT_ADD( current, "video-on-top", qtr( "Always &On Top" ) );
/* ACT_ADD( current, "directx-wallpaper", qtr( "DirectX Wallpaper" ) ); */
- ACT_ADD( current, "video-snapshot", qtr( "Snapshot" ) );
+ ACT_ADD( current, "video-snapshot", qtr( "Snapsh&ot" ) );
/* ACT_ADD( current, "ffmpeg-pp-q", qtr( "Decoder" ) ); */
}
menu->addSeparator();
ACT_ADD( menu, "bookmark", qtr( "&Bookmarks" ) );
- ACT_ADD( menu, "title", qtr( "&Title" ) );
+ ACT_ADD( menu, "title", qtr( "T&itle" ) );
ACT_ADD( menu, "chapter", qtr( "&Chapter" ) );
ACT_ADD( menu, "program", qtr( "&Program" ) );
ACT_ADD( menu, "navigation", qtr( "&Navigation" ) );
QMenu *QVLCMenu::HelpMenu( QMenu *current )
{
QMenu *menu = new QMenu( current );
- addDPStaticEntry( menu, qtr( "Help..." ) , "",
- ":/pixmaps/menus_help_16px.png", SLOT( helpDialog() ), "F1" );
+ addDPStaticEntry( menu, qtr( "&Help..." ) , "",
+ ":/help", SLOT( helpDialog() ), "F1" );
#ifdef UPDATE_CHECK
- addDPStaticEntry( menu, qtr( "Check for Updates..." ) , "", "",
+ addDPStaticEntry( menu, qtr( "Check for &Updates..." ) , "", "",
SLOT( updateDialog() ), "");
#endif
menu->addSeparator();
- addDPStaticEntry( menu, qtr( I_MENU_ABOUT ), "", "", SLOT( aboutDialog() ),
- "Ctrl+F1" );
+ addDPStaticEntry( menu, qtr( I_MENU_ABOUT ), "", ":/info",
+ SLOT( aboutDialog() ), "Ctrl+F1" );
return menu;
}
var_Get( p_input, "state", &val );
if( val.i_int == PLAYING_S )
addMIMStaticEntry( p_intf, menu, qtr( "Pause" ), "",
- ":/pixmaps/pause_16px.png", SLOT( togglePlayPause() ) );
+ ":/pause", SLOT( togglePlayPause() ) );
else
addMIMStaticEntry( p_intf, menu, qtr( "Play" ), "",
- ":/pixmaps/play_16px.png", SLOT( togglePlayPause() ) );
+ ":/play", SLOT( togglePlayPause() ) );
}
else if( THEPL->items.i_size )
addMIMStaticEntry( p_intf, menu, qtr( "Play" ), "",
- ":/pixmaps/play_16px.png", SLOT( togglePlayPause() ) );
+ ":/play", SLOT( togglePlayPause() ) );
else
addDPStaticEntry( menu, qtr( "Play" ), "",
- ":/pixmaps/play_16px.png", SLOT( openDialog() ) );
+ ":/play", SLOT( openDialog() ) );
addMIMStaticEntry( p_intf, menu, qtr( "Stop" ), "",
- ":/pixmaps/stop_16px.png", SLOT( stop() ) );
+ ":/stop", SLOT( stop() ) );
addMIMStaticEntry( p_intf, menu, qtr( "Previous" ), "",
- ":/pixmaps/previous_16px.png", SLOT( prev() ) );
+ ":/previous", SLOT( prev() ) );
addMIMStaticEntry( p_intf, menu, qtr( "Next" ), "",
- ":/pixmaps/next_16px.png", SLOT( next() ) );
+ ":/next", SLOT( next() ) );
}
void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu )
QMenu *openmenu = new QMenu( qtr( "Open" ), menu );
addDPStaticEntry( openmenu, qtr( "&Open File..." ), "",
- ":/pixmaps/file-asym_16px.png", SLOT( openFileDialog() ) );
+ ":/file-asym", SLOT( openFileDialog() ) );
addDPStaticEntry( openmenu, qtr( I_OPEN_FOLDER ), "",
- ":/pixmaps/folder-grey_16px.png", SLOT( PLAppendDir() ) );
+ ":/folder-grey", SLOT( PLAppendDir() ) );
addDPStaticEntry( openmenu, qtr( "Open &Disc..." ), "",
- ":/pixmaps/disc_16px.png", SLOT( openDiscDialog() ) );
+ ":/disc", SLOT( openDiscDialog() ) );
addDPStaticEntry( openmenu, qtr( "Open &Network..." ), "",
- ":/pixmaps/network_16px.png", SLOT( openNetDialog() ) );
+ ":/network", SLOT( openNetDialog() ) );
addDPStaticEntry( openmenu, qtr( "Open &Capture Device..." ), "",
- ":/pixmaps/capture-card_16px.png", SLOT( openCaptureDialog() ) );
+ ":/capture-card", SLOT( openCaptureDialog() ) );
menu->addMenu( openmenu );
menu->addSeparator();
menu->addMenu( helpmenu );
#endif
- addDPStaticEntry( menu, qtr( "Quit" ), "", ":/pixmaps/menus_quit_16px.png",
+ addDPStaticEntry( menu, qtr( "Quit" ), "", ":/quit",
SLOT( quit() ), "Ctrl+Q" );
}
if( !b_isFullscreen )
{
submenu = new QMenu( qtr( "Interface" ), menu );
- submenu->addAction( QIcon( ":/pixmaps/playlist_16px.png" ),
+ submenu->addAction( QIcon( ":/playlist" ),
qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
addDPStaticEntry( submenu, qtr( I_MENU_EXT ), "",
- ":/pixmaps/menus_settings_16px.png", SLOT( extendedDialog() ) );
+ ":/settings", SLOT( extendedDialog() ) );
action = submenu->addAction( QIcon( "" ),
qtr( "Minimal View..." ), mi, SLOT( toggleMinimalView() ) );
action->setCheckable( true );
sysMenu->addSeparator();
addDPStaticEntry( sysMenu, qtr( "&Open Media" ), "",
- ":/pixmaps/file-wide_16px.png", SLOT( openFileDialog() ), "" );
+ ":/file-wide", SLOT( openFileDialog() ), "" );
addDPStaticEntry( sysMenu, qtr( "&Quit" ) , "",
- ":/pixmaps/menus_quit_16px.png", SLOT( quit() ), "" );
+ ":/quit", SLOT( quit() ), "" );
/* Set the menu */
mi->getSysTray()->setContextMenu( sysMenu );
}
}
- /* Ugly specific stuff */
- if( strstr( varnames[i], "intf-add" ) )
- UpdateItem( p_intf, menu, varnames[i], p_object, false );
- else
- UpdateItem( p_intf, menu, varnames[i], p_object, true );
+ UpdateItem( p_intf, menu, varnames[i], p_object, true );
if( p_object )
vlc_object_release( p_object );
}