banshee r3751 - in trunk/banshee: . src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio src/Libraries/Lastfm.Gui/Lastfm.Gui



Author: gburt
Date: Thu Apr 10 18:05:11 2008
New Revision: 3751
URL: http://svn.gnome.org/viewvc/banshee?rev=3751&view=rev

Log:
2008-04-10  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs:
	Fix capitalization of menu items, use 'Last.fm' instead of 'Audioscrobbler'.

	* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs:
	Encode url bits.

	* src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginDialog.cs: Replace Close
	button with Cancel / Save and Log In buttons.  Should fix BGO #525585.

	* src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginForm.cs: Make Save
	method public.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs
   trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginDialog.cs
   trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginForm.cs

Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs	Thu Apr 10 18:05:11 2008
@@ -116,21 +116,21 @@
             
             actions.Add (new ActionEntry [] {
                 new ActionEntry ("AudioscrobblerAction", null,
-                    Catalog.GetString ("_Audioscrobbler"), null,
+                    Catalog.GetString ("_Last.fm"), null,
                     Catalog.GetString ("Configure the Audioscrobbler plugin"), null),
                     
                 new ActionEntry ("AudioscrobblerVisitAction", null,
-                    Catalog.GetString ("Visit _user profile page"), null,
-                    Catalog.GetString ("Visit your Audioscrobbler profile page"), OnVisitOwnProfile),
+                    Catalog.GetString ("Visit _User Profile Page"), null,
+                    Catalog.GetString ("Visit Your Last.fm Profile Page"), OnVisitOwnProfile),
                 
                 new ActionEntry ("AudioscrobblerConfigureAction", Stock.Properties,
                     Catalog.GetString ("_Configure..."), null,
-                    Catalog.GetString ("Configure the Audioscrobbler plugin"), OnConfigurePlugin)
+                    Catalog.GetString ("Configure the Last.fm Extension"), OnConfigurePlugin)
             });
             
             actions.Add (new ToggleActionEntry [] { 
                 new ToggleActionEntry ("AudioscrobblerEnableAction", null,
-                    Catalog.GetString ("_Enable song reporting"), "<control>U",
+                    Catalog.GetString ("_Enable Song Reporting"), "<control>U",
                     Catalog.GetString ("Enable song reporting"), OnToggleEnabled, Enabled)
             });
             

Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs	Thu Apr 10 18:05:11 2008
@@ -86,6 +86,9 @@
                 )
             });
 
