]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlist.m
Merge [11470],[11471],[11474] and [11475] - Closes: #205
[vlc] / modules / gui / macosx / playlist.m
index 937dad62c3cb903a381982dd61c2adb79c2300cf..8674a4300346fc923503a81dd4ebf98c649a0c2a 100644 (file)
@@ -243,6 +243,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
 #if 0
     [o_search_button setTitle: _NS("Search")];
 #endif
+    [o_search_field setToolTip: _NS("Search in Playlist")];
     [[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")];
     [[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")];
     [[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")];
@@ -366,6 +367,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
 
     if ( p_temp_item )
     {
+        vlc_mutex_lock( &p_playlist->object_lock );
         while( p_temp_item->i_parents > 0 )
         {
             int i;
@@ -376,6 +378,7 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
                     if( p_temp_item->pp_parents[i]->p_parent == p_node )
                     {
                         vlc_object_release( p_playlist );
+                        vlc_mutex_unlock( &p_playlist->object_lock );
                         return YES;
                     }
                     else
@@ -386,12 +389,31 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
                 }
             }
         }
+        vlc_mutex_unlock( &p_playlist->object_lock );
     }
 
     vlc_object_release( p_playlist );
     return NO;
 }
 
+- (IBAction)savePlaylist:(id)sender
+{
+    intf_thread_t * p_intf = VLCIntf;
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+
+    NSSavePanel *o_save_panel = [NSSavePanel savePanel];
+    NSString * o_name = [NSString stringWithFormat: @"%@.m3u", _NS("Untitled")];
+    [o_save_panel setTitle: _NS("Save Playlist")];
+    [o_save_panel setPrompt: _NS("Save")];
+
+    if( [o_save_panel runModalForDirectory: nil
+            file: o_name] == NSOKButton )
+    {
+        playlist_Export( p_playlist, [[o_save_panel filename] fileSystemRepresentation], "export-m3u" );
+    }
+}
+
 
 /* When called retrieves the selected outlineview row and plays that node or item */
 - (IBAction)playItem:(id)sender