]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/interface.cpp
* skins2: when restoring the previous skin because a new one failed to load,
[vlc] / modules / gui / wxwidgets / interface.cpp
index 8e1bab970455188eb935770889c19f7d90e77e35..4bb35c30679fd875d610842710c32e8e5fe1b9d0 100644 (file)
@@ -364,6 +364,7 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
     b_extra = VLC_FALSE;
     extra_frame = 0;
     playlist_manager = 0;
+    i_update_counter = 0;
 
 
     /* Give our interface a nice little icon */
@@ -529,9 +530,11 @@ void Interface::Init()
 void Interface::Update()
 {
     /* Misc updates */
-    ((VLCVolCtrl *)volctrl)->UpdateVolume();
+    if( !(i_update_counter % 10) ) ((VLCVolCtrl *)volctrl)->UpdateVolume();
 
     if( playlist_manager ) playlist_manager->Update();
+
+    i_update_counter++;
 }
 
 void Interface::OnControlEvent( wxCommandEvent& event )
@@ -590,7 +593,7 @@ void Interface::CreateOurMenuBar()
     }
     view_menu->Append( Logs_Event, wxU(_("&Messages...\tCtrl-M")) );
     view_menu->Append( FileInfo_Event,
-                       wxU(_("Stream and Media &info...\tCtrl-I")) );
+                       wxU(_("Stream and Media &Info...\tCtrl-I")) );
     view_menu->Append( VLM_Event,
                        wxU(_("VLM Control...\tCtrl-V")) );
 
@@ -604,7 +607,7 @@ void Interface::CreateOurMenuBar()
     wxMenu *help_menu = new wxMenu;
     help_menu->Append( About_Event, wxU(_("About...")) );
     help_menu->AppendSeparator();
-    help_menu->Append( UpdateVLC_Event, wxU(_("Check for updates...")) );
+    help_menu->Append( UpdateVLC_Event, wxU(_("Check for Updates...")) );
 
     /* Append the freshly created menus to the menu bar... */
     wxMenuBar *menubar = new wxMenuBar();
@@ -1283,11 +1286,31 @@ bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
         return FALSE;
     }
 
+    /* If we drag & drop a subtitle file, add it on the fly */
+    if( filenames.GetCount() == 1 )
+    {
+        char *psz_utf8 = wxDnDFromLocale( filenames[0] );
+        input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_intf,
+                                            VLC_OBJECT_INPUT, FIND_ANYWHERE );
+        if( p_input )
+        {
+            if( input_AddSubtitles( p_input, psz_utf8, VLC_TRUE ) )
+            {
+                vlc_object_release( p_input );
+                wxDnDLocaleFree( psz_utf8 );
+                vlc_object_release( p_playlist );
+                return TRUE;
+            }
+            vlc_object_release( p_input );
+        }
+        wxDnDLocaleFree( psz_utf8 );
+    }
+
     for( size_t i = 0; i < filenames.GetCount(); i++ )
     {
         char *psz_utf8 = wxDnDFromLocale( filenames[i] );
 
-        playlist_Add( p_playlist, psz_utf8, psz_utf8,
+        playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8,
                       PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO),
                       PLAYLIST_END );
 
@@ -1493,7 +1516,7 @@ wxMenu* Systray::CreatePopupMenu()
     systray_menu->Append( StopStream_Event, wxU(_("Stop")) );
     }
     systray_menu->AppendSeparator();
-    systray_menu->Append( Iconize_Event, wxU(_("Show/Hide interface")) );
+    systray_menu->Append( Iconize_Event, wxU(_("Show/Hide Interface")) );
     return systray_menu;
 }