switch (*p_category) {
case SD_CAT_INTERNET:
[internetItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
- if (!strncmp(*ppsz_name, "podcast", 7))
- [[internetItems lastObject] setIcon: imageFromRes(@"sidebar-podcast")];
- else
- [[internetItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
+ [[internetItems lastObject] setIcon: imageFromRes(@"sidebar-podcast")];
[[internetItems lastObject] setSdtype: SD_CAT_INTERNET];
[[internetItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
break;
case SD_CAT_DEVICES:
[devicesItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
- [[devicesItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
+ [[devicesItems lastObject] setIcon: imageFromRes(@"sidebar-local")];
[[devicesItems lastObject] setSdtype: SD_CAT_DEVICES];
[[devicesItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
break;
dropzoneboxRect.origin.x = (plrect.size.width - dropzoneboxRect.size.width) / 2;
dropzoneboxRect.origin.y = (plrect.size.height - dropzoneboxRect.size.height) / 2;
- [o_playlist_table setFrame: plrect];
[o_dropzone_view setFrame: plrect];
[o_dropzone_box setFrame: dropzoneboxRect];
+
+ if (b_podcastView_displayed) {
+ plrect.size.height -= [o_podcast_view frame].size.height;
+ plrect.origin.y = [o_podcast_view frame].size.height;
+ }
+ [o_playlist_table setFrame: plrect];
+
[o_dropzone_view setNeedsDisplay: YES];
[o_playlist_table setNeedsDisplay: YES];
}
- (IBAction)removePodcast:(id)sender
{
- if (config_GetPsz(VLCIntf, "podcast-urls") != NULL) {
+ char *psz_urls = var_InheritString(pl_Get(VLCIntf), "podcast-urls");
+ if (psz_urls != NULL) {
[o_podcast_unsubscribe_pop removeAllItems];
- [o_podcast_unsubscribe_pop addItemsWithTitles:[[NSString stringWithUTF8String:config_GetPsz(VLCIntf, "podcast-urls")] componentsSeparatedByString:@"|"]];
+ [o_podcast_unsubscribe_pop addItemsWithTitles:[toNSStr(psz_urls) componentsSeparatedByString:@"|"]];
[NSApp beginSheet:o_podcast_unsubscribe_window modalForWindow:self modalDelegate:self didEndSelector:NULL contextInfo:nil];
}
+ free(psz_urls);
}
- (IBAction)removePodcastWindowAction:(id)sender
[NSApp endSheet: o_podcast_unsubscribe_window];
if (sender == o_podcast_unsubscribe_ok_btn) {
+ playlist_t * p_playlist = pl_Get(VLCIntf);
+ char *psz_urls = var_InheritString(p_playlist, "podcast-urls");
+
NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[[NSString stringWithUTF8String:config_GetPsz(VLCIntf, "podcast-urls")] componentsSeparatedByString:@"|"]];
[urls removeObjectAtIndex: [o_podcast_unsubscribe_pop indexOfSelectedItem]];
- config_PutPsz(VLCIntf, "podcast-urls", [[urls componentsJoinedByString:@"|"] UTF8String]);
- var_SetString(pl_Get(VLCIntf), "podcast-urls", config_GetPsz(VLCIntf, "podcast-urls"));
+ const char *psz_new_urls = [[urls componentsJoinedByString:@"|"] UTF8String];
+ var_SetString(pl_Get(VLCIntf), "podcast-urls", psz_new_urls);
+ config_PutPsz(VLCIntf, "podcast-urls", psz_new_urls);
[urls release];
- /* reload the podcast module, since it won't update its list when removing podcasts */
- playlist_t * p_playlist = pl_Get(VLCIntf);
+ free(psz_urls);
+
+ /* update playlist table */
if (playlist_IsServicesDiscoveryLoaded(p_playlist, "podcast{longname=\"Podcasts\"}")) {
- playlist_ServicesDiscoveryRemove(p_playlist, "podcast{longname=\"Podcasts\"}");
- playlist_ServicesDiscoveryAdd(p_playlist, "podcast{longname=\"Podcasts\"}");
[[[VLCMain sharedInstance] playlist] playlistUpdated];
}
}