Commit dfab7288 authored by Anil Daoud's avatar Anil Daoud

* wxwindows/*: disable systray code for wx2.4 (Thanks Gildas)

parent 5ff0a308
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
/* include the icon graphic */ /* include the icon graphic */
#include "../../../share/vlc32x32.xpm" #include "../../../share/vlc32x32.xpm"
/* include a small icon graphic for the systray icon */ /* include a small icon graphic for the systray icon */
#ifdef wxHAS_TASK_BAR_ICON
#include "../../../share/vlc16x16.xpm" #include "../../../share/vlc16x16.xpm"
#endif
/***************************************************************************** /*****************************************************************************
* Local class declarations. * Local class declarations.
...@@ -100,6 +102,7 @@ BEGIN_EVENT_TABLE(wxVolCtrl, wxWindow) ...@@ -100,6 +102,7 @@ BEGIN_EVENT_TABLE(wxVolCtrl, wxWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
/* Systray integration */ /* Systray integration */
#ifdef wxHAS_TASK_BAR_ICON
class Systray: public wxTaskBarIcon class Systray: public wxTaskBarIcon
{ {
public: public:
...@@ -117,7 +120,7 @@ private: ...@@ -117,7 +120,7 @@ private:
Interface* p_main_interface; Interface* p_main_interface;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif
/***************************************************************************** /*****************************************************************************
* Event Table. * Event Table.
...@@ -225,6 +228,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame) ...@@ -225,6 +228,7 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
END_EVENT_TABLE() END_EVENT_TABLE()
#ifdef wxHAS_TASK_BAR_ICON
BEGIN_EVENT_TABLE(Systray, wxTaskBarIcon) BEGIN_EVENT_TABLE(Systray, wxTaskBarIcon)
/* Mouse events */ /* Mouse events */
EVT_TASKBAR_LEFT_DOWN(Systray::OnLeftClick) EVT_TASKBAR_LEFT_DOWN(Systray::OnLeftClick)
...@@ -236,6 +240,7 @@ BEGIN_EVENT_TABLE(Systray, wxTaskBarIcon) ...@@ -236,6 +240,7 @@ BEGIN_EVENT_TABLE(Systray, wxTaskBarIcon)
EVT_MENU(PrevStream_Event, Systray::OnPrevStream) EVT_MENU(PrevStream_Event, Systray::OnPrevStream)
EVT_MENU(StopStream_Event, Systray::OnStopStream) EVT_MENU(StopStream_Event, Systray::OnStopStream)
END_EVENT_TABLE() END_EVENT_TABLE()
#endif
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
...@@ -253,7 +258,7 @@ Interface::Interface( intf_thread_t *_p_intf, long style ): ...@@ -253,7 +258,7 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
extra_window = NULL; extra_window = NULL;
/* Give our interface a nice little icon */ /* Give our interface a nice little icon */
SetIcon( wxIcon( vlc16x16_xpm ) ); SetIcon( wxIcon( vlc_xpm ) );
/* Create a sizer for the main frame */ /* Create a sizer for the main frame */
frame_sizer = new wxBoxSizer( wxVERTICAL ); frame_sizer = new wxBoxSizer( wxVERTICAL );
...@@ -265,17 +270,19 @@ Interface::Interface( intf_thread_t *_p_intf, long style ): ...@@ -265,17 +270,19 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
p_dummy->SetFocus(); p_dummy->SetFocus();
frame_sizer->Add( p_dummy, 0, 0 ); frame_sizer->Add( p_dummy, 0, 0 );
#ifdef wxHAS_TASK_BAR_ICON
/* Systray integration */ /* Systray integration */
p_systray = NULL; p_systray = NULL;
if ( config_GetInt( p_intf, "wxwin-systray" ) ) if ( config_GetInt( p_intf, "wxwin-systray" ) )
{ {
p_systray = new Systray(this); p_systray = new Systray(this);
p_systray->SetIcon( wxIcon( vlc_xpm ), wxT("VLC media player") ); p_systray->SetIcon( wxIcon( vlc16x16_xpm ), wxT("VLC media player") );
if ( (! p_systray->IsOk()) || (! p_systray->IsIconInstalled()) ) if ( (! p_systray->IsOk()) || (! p_systray->IsIconInstalled()) )
{ {
msg_Warn(p_intf, "Cannot set systray icon, weird things may happen"); msg_Warn(p_intf, "Cannot set systray icon, weird things may happen");
} }
} }
#endif
/* Creation of the menu bar */ /* Creation of the menu bar */
CreateOurMenuBar(); CreateOurMenuBar();
...@@ -328,10 +335,12 @@ Interface::Interface( intf_thread_t *_p_intf, long style ): ...@@ -328,10 +335,12 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
Interface::~Interface() Interface::~Interface()
{ {
#ifdef wxHAS_TASK_BAR_ICON
if( p_systray ) if( p_systray )
{ {
delete p_systray; delete p_systray;
} }
#endif
if( p_intf->p_sys->p_wxwindow ) if( p_intf->p_sys->p_wxwindow )
{ {
...@@ -1299,6 +1308,7 @@ void wxVolCtrl::UpdateVolume() ...@@ -1299,6 +1308,7 @@ void wxVolCtrl::UpdateVolume()
* Definition of Systray class. * Definition of Systray class.
*****************************************************************************/ *****************************************************************************/
#ifdef wxHAS_TASK_BAR_ICON
Systray::Systray( Interface *_p_main_interface ) Systray::Systray( Interface *_p_main_interface )
{ {
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
...@@ -1349,4 +1359,5 @@ wxMenu* Systray::CreatePopupMenu() ...@@ -1349,4 +1359,5 @@ wxMenu* Systray::CreatePopupMenu()
systray_menu->Append( Iconize_Event, wxU(_("Show/Hide interface")) ); systray_menu->Append( Iconize_Event, wxU(_("Show/Hide interface")) );
return systray_menu; return systray_menu;
} }
#endif
...@@ -117,8 +117,10 @@ vlc_module_begin(); ...@@ -117,8 +117,10 @@ vlc_module_begin();
BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT, VLC_FALSE ); BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT, VLC_FALSE );
add_bool( "wxwin-taskbar", 1, NULL, add_bool( "wxwin-taskbar", 1, NULL,
TASKBAR_TEXT, TASKBAR_LONGTEXT, VLC_FALSE ); TASKBAR_TEXT, TASKBAR_LONGTEXT, VLC_FALSE );
#ifdef wxHAS_TASK_BAR_ICON
add_bool( "wxwin-systray", 0, NULL, add_bool( "wxwin-systray", 0, NULL,
SYSTRAY_TEXT, SYSTRAY_LONGTEXT, VLC_FALSE ); SYSTRAY_TEXT, SYSTRAY_LONGTEXT, VLC_FALSE );
#endif
add_submodule(); add_submodule();
set_description( _("wxWindows dialogs provider") ); set_description( _("wxWindows dialogs provider") );
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <wx/taskbar.h> #include <wx/taskbar.h>
#include "vlc_keys.h" #include "vlc_keys.h"
/* Hmmm, work-around for newest wxWin */ /* Hmmm, work-around for newest wxWin */
#ifdef wxStaticCastEvent #ifdef wxStaticCastEvent
# undef wxStaticCastEvent # undef wxStaticCastEvent
...@@ -94,7 +93,9 @@ class DialogsProvider; ...@@ -94,7 +93,9 @@ class DialogsProvider;
class PrefsTreeCtrl; class PrefsTreeCtrl;
class AutoBuiltPanel; class AutoBuiltPanel;
class VideoWindow; class VideoWindow;
#ifdef wxHAS_TASK_BAR_ICON
class Systray; class Systray;
#endif
/***************************************************************************** /*****************************************************************************
* intf_sys_t: description and status of wxwindows interface * intf_sys_t: description and status of wxwindows interface
...@@ -321,7 +322,9 @@ public: ...@@ -321,7 +322,9 @@ public:
vlc_bool_t b_undock; vlc_bool_t b_undock;
wxGauge *volctrl; wxGauge *volctrl;
#ifdef wxHAS_TASK_BAR_ICON
Systray *p_systray; Systray *p_systray;
#endif
private: private:
void SetupHotkeys(); void SetupHotkeys();
......
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