]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/playlistinfo.m
* theme_repository.*: the popup menu for skin selection works !
[vlc] / modules / gui / macosx / playlistinfo.m
index 95c3fe59ce6b6614072a100da30e722df72b0d04..04b6b210d81b676510eb5ae7050e67249adac517 100644 (file)
@@ -61,8 +61,8 @@
     [o_uri_lbl setStringValue: _NS("URI")];
     [o_title_lbl setStringValue: _NS("Title")];
     [o_author_lbl setStringValue: _NS("Author")];
-    [o_btn_info_ok setTitle: _NS("OK")];
-    [o_btn_info_cancel setTitle: _NS("Cancel")];
+    [o_btn_ok setTitle: _NS("OK")];
+    [o_btn_cancel setTitle: _NS("Cancel")];
     [o_btn_delete_group setTitle: _NS("Delete Group")];
     [o_btn_add_group setTitle: _NS("Add Group")];
     [o_group_lbl setStringValue: _NS("Group")];
@@ -76,8 +76,8 @@
     }
     else
     {
-        i_item = [[[NSApp delegate] getPlaylist] selectedPlaylistItem];
-        o_selected = [[[NSApp delegate] getPlaylist] selectedPlaylistItemsList];
+        i_item = [[[VLCMain sharedInstance] getPlaylist] selectedPlaylistItem];
+        o_selected = [[[VLCMain sharedInstance] getPlaylist] selectedPlaylistItemsList];
         [o_selected retain];
         [self initPanel:sender];
     }
@@ -91,7 +91,7 @@
     }
     else
     {
-        intf_thread_t * p_intf = [NSApp getIntf];
+        intf_thread_t * p_intf = VLCIntf;
         playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
 
 
 - (void)initPanel:(id)sender
 {
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist;
 
     p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
 
 
-    if (p_playlist)
+    if( p_playlist )
     {
+        char *psz_temp;
+
         /*fill uri / title / author info */
         [o_uri_txt setStringValue:
             ([NSString stringWithUTF8String:p_playlist->
             [NSString stringWithUTF8String:p_playlist->
                 pp_items[i_item]->input.psz_name]];
 
-        [o_author_txt setStringValue:
-            [NSString stringWithUTF8String:playlist_GetInfo
-            (p_playlist, i_item ,_("General"),_("Author") )]];
+        psz_temp = playlist_GetInfo( p_playlist, i_item ,_("General"),_("Author") );
+        [o_author_txt setStringValue: [NSString stringWithUTF8String: psz_temp]];
+        free( psz_temp );
 
         [[VLCInfoTreeItem rootItem] refresh];
         [o_outline_view reloadData];
 - (IBAction)infoOk:(id)sender
 {
     int i,i_row,c;
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
     vlc_value_t val;
 
 - (IBAction)handleGroup:(id)sender
 {
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
 
         if ([[o_group_cbx stringValue] isEqual:
                     [o_group_cbx objectValueOfSelectedItem]])
         {
-            [o_group_color setBackgroundColor:[[[NSApp delegate] getPlaylist]
+            [o_group_color setBackgroundColor:[[[VLCMain sharedInstance] getPlaylist]
                 getColor: p_playlist->pp_groups[
                 [o_group_cbx indexOfSelectedItem]]->i_id]];
         }
         else
         {
-            [o_group_color setBackgroundColor:[[[NSApp delegate] getPlaylist]
+            [o_group_color setBackgroundColor:[[[VLCMain sharedInstance] getPlaylist]
                 getColor:p_playlist->pp_groups[
                 [o_group_cbx numberOfItems] - 1]->i_id + 1]];
         }
 
 - (IBAction)deleteOutlineGroup:(id)sender
 {
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
 
         if ([[o_group_cbx stringValue] isEqual:
                     [o_group_cbx objectValueOfSelectedItem]])
         {
-            [[[NSApp delegate] getPlaylist] deleteGroup:p_playlist->pp_groups[
+            [[[VLCMain sharedInstance] getPlaylist] deleteGroup:p_playlist->pp_groups[
                     [o_group_cbx indexOfSelectedItem]]->i_id];
             [self createComboBox];
             [self handleGroup:self];
 
 - (IBAction)createOutlineGroup:(id)sender;
 {
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
     if(p_playlist)
                     strdup([[o_group_cbx stringValue] cString]));
         [self createComboBox];
         [o_group_cbx reloadData];
-        [[[NSApp delegate] getPlaylist] playlistUpdated];
+        [[[VLCMain sharedInstance] getPlaylist] playlistUpdated];
         vlc_object_release(p_playlist);
     }
 }
 
 -(void)createComboBox
 {
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
     int i;
 {
     BOOL bEnabled = TRUE;
 
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
                                                        FIND_ANYWHERE );
 
@@ -385,7 +387,7 @@ static VLCInfoTreeItem *o_root_item = nil;
         o_value = [o_item_value copy];
         i_object_id = i_id;
         o_parent = o_parent_item;
-        i_item = [[[NSApp delegate] getInfo] getItem];
+        i_item = [[[VLCMain sharedInstance] getInfo] getItem];
     }
     return( self );
 }
@@ -408,7 +410,7 @@ static VLCInfoTreeItem *o_root_item = nil;
 {
     if (o_children == NULL)
     {
-        intf_thread_t * p_intf = [NSApp getIntf];
+        intf_thread_t * p_intf = VLCIntf;
         playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
         int i;
@@ -489,7 +491,7 @@ static VLCInfoTreeItem *o_root_item = nil;
 */
 - (void)refresh
 {
-    i_item = [[[NSApp delegate] getInfo] getItem];
+    i_item = [[[VLCMain sharedInstance] getInfo] getItem];
     if (o_children != NULL)
     {
         [o_children release];