]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/wxwidgets.cpp
Accelerators fixed, noticed by Cristi
[vlc] / modules / gui / wxwidgets / wxwidgets.cpp
index ffeb2d36fe733c1c89f5264f0d5b44c217686275..a919fa3cb457cb1607661ff3817995a99452578b 100644 (file)
@@ -30,7 +30,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_interface.h>
 
 #ifdef HAVE_LOCALE_H
@@ -111,17 +112,16 @@ private:
                 "less features). You can select which one will be available " \
                 "on the toolbar (or both)." )
 
-static int pi_playlist_views[] = { 0,1,2 };
-static const char *psz_playlist_views[] = { N_("Normal" ), N_("Embedded" ) ,
-                                            N_("Both") };
+static const int pi_playlist_views[] = { 0,1,2 };
+static const char *const psz_playlist_views[] = {
+    N_("Normal" ), N_("Embedded" ), N_("Both") };
 
 vlc_module_begin();
-    int i_score = 150;
-    set_shortname( (char*) "wxWidgets" );
-    set_description( (char *) _("wxWidgets interface module") );
+    set_shortname( "wxWidgets" );
+    set_description( N_("wxWidgets interface module") );
     set_category( CAT_INTERFACE );
     set_subcategory( SUBCAT_INTERFACE_MAIN );
-    set_capability( "interface", i_score );
+    set_capability( "interface", 150 );
     set_callbacks( Open, Close );
     add_shortcut( "wxwindows" );
     add_shortcut( "wxwin" );
@@ -164,7 +164,7 @@ vlc_module_begin();
         add_deprecated_alias( "wxwin-config-last" ); /*Deprecated since 0.8.4*/
 
     add_submodule();
-    set_description( _("wxWidgets dialogs provider") );
+    set_description( N_("wxWidgets dialogs provider") );
     set_capability( "dialogs provider", 50 );
     set_callbacks( OpenDialogs, Close );
 
@@ -190,15 +190,12 @@ static int Open( vlc_object_t *p_this )
     /* Allocate instance and initialize some members */
     p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
     if( p_intf->p_sys == NULL )
-    {
-        msg_Err( p_intf, "out of memory" );
         return VLC_ENOMEM;
-    }
     memset( p_intf->p_sys, 0, sizeof( intf_sys_t ) );
 
     p_intf->pf_run = Run;
 
-    p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL );
+    p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
 
     /* Initialize wxWidgets thread */
     p_intf->p_sys->b_playing = 0;
@@ -211,9 +208,6 @@ static int Open( vlc_object_t *p_this )
 
     p_intf->pf_show_dialog = NULL;
 
-    /* We support play on start */
-    p_intf->b_play = true;
-
     p_intf->p_sys->b_video_autosize =
         config_GetInt( p_intf, "wx-autosize" );
 
@@ -237,9 +231,9 @@ static void Close( vlc_object_t *p_this )
 {
     intf_thread_t *p_intf = (intf_thread_t *)p_this;
 
-    vlc_mutex_lock( &p_intf->object_lock );
+    vlc_object_lock( p_intf );
     p_intf->b_dead = true;
-    vlc_mutex_unlock( &p_intf->object_lock );
+    vlc_object_unlock( p_intf );
 
     if( p_intf->pf_show_dialog )
     {
@@ -393,19 +387,6 @@ bool Instance::OnInit()
     /* OK, initialization is over */
     vlc_thread_ready( p_intf );
 
-    /* Check if we need to start playing */
-    if( !p_intf->pf_show_dialog && p_intf->b_play )
-    {
-        playlist_t *p_playlist =
-            (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                           FIND_ANYWHERE );
-        if( p_playlist )
-        {
-            playlist_Control( p_playlist, PLAYLIST_PLAY, false );
-            vlc_object_release( p_playlist );
-        }
-    }
-
     /* Return TRUE to tell program to continue (FALSE would terminate) */
     return TRUE;
 }