Commit 387d1ce6 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: provide QAction roles for menu roles

parent e15e0503
...@@ -93,7 +93,9 @@ void addDPStaticEntry( QMenu *menu, ...@@ -93,7 +93,9 @@ void addDPStaticEntry( QMenu *menu,
const QString& text, const QString& text,
const char *icon, const char *icon,
const char *member, const char *member,
const char *shortcut = NULL ) const char *shortcut = NULL,
QAction::MenuRole = QAction::NoRole
)
{ {
QAction *action = NULL; QAction *action = NULL;
#ifndef __APPLE__ /* We don't set icons in menus in MacOS X */ #ifndef __APPLE__ /* We don't set icons in menus in MacOS X */
...@@ -398,7 +400,7 @@ QMenu *QVLCMenu::ToolsMenu( QMenu *menu ) ...@@ -398,7 +400,7 @@ QMenu *QVLCMenu::ToolsMenu( QMenu *menu )
menu->addSeparator(); menu->addSeparator();
addDPStaticEntry( menu, qtr( "&Preferences" ), addDPStaticEntry( menu, qtr( "&Preferences" ),
":/menu/preferences", SLOT( prefsDialog() ), "Ctrl+P" ); ":/menu/preferences", SLOT( prefsDialog() ), "Ctrl+P", QAction::PreferencesRole );
return menu; return menu;
} }
...@@ -762,7 +764,7 @@ QMenu *QVLCMenu::HelpMenu( QWidget *parent ) ...@@ -762,7 +764,7 @@ QMenu *QVLCMenu::HelpMenu( QWidget *parent )
#endif #endif
menu->addSeparator(); menu->addSeparator();
addDPStaticEntry( menu, qtr( I_MENU_ABOUT ), ":/menu/info", addDPStaticEntry( menu, qtr( I_MENU_ABOUT ), ":/menu/info",
SLOT( aboutDialog() ), "Shift+F1" ); SLOT( aboutDialog() ), "Shift+F1", QAction::AboutRole );
return menu; return menu;
} }
...@@ -901,7 +903,7 @@ void QVLCMenu::PopupMenuStaticEntries( QMenu *menu ) ...@@ -901,7 +903,7 @@ void QVLCMenu::PopupMenuStaticEntries( QMenu *menu )
#endif #endif
addDPStaticEntry( menu, qtr( "Quit" ), ":/menu/quit", addDPStaticEntry( menu, qtr( "Quit" ), ":/menu/quit",
SLOT( quit() ), "Ctrl+Q" ); SLOT( quit() ), "Ctrl+Q", QAction::QuitRole );
} }
/* Video Tracks and Subtitles tracks */ /* Video Tracks and Subtitles tracks */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment