X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fmenus.hpp;h=07384e15ce5c33dfeb6bd5b058dd00ce7136b12b;hb=5ec2ab65b9da97c218818273f7a8e62cd7eaee09;hp=2561b14fe39057a4fc8424786f3edf6312c5c383;hpb=2b60288a8db042caf7d6499aff78f1ffbdf2876c;p=vlc diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp index 2561b14fe3..07384e15ce 100644 --- a/modules/gui/qt4/menus.hpp +++ b/modules/gui/qt4/menus.hpp @@ -5,6 +5,7 @@ * $Id$ * * Authors: Clément Stenac + * Jean-Baptiste Kempf * * 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 @@ -18,20 +19,29 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ #ifndef _MENUS_H_ #define _MENUS_H_ #include "qt4.hpp" + #include #include -#include + +/* Folder vs. Directory */ +#if defined( WIN32 ) || defined(__APPLE__) +#define I_OPEN_FOLDER "Open &Folder..." +#else +#define I_OPEN_FOLDER "Open D&irectory..." +#endif //WIN32 using namespace std; class QMenu; class QMenuBar; +class QSystemTrayIcon; class MenuItemData : public QObject { @@ -48,9 +58,9 @@ public: } virtual ~MenuItemData() { - if( psz_var ) free( psz_var ); - if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING) - && val.psz_string ) free( val.psz_string ); + free( psz_var ); + if( ( i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) + free( val.psz_string ); } int i_object_id; int i_val_type; @@ -62,29 +72,30 @@ class QVLCMenu : public QObject { Q_OBJECT; public: - static void createMenuBar( MainInterface *mi, intf_thread_t *, - bool, bool, bool ); + static void createMenuBar( MainInterface *mi, intf_thread_t *, bool ); /* Menus */ static QMenu *FileMenu(); static QMenu *SDMenu( intf_thread_t * ); - static QMenu *PlaylistMenu( MainInterface *, intf_thread_t *); - static QMenu *ToolsMenu( intf_thread_t *, MainInterface *, bool, bool, - bool with = true ); - static QMenu *NavigMenu( intf_thread_t * , QMenu * ); - static QMenu *VideoMenu( intf_thread_t * , QMenu * ); - static QMenu *AudioMenu( intf_thread_t * , QMenu * ); + static QMenu *PlaylistMenu( intf_thread_t *, MainInterface * ); + static QMenu *ToolsMenu( intf_thread_t *, QMenu *, MainInterface *, bool, bool with = true ); + static QMenu *NavigMenu( intf_thread_t *, QMenu * ); + static QMenu *VideoMenu( intf_thread_t *, QMenu * ); + static QMenu *AudioMenu( intf_thread_t *, QMenu * ); static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * ); - static QMenu *HelpMenu(); + static QMenu *HelpMenu( QMenu * ); /* Popups Menus */ static void AudioPopupMenu( intf_thread_t * ); static void VideoPopupMenu( intf_thread_t * ); static void MiscPopupMenu( intf_thread_t * ); static void PopupMenu( intf_thread_t *, bool ); - + static void PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu ); + static void PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf, + input_thread_t *p_input ); /* Systray */ - static void updateSystrayMenu( MainInterface *,intf_thread_t * ); + static void updateSystrayMenu( MainInterface *,intf_thread_t *, + bool b_force_visible = false); /* Actions */ static void DoAction( intf_thread_t *, QObject * ); @@ -96,7 +107,8 @@ private: static void CreateAndConnect( QMenu *, const char *, QString, QString, int, int, vlc_value_t, int, bool c = false ); - static void CreateItem( QMenu *, const char *, vlc_object_t *, bool ); + static void UpdateItem( intf_thread_t *, QMenu *, const char *, + vlc_object_t *, bool ); static int CreateChoicesMenu( QMenu *,const char *, vlc_object_t *, bool ); }; @@ -110,8 +122,8 @@ public: { switch( id ) { - case 1: QVLCMenu::VideoMenu( p_intf, menu ); break; - case 2: QVLCMenu::AudioMenu( p_intf, menu ); break; + case 1: QVLCMenu::AudioMenu( p_intf, menu ); break; + case 2: QVLCMenu::VideoMenu( p_intf, menu ); break; case 3: QVLCMenu::NavigMenu( p_intf, menu ); break; case 4: QVLCMenu::InterfacesMenu( p_intf, menu ); break; }