[banshee] [MiroGuide] Fix text capitalization; some refactoring



commit 4bda62597c80e34057c71afa9eb3b34621426390
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu Aug 26 13:17:41 2010 -0500

    [MiroGuide] Fix text capitalization; some refactoring

 .../Banshee.MiroGuide/Banshee.MiroGuide/View.cs    |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/src/Extensions/Banshee.MiroGuide/Banshee.MiroGuide/View.cs b/src/Extensions/Banshee.MiroGuide/Banshee.MiroGuide/View.cs
index 6301c01..82186a1 100644
--- a/src/Extensions/Banshee.MiroGuide/Banshee.MiroGuide/View.cs
+++ b/src/Extensions/Banshee.MiroGuide/Banshee.MiroGuide/View.cs
@@ -53,8 +53,8 @@ namespace Banshee.MiroGuide
         public void UpdateSearchText ()
         {
             Shell.SearchEntry.EmptyMessage = LastPageWasAudio
-                ? Catalog.GetString ("Search for Podcasts")
-                : Catalog.GetString ("Search for Video Podcasts");
+                ? Catalog.GetString ("Search for podcasts")
+                : Catalog.GetString ("Search for video podcasts");
         }
 
         protected override void OnLoadStatusChanged (OssiferLoadStatus status)
@@ -120,22 +120,20 @@ namespace Banshee.MiroGuide
 
         public override void GoHome ()
         {
-            var uri = LastPageWasAudio
-                ? "http://integrated-services.banshee.fm/miro/audio/home/";
-                : "http://integrated-services.banshee.fm/miro/video/home/";;
-
-            LoadUri (uri);
+            LoadUri (GetActionUrl (LastPageWasAudio, "home/"));
         }
 
         public override void GoSearch (string query)
         {
-            var uri = LastPageWasAudio
-                ? "http://integrated-services.banshee.fm/miro/audio/search/";
-                : "http://integrated-services.banshee.fm/miro/video/search/";;
-
+            var uri = GetActionUrl (LastPageWasAudio, "search/");
             LoadUri (new Uri (uri + query).AbsoluteUri);
         }
 
+        private string GetActionUrl (bool audio, string action)
+        {
+            return "http://integrated-services.banshee.fm/miro/"; + (audio ? "audio/" : "video/") + action;
+        }
+
         // The download and add-to-sidebar buttons take the user to a page that then redirects to the
         // actual media URL or .miro OPML file.  But the URL to that redirection page contains all the
         // info we need to start downloading or subscribe immediately.



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