[banshee/podcast-ng] [podcast-ng] Brought in subscription dialog fix from commit f4d67028f6faacdfc4277f1425cac5fe8d43c2f9



commit 6bced07345aff756cc5d018f83c4bd5913364e14
Author: Mike Urbanski <michael c urbanski gmail com>
Date:   Mon Mar 29 21:04:31 2010 -0500

    [podcast-ng] Brought in subscription dialog fix from commit
    f4d67028f6faacdfc4277f1425cac5fe8d43c2f9.

 .../Banshee.Paas/Banshee.Paas.Gui/PaasActions.cs   |   50 +++++++++++---------
 1 files changed, 27 insertions(+), 23 deletions(-)
---
diff --git a/src/Extensions/Banshee.Paas/Banshee.Paas/Banshee.Paas.Gui/PaasActions.cs b/src/Extensions/Banshee.Paas/Banshee.Paas/Banshee.Paas.Gui/PaasActions.cs
index ef1a522..7248407 100644
--- a/src/Extensions/Banshee.Paas/Banshee.Paas/Banshee.Paas.Gui/PaasActions.cs
+++ b/src/Extensions/Banshee.Paas/Banshee.Paas/Banshee.Paas.Gui/PaasActions.cs
@@ -360,32 +360,36 @@ namespace Banshee.Paas.Gui
 
         private void RunSubscribeDialog ()
         {
-            SubscribeDialog dialog = new SubscribeDialog ();
-            ResponseType response = (ResponseType) dialog.Run ();
-            dialog.Destroy ();
+            string url = null;
+            Uri feedUri = null;
+            FeedAutoDownload syncPreference;
+
+            PodcastSubscribeDialog subscribeDialog = new PodcastSubscribeDialog ();
+            ResponseType response = (ResponseType) subscribeDialog.Run ();
+
+            syncPreference = subscribeDialog.SyncPreference;
 
             if (response == ResponseType.Ok) {
-                if (String.IsNullOrEmpty (dialog.Url)) {
-                    return;
-                }
+                url = subscribeDialog.Url.Trim ().Trim ('/');
+            }
 
-                string url = dialog.Url.Trim ().Trim ('/');
-                DownloadPreference download_pref = dialog.DownloadPreference;;
-
-                try {
-                    service.SyndicationClient.SubscribeToChannel (url, download_pref);
-                } catch (Exception e) {
-                    Hyena.Log.Exception (e);
-
-                    HigMessageDialog.RunHigMessageDialog (
-                        null,
-                        DialogFlags.Modal,
-                        MessageType.Warning,
-                        ButtonsType.Ok,
-                        Catalog.GetString ("Invalid URL"),
-                        Catalog.GetString ("Podcast URL is invalid.")
-                    );
-                }
+            subscribeDialog.Destroy ();
+
+            if (String.IsNullOrEmpty (url)) {
+                return;
+            }
+
+            if (!TryParseUrl (url, out feedUri)) {
+                HigMessageDialog.RunHigMessageDialog (
+                    null,
+                    DialogFlags.Modal,
+                    MessageType.Warning,
+                    ButtonsType.Ok,
+                    Catalog.GetString ("Invalid URL"),
+                    Catalog.GetString ("Podcast URL is invalid.")
+                );
+            } else {
+                SubscribeToPodcast (feedUri, syncPreference);
             }
         }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]