private void OnImportPlaylist (object o, EventArgs args)
{
// Prompt user for location of the playlist.
var chooser = Banshee.Gui.Dialogs.FileChooserDialog.CreateForImport (Catalog.GetString("Import Playlist"), true);
chooser.AddFilter (Hyena.Gui.GtkUtilities.GetFileFilter (Catalog.GetString ("Playlists"), PlaylistFileUtil.PlaylistExtensions));
int response = chooser.Run();
string [] uris = null;
if (response == (int) ResponseType.Ok) {
uris = chooser.Uris;
chooser.Destroy();
} else {
chooser.Destroy();
return;
}
if (uris == null || uris.Length == 0) {
return;
}
Banshee.Kernel.Scheduler.Schedule (new Banshee.Kernel.DelegateJob (delegate {
foreach (string uri in uris) {
PlaylistFileUtil.ImportPlaylistToLibrary (uri);
}
}));
}