+            string listen_to = Catalog.GetString ("Listen to {0} Station");
+            string listen_to_long = Catalog.GetString ("Listen to the Last.fm {0} station for this artist");
+
             // Artist actions
             Add (new ActionEntry [] {
                 new ActionEntry ("LastfmArtistVisitLastfmAction", "audioscrobbler",
@@ -105,12 +108,14 @@
                     Catalog.GetString ("Find videos by this artist"), OnArtistViewVideos),
 
                 new ActionEntry ("LastfmArtistPlayFanRadioAction", StationType.Fan.IconName,
-                    Catalog.GetString ("Listen to 'fans of' Station"), null,
-                    Catalog.GetString ("Listen to the Last.fm 'fans of' station for this artist"), OnArtistPlayFanRadio),
+                    String.Format (listen_to, String.Format ("'{0}'", Catalog.GetString ("Fans of"))), null,
+                    String.Format (listen_to_long, String.Format ("'{0}'", Catalog.GetString ("Fans of"))),
+                    OnArtistPlayFanRadio),
 
                 new ActionEntry ("LastfmArtistPlaySimilarRadioAction", StationType.Similar.IconName,
-                    Catalog.GetString ("Listen to 'similar to' Station"), null,
-                    Catalog.GetString ("Listen to the Last.fm 'similar to' station for this artist"), OnArtistPlaySimilarRadio),
+                    String.Format (listen_to, String.Format ("'{0}'", Catalog.GetString ("Similar to"))), null,
+                    String.Format (listen_to_long, String.Format ("'{0}'", Catalog.GetString ("Similar to"))), 
+                    OnArtistPlaySimilarRadio),
 
                 new ActionEntry ("LastfmArtistRecommendAction", "",
                     Catalog.GetString ("Recommend to"), null,
@@ -255,7 +260,7 @@
         {
             Browser.Open (String.Format (
                 Catalog.GetString ("http://last.fm/music/{0}";),
-                CurrentArtist
+                Encode (CurrentArtist)
             ));
         }
 
@@ -263,7 +268,7 @@
         {
             Browser.Open (String.Format (
                 Catalog.GetString ("http://last.fm/music/{0}/{1}";),
-                CurrentArtist, CurrentAlbum
+                Encode (CurrentArtist), Encode (CurrentAlbum)
             ));
         }
 
@@ -271,7 +276,7 @@
         {
             Browser.Open (String.Format (
                 Catalog.GetString ("http://last.fm/music/{0}/{1}";),
-                CurrentArtist, CurrentTrack
+                Encode (CurrentArtist), Encode (CurrentTrack)
             ));
         }
 
@@ -279,7 +284,7 @@
         {
             Browser.Open (String.Format (
                 Catalog.GetString ("http://www.last.fm/music/{0}/+videos";),
-                CurrentArtist
+                Encode (CurrentArtist)
             ));
         }
 
@@ -287,10 +292,15 @@
         {
             Browser.Open (String.Format (
                 Catalog.GetString ("http://en.wikipedia.org/wiki/{0}";),
-                CurrentArtist
+                Encode (CurrentArtist)
             ));
         }
 
+        private static string Encode (string i)
+        {
+            return System.Web.HttpUtility.UrlEncode (i);
+        }
+
         /*private void OnArtistVisitAmazon (object sender, EventArgs args)
         {
             Browser.Open (String.Format (
@@ -380,7 +390,7 @@
         public void ShowLoginDialog ()
         {
             AccountLoginDialog dialog = new AccountLoginDialog (lastfm.Account, true);
-            dialog.SaveOnEdit = true;
+            dialog.SaveOnEdit = false;
             if (lastfm.Account.UserName == null) {
                 dialog.AddSignUpButton ();
             }

Modified: trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginDialog.cs
==============================================================================
--- trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginDialog.cs	(original)
+++ trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginDialog.cs	Thu Apr 10 18:05:11 2008
@@ -46,7 +46,7 @@
     
         public AccountLoginDialog (Account account, bool addCloseButton) : base ()
         {
-            Title = Catalog.GetString ("Last.fm Account Login");
+            Title = Catalog.GetString ("Log in to Last.fm");
             HasSeparator = false;
             BorderWidth = 5;
             
@@ -100,7 +100,15 @@
             VBox.PackEnd (bottom_box, false, false, 0);
             
             if (addCloseButton) {
-                AddButton (Stock.Close, ResponseType.Close);
+                AddButton (Stock.Cancel, ResponseType.Cancel);
+                Button button = new Button ();
+                button.Label = Catalog.GetString ("Save and Log In");
+                button.Image = new Image ("gtk-save", IconSize.Button);
+                button.ShowAll ();
+                button.Activated += delegate {
+                    login_form.Save ();
+                };
+                AddActionWidget (button, ResponseType.Ok);
             }
         }
         

Modified: trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginForm.cs
==============================================================================
--- trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginForm.cs	(original)
+++ trunk/banshee/src/Libraries/Lastfm.Gui/Lastfm.Gui/AccountLoginForm.cs	Thu Apr 10 18:05:11 2008
@@ -51,7 +51,7 @@
             RowSpacing = 5;
             ColumnSpacing = 5;
         
-            Label username_label = new Label (Catalog.GetString ("User Name:"));
+            Label username_label = new Label (Catalog.GetString ("Username:"));
             username_label.Xalign = 1.0f;
             username_label.Show ();
             
@@ -78,14 +78,14 @@
             Attach (password_entry, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, 
                 AttachOptions.Shrink, 0, 0);
                 
-            username_entry.Text = account.UserName;
-            password_entry.Text = account.Password;
+            username_entry.Text = account.UserName ?? String.Empty;
+            password_entry.Text = account.Password ?? String.Empty;
         }
         
         protected override void OnDestroyed ()
         {
             if (save_on_edit) {
-                UpdateLogin ();
+                Save ();
             }
             
             base.OnDestroyed ();
@@ -98,17 +98,15 @@
             }
             
             Resize (3, 2);
-            signup_button = new LinkButton ("Sign Up for Last.fm");
+            signup_button = new LinkButton (Catalog.GetString ("Sign up for Last.fm"));
             signup_button.Clicked += delegate { account.SignUp (); };
             signup_button.Show ();
             Attach (signup_button, 1, 2, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
         }
         
-        private void UpdateLogin ()
+        public void Save ()
         {
-            if (account.UserName != username_entry.Text.Trim () ||
-                account.Password != password_entry.Text.Trim ()) {
-                
+            if (account.UserName != username_entry.Text.Trim () || account.Password != password_entry.Text.Trim ()) {
                 account.UserName = username_entry.Text.Trim ();
                 account.Password = password_entry.Text.Trim ();
                 account.Save ();



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