Commit e171f5be authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Menu consistency for Tools.

parent ad74fb3b
...@@ -125,7 +125,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -125,7 +125,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Menu Bar */ /* Menu Bar */
QVLCMenu::createMenuBar( this, p_intf, playlistEmbeddedFlag, QVLCMenu::createMenuBar( this, p_intf, playlistEmbeddedFlag,
isAdvancedVisible(), visualSelectorEnabled ); visualSelectorEnabled );
/* Status Bar */ /* Status Bar */
/** /**
...@@ -245,7 +245,7 @@ MainInterface::~MainInterface() ...@@ -245,7 +245,7 @@ MainInterface::~MainInterface()
} }
settings->setValue( "playlist-embedded", playlistEmbeddedFlag ); settings->setValue( "playlist-embedded", playlistEmbeddedFlag );
settings->setValue( "adv-controls", isAdvancedVisible() ); settings->setValue( "adv-controls", getControlsVisibilityStatus() & 0x1 );
settings->setValue( "pos", pos() ); settings->setValue( "pos", pos() );
settings->endGroup(); settings->endGroup();
delete settings; delete settings;
...@@ -591,8 +591,7 @@ void MainInterface::undockPlaylist() ...@@ -591,8 +591,7 @@ void MainInterface::undockPlaylist()
playlistEmbeddedFlag = false; playlistEmbeddedFlag = false;
menuBar()->clear(); menuBar()->clear();
QVLCMenu::createMenuBar( this, p_intf, false, isAdvancedVisible(), QVLCMenu::createMenuBar( this, p_intf, false, visualSelectorEnabled);
visualSelectorEnabled);
if( videoIsActive ) if( videoIsActive )
{ {
...@@ -649,9 +648,10 @@ void MainInterface::toggleAdvanced() ...@@ -649,9 +648,10 @@ void MainInterface::toggleAdvanced()
controls->toggleAdvanced(); controls->toggleAdvanced();
} }
bool MainInterface::isAdvancedVisible() int MainInterface::getControlsVisibilityStatus()
{ {
return controls->b_advancedVisible; return( (controls->isVisible() ? 0x2 : 0x0 )
+ controls->b_advancedVisible );
} }
/************************************************************************ /************************************************************************
...@@ -907,8 +907,7 @@ void MainInterface::customEvent( QEvent *event ) ...@@ -907,8 +907,7 @@ void MainInterface::customEvent( QEvent *event )
PlaylistDialog::killInstance(); PlaylistDialog::killInstance();
playlistEmbeddedFlag = true; playlistEmbeddedFlag = true;
menuBar()->clear(); menuBar()->clear();
QVLCMenu::createMenuBar(this, p_intf, true, isAdvancedVisible(), QVLCMenu::createMenuBar(this, p_intf, true, visualSelectorEnabled);
visualSelectorEnabled);
togglePlaylist(); togglePlaylist();
} }
else if ( event->type() == SetVideoOnTopEvent_Type ) else if ( event->type() == SetVideoOnTopEvent_Type )
......
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
QSystemTrayIcon *getSysTray() { return sysTray; }; QSystemTrayIcon *getSysTray() { return sysTray; };
QMenu *getSysTrayMenu() { return systrayMenu; }; QMenu *getSysTrayMenu() { return systrayMenu; };
bool isAdvancedVisible(); int getControlsVisibilityStatus();
protected: protected:
void resizeEvent( QResizeEvent * ); void resizeEvent( QResizeEvent * );
void dropEvent( QDropEvent *); void dropEvent( QDropEvent *);
......
...@@ -164,7 +164,7 @@ static int AudioAutoMenuBuilder( vlc_object_t *p_object, ...@@ -164,7 +164,7 @@ static int AudioAutoMenuBuilder( vlc_object_t *p_object,
* Main Menu Bar Creation * Main Menu Bar Creation
**/ **/
void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf, void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
bool playlist, bool adv_controls_enabled, bool playlist,
bool visual_selector_enabled ) bool visual_selector_enabled )
{ {
QMenuBar *bar = mi->menuBar(); QMenuBar *bar = mi->menuBar();
...@@ -173,8 +173,7 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf, ...@@ -173,8 +173,7 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
{ {
BAR_ADD( PlaylistMenu( mi,p_intf ), qtr("&Playlist" ) ); BAR_ADD( PlaylistMenu( mi,p_intf ), qtr("&Playlist" ) );
} }
BAR_ADD( ToolsMenu( p_intf, mi, adv_controls_enabled, BAR_ADD( ToolsMenu( p_intf, mi, visual_selector_enabled, true ), qtr("&Tools") );
visual_selector_enabled ), qtr("&Tools") );
BAR_DADD( AudioMenu( p_intf, NULL ), qtr("&Audio"), 2 ); BAR_DADD( AudioMenu( p_intf, NULL ), qtr("&Audio"), 2 );
BAR_DADD( VideoMenu( p_intf, NULL ), qtr("&Video"), 1 ); BAR_DADD( VideoMenu( p_intf, NULL ), qtr("&Video"), 1 );
BAR_DADD( NavigMenu( p_intf, NULL ), qtr("&Navigation"), 3 ); BAR_DADD( NavigMenu( p_intf, NULL ), qtr("&Navigation"), 3 );
...@@ -189,18 +188,11 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf, ...@@ -189,18 +188,11 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
QMenu *QVLCMenu::FileMenu() QMenu *QVLCMenu::FileMenu()
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
DP_SADD( menu, qtr("Open &File..." ), "", DP_SADD( menu, qtr("Open &File..." ), "",
":/pixmaps/vlc_file-asym_16px.png", openFileDialog(), "Ctrl+O" ); ":/pixmaps/vlc_file-asym_16px.png", openFileDialog(), "Ctrl+O" );
DP_SADD( menu, qtr( I_OPEN_FOLDER ), "",
/* Folder vs. Directory */
#ifdef WIN32
DP_SADD( menu, qtr( "Open Folder..." ), "",
":/pixmaps/vlc_folder-grey_16px.png", openDirDialog(), "Ctrl+F" );
#else
DP_SADD( menu, qtr( "Open Directory..." ), "",
":/pixmaps/vlc_folder-grey_16px.png", openDirDialog(), "Ctrl+F" ); ":/pixmaps/vlc_folder-grey_16px.png", openDirDialog(), "Ctrl+F" );
#endif /* WIN32 */
DP_SADD( menu, qtr("Open &Disc..." ), "", ":/pixmaps/vlc_disc_16px.png", DP_SADD( menu, qtr("Open &Disc..." ), "", ":/pixmaps/vlc_disc_16px.png",
openDiscDialog(), "Ctrl+D" ); openDiscDialog(), "Ctrl+D" );
DP_SADD( menu, qtr("Open &Network..." ), "", DP_SADD( menu, qtr("Open &Network..." ), "",
...@@ -209,10 +201,12 @@ QMenu *QVLCMenu::FileMenu() ...@@ -209,10 +201,12 @@ QMenu *QVLCMenu::FileMenu()
":/pixmaps/vlc_capture-card_16px.png", openCaptureDialog(), ":/pixmaps/vlc_capture-card_16px.png", openCaptureDialog(),
"Ctrl+C" ); "Ctrl+C" );
menu->addSeparator(); menu->addSeparator();
DP_SADD( menu, qtr("&Streaming..."), "", ":/pixmaps/vlc_stream_16px.png", DP_SADD( menu, qtr("&Streaming..."), "", ":/pixmaps/vlc_stream_16px.png",
openThenStreamingDialogs(), "Ctrl+S" ); openThenStreamingDialogs(), "Ctrl+S" );
DP_SADD( menu, qtr("Conve&rt / Save..."), "", "", DP_SADD( menu, qtr("Conve&rt / Save..."), "", "",
openThenTranscodingDialogs(), "Ctrl+R" ); openThenTranscodingDialogs(), "Ctrl+R" );
menu->addSeparator(); menu->addSeparator();
DP_SADD( menu, qtr("&Quit") , "", ":/pixmaps/vlc_quit_16px.png", quit(), DP_SADD( menu, qtr("&Quit") , "", ":/pixmaps/vlc_quit_16px.png", quit(),
"Ctrl+Q"); "Ctrl+Q");
...@@ -242,8 +236,8 @@ QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf ) ...@@ -242,8 +236,8 @@ QMenu *QVLCMenu::PlaylistMenu( MainInterface *mi, intf_thread_t *p_intf )
* longer. * longer.
**/ **/
QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
bool adv_controls_enabled, bool visual_selector_enabled,
bool visual_selector_enabled, bool with_intf ) bool with_intf )
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
if( with_intf ) if( with_intf )
...@@ -253,12 +247,14 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, ...@@ -253,12 +247,14 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
menu->addMenu( intfmenu ); menu->addMenu( intfmenu );
menu->addSeparator(); menu->addSeparator();
} }
DP_SADD( menu, qtr( I_MENU_MSG ), "", ":/pixmaps/vlc_messages_16px.png", DP_SADD( menu, qtr( I_MENU_MSG ), "", ":/pixmaps/vlc_messages_16px.png",
messagesDialog(), "Ctrl+M" ); messagesDialog(), "Ctrl+M" );
DP_SADD( menu, qtr( I_MENU_INFO ) , "", "", mediaInfoDialog(), "Ctrl+I" ); DP_SADD( menu, qtr( I_MENU_INFO ) , "", "", mediaInfoDialog(), "Ctrl+I" );
DP_SADD( menu, qtr( I_MENU_CODECINFO ) , "", ":/pixmaps/vlc_info_16px.png", DP_SADD( menu, qtr( I_MENU_CODECINFO ) , "", ":/pixmaps/vlc_info_16px.png",
mediaCodecDialog(), "Ctrl+J" ); mediaCodecDialog(), "Ctrl+J" );
DP_SADD( menu, qtr( I_MENU_GOTOTIME ), "","", gotoTimeDialog(), "Ctrl+T" ); DP_SADD( menu, qtr( I_MENU_GOTOTIME ), "","", gotoTimeDialog(), "Ctrl+T" );
#if 0 /* Not Implemented yet */ #if 0 /* Not Implemented yet */
DP_SADD( menu, qtr( I_MENU_BOOKMARK ), "","", bookmarksDialog(), "Ctrl+B" ); DP_SADD( menu, qtr( I_MENU_BOOKMARK ), "","", bookmarksDialog(), "Ctrl+B" );
DP_SADD( menu, qtr( I_MENU_VLM ), "","", vlmDialog(), "Ctrl+V" ); DP_SADD( menu, qtr( I_MENU_VLM ), "","", vlmDialog(), "Ctrl+V" );
...@@ -267,13 +263,16 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, ...@@ -267,13 +263,16 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
menu->addSeparator(); menu->addSeparator();
if( mi ) if( mi )
{ {
QAction *adv = menu->addAction( qtr("Advanced controls" ), /* Minimal View */
mi, SLOT( toggleAdvanced() ) ); QAction *action=menu->addAction( qtr( "Minimal View..." ), mi, SLOT( toggleMenus() ),
adv->setCheckable( true );
if( adv_controls_enabled ) adv->setChecked( true );
menu->addAction( qtr( "Hide Menus..." ), mi, SLOT( toggleMenus() ),
qtr( "Ctrl+H") ); qtr( "Ctrl+H") );
action->setCheckable( true );
if( mi->getControlsVisibilityStatus() & 0x2 ) action->setChecked( true );
/* Advanced Controls */
action = menu->addAction( qtr("Advanced controls" ), mi, SLOT( toggleAdvanced() ) );
action->setCheckable( true );
if( mi->getControlsVisibilityStatus() & 0x1 ) action->setChecked( true );
menu->addSeparator(); menu->addSeparator();
#if 0 /* For Visualisations. Not yet working */ #if 0 /* For Visualisations. Not yet working */
...@@ -286,6 +285,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi, ...@@ -286,6 +285,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, MainInterface *mi,
qtr( "Playlist"), mi, SLOT( togglePlaylist() ), qtr( "Playlist"), mi, SLOT( togglePlaylist() ),
qtr( "Ctrl+L") ); qtr( "Ctrl+L") );
} }
DP_SADD( menu, qtr( I_MENU_EXT ), "", ":/pixmaps/vlc_settings_16px.png", DP_SADD( menu, qtr( I_MENU_EXT ), "", ":/pixmaps/vlc_settings_16px.png",
extendedDialog() , "Ctrl+E" ); extendedDialog() , "Ctrl+E" );
...@@ -399,7 +399,7 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -399,7 +399,7 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
} }
/** /**
* Service Discovery Menu * Service Discovery SubMenu
**/ **/
QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
{ {
...@@ -503,7 +503,7 @@ QMenu *QVLCMenu::HelpMenu() ...@@ -503,7 +503,7 @@ QMenu *QVLCMenu::HelpMenu()
intfmenu->setTitle( qtr("Interfaces" ) ); \ intfmenu->setTitle( qtr("Interfaces" ) ); \
menu->addMenu( intfmenu ); \ menu->addMenu( intfmenu ); \
\ \
QMenu *toolsmenu = ToolsMenu( p_intf, NULL, false, false, false ); \ QMenu *toolsmenu = ToolsMenu( p_intf, NULL, false, false ); \
toolsmenu->setTitle( qtr("Tools" ) ); \ toolsmenu->setTitle( qtr("Tools" ) ); \
menu->addMenu( toolsmenu ); \ menu->addMenu( toolsmenu ); \
\ \
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -28,6 +29,13 @@ ...@@ -28,6 +29,13 @@
#include <QObject> #include <QObject>
#include <vector> #include <vector>
/* Folder vs. Directory */
#ifdef WIN32
#define I_OPEN_FOLDER "Open &Folder..."
#else
#define I_OPEN_FOLDER "Open D&irectory..."
#endif //WIN32
using namespace std; using namespace std;
class QMenu; class QMenu;
...@@ -64,14 +72,13 @@ class QVLCMenu : public QObject ...@@ -64,14 +72,13 @@ class QVLCMenu : public QObject
Q_OBJECT; Q_OBJECT;
public: public:
static void createMenuBar( MainInterface *mi, intf_thread_t *, static void createMenuBar( MainInterface *mi, intf_thread_t *,
bool, bool, bool ); bool, bool );
/* Menus */ /* Menus */
static QMenu *FileMenu(); static QMenu *FileMenu();
static QMenu *SDMenu( intf_thread_t * ); static QMenu *SDMenu( intf_thread_t * );
static QMenu *PlaylistMenu( MainInterface *, intf_thread_t *); static QMenu *PlaylistMenu( MainInterface *, intf_thread_t *);
static QMenu *ToolsMenu( intf_thread_t *, MainInterface *, bool, bool, static QMenu *ToolsMenu( intf_thread_t *, MainInterface *, bool, bool with = true );
bool with = true );
static QMenu *NavigMenu( intf_thread_t * , QMenu * ); static QMenu *NavigMenu( intf_thread_t * , QMenu * );
static QMenu *VideoMenu( intf_thread_t * , QMenu * ); static QMenu *VideoMenu( intf_thread_t * , QMenu * );
static QMenu *AudioMenu( intf_thread_t * , QMenu * ); static QMenu *AudioMenu( intf_thread_t * , QMenu * );
......
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