banshee r3271 - in trunk/banshee: . src/Core/Banshee.Services src/Core/Banshee.ThickClient src/Dap/Banshee.Dap.MassStorage src/Extensions src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio src/Libraries/Hyena src/Libraries/Hyena.Gui src/Libraries/Hyena.Gui/Hyena.Widgets src/Libraries/Lastfm/Lastfm
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3271 - in trunk/banshee: . src/Core/Banshee.Services src/Core/Banshee.ThickClient src/Dap/Banshee.Dap.MassStorage src/Extensions src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio src/Libraries/Hyena src/Libraries/Hyena.Gui src/Libraries/Hyena.Gui/Hyena.Widgets src/Libraries/Lastfm/Lastfm
- Date: Tue, 19 Feb 2008 03:20:29 +0000 (GMT)
Author: abock
Date: Tue Feb 19 03:20:28 2008
New Revision: 3271
URL: http://svn.gnome.org/viewvc/banshee?rev=3271&view=rev
Log:
2008-02-18 Aaron Bockover <abock gnome org>
* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs:
Removed duplicate using declaration
* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs:
Added a property to get the LastfmActions
* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs:
When the lastfm error is account related, add a message action to allow
the user to enter their account details
* src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs: Fix a few bugs
* src/Libraries/Lastfm/Lastfm/RadioConnection.cs: Lots of tabs->spaces
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp
trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmActions.cs
trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs
trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs
trunk/banshee/src/Extensions/Extensions.mds
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp
trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs
trunk/banshee/src/Libraries/Hyena/Hyena.mdp
trunk/banshee/src/Libraries/Lastfm/Lastfm/RadioConnection.cs
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp Tue Feb 19 03:20:28 2008
@@ -135,7 +135,6 @@
<ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="TagLib, Version=0.0.0.0, Culture=neutral" />
</References>
- <Deployment.LinuxDeployData generateScript="False" />
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
<DeployFilesVar />
@@ -145,4 +144,5 @@
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
+ <Deployment.LinuxDeployData generateScript="False" />
</Project>
\ No newline at end of file
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp Tue Feb 19 03:20:28 2008
@@ -105,7 +105,6 @@
<ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</References>
- <Deployment.LinuxDeployData generateScript="False" />
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
<DeployFilesVar />
@@ -115,4 +114,5 @@
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
+ <Deployment.LinuxDeployData generateScript="False" />
</Project>
\ No newline at end of file
Modified: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp (original)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp Tue Feb 19 03:20:28 2008
@@ -16,7 +16,6 @@
<ProjectReference type="Project" localcopy="True" refto="Banshee.Services" />
<ProjectReference type="Project" localcopy="True" refto="Hyena" />
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <ProjectReference type="Project" localcopy="True" refto="Banshee.DapCore" />
</References>
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="./Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
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 Tue Feb 19 03:20:28 2008
@@ -44,7 +44,6 @@
using Banshee.Configuration;
using Banshee.ServiceStack;
using Banshee.Gui;
-using Banshee.MediaEngine;
using Banshee.Collection;
namespace Banshee.Lastfm.Radio
Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs Tue Feb 19 03:20:28 2008
@@ -61,6 +61,9 @@
}
private LastfmActions actions;
+ public LastfmActions Actions {
+ get { return actions; }
+ }
public LastfmSource () : base (lastfm, lastfm, 150)
{
Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationSource.cs Tue Feb 19 03:20:28 2008
@@ -237,6 +237,11 @@
private void SetStatus (string message, bool error)
{
+ SetStatus (message, error, ConnectionState.Connected);
+ }
+
+ private void SetStatus (string message, bool error, ConnectionState state)
+ {
ThreadAssist.ProxyToMain (delegate {
string status_name = String.Format ("<i>{0}</i>", GLib.Markup.EscapeText (Name));
Properties.SetString ("Message.Text", String.Format ("{0}",
@@ -245,9 +250,19 @@
if (error) {
Properties.SetString ("Message.Icon.Name", "dialog-error");
Properties.SetBoolean ("Message.IsSpinning", false);
+
+ if (state == ConnectionState.NoAccount || state == ConnectionState.InvalidAccount) {
+ Properties.SetString ("Message.Action.Label", Catalog.GetString ("Account Settings"));
+ Properties.Set<EventHandler> ("Message.Action.NotifyHandler", delegate {
+ lastfm.Actions.ShowLoginDialog ();
+ });
+ } else {
+ Properties.RemoveStartingWith ("Message.Action.");
+ }
} else {
Properties.RemoveStartingWith ("Message.Icon.");
Properties.SetBoolean ("Message.IsSpinning", true);
+ Properties.RemoveStartingWith ("Message.Action.");
}
Properties.SetBoolean ("Message.CanClose", true);
@@ -397,7 +412,7 @@
}
} else {
track_model.Clear ();
- SetStatus (RadioConnection.MessageFor (state), state != ConnectionState.Connecting);
+ SetStatus (RadioConnection.MessageFor (state), state != ConnectionState.Connecting, state);
OnUpdated ();
}
}
Modified: trunk/banshee/src/Extensions/Extensions.mds
==============================================================================
--- trunk/banshee/src/Extensions/Extensions.mds (original)
+++ trunk/banshee/src/Extensions/Extensions.mds Tue Feb 19 03:20:28 2008
@@ -5,14 +5,11 @@
<Entry build="True" name="Banshee.MultimediaKeys" configuration="Debug" />
<Entry build="True" name="Banshee.PlayQueue" configuration="Debug" />
<Entry build="False" name="Banshee.Lastfm" configuration="Debug" />
- <Entry build="True" name="Banshee.DapCore" configuration="Debug" />
- <Entry build="True" name="Banshee.Dap.MassStorage" configuration="Debug" />
</Configuration>
</Configurations>
<StartMode startupentry="Banshee.NotificationArea" single="True">
<Execute type="None" entry="Banshee.NotificationArea" />
<Execute type="None" entry="Banshee.DapCore" />
- <Execute type="None" entry="Banshee.DapCore" />
<Execute type="None" entry="Banshee.Dap.MassStorage" />
</StartMode>
<Entries>
@@ -20,7 +17,5 @@
<Entry filename="Banshee.MultimediaKeys/Banshee.MultimediaKeys.mdp" />
<Entry filename="Banshee.PlayQueue/Banshee.PlayQueue.mdp" />
<Entry filename="Banshee.Lastfm/Banshee.Lastfm.mdp" />
- <Entry filename="../Dap/Banshee.DapCore/Banshee.DapCore.mdp" />
- <Entry filename="../Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage.mdp" />
</Entries>
</Combine>
\ No newline at end of file
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp Tue Feb 19 03:20:28 2008
@@ -59,7 +59,6 @@
<ProjectReference type="Project" localcopy="False" refto="Hyena" />
<ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</References>
- <Deployment.LinuxDeployData generateScript="False" />
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
<DeployFilesVar />
@@ -69,4 +68,5 @@
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
+ <Deployment.LinuxDeployData generateScript="False" />
</Project>
\ No newline at end of file
Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs (original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs Tue Feb 19 03:20:28 2008
@@ -68,6 +68,7 @@
image.FrameWidth = 22;
Spinning = false;
image.Load ();
+ image.Show ();
label = new Label ();
label.Xalign = 0.0f;
@@ -139,22 +140,25 @@
public string ButtonLabel {
set {
- bool should_remove = false;
+ bool button_is_child = false;
foreach (Widget child in box.Children) {
if (child == button) {
- should_remove = true;
+ button_is_child = true;
break;
}
}
- if (should_remove && value == null) {
+ if (button_is_child && value == null) {
box.Remove (button);
}
if (value != null) {
button.Label = value;
button.Show ();
- box.PackStart (button, false, false, 0);
+
+ if (!button_is_child) {
+ box.PackStart (button, false, false, 0);
+ }
}
QueueDraw ();
@@ -185,7 +189,6 @@
public Gdk.Pixbuf Pixbuf {
set {
image.InactivePixbuf = value;
- image.Visible = value != null || Spinning;
QueueDraw ();
}
}
Modified: trunk/banshee/src/Libraries/Hyena/Hyena.mdp
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.mdp (original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.mdp Tue Feb 19 03:20:28 2008
@@ -86,7 +86,6 @@
<ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Data.Sqlite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
</References>
- <Deployment.LinuxDeployData generateScript="False" />
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="True" Name="SOURCES" />
<DeployFilesVar />
@@ -96,4 +95,5 @@
<AsmRefVar />
<ProjectRefVar />
</MonoDevelop.Autotools.MakefileInfo>
+ <Deployment.LinuxDeployData generateScript="False" />
</Project>
\ No newline at end of file
Modified: trunk/banshee/src/Libraries/Lastfm/Lastfm/RadioConnection.cs
==============================================================================
--- trunk/banshee/src/Libraries/Lastfm/Lastfm/RadioConnection.cs (original)
+++ trunk/banshee/src/Libraries/Lastfm/Lastfm/RadioConnection.cs Tue Feb 19 03:20:28 2008
@@ -77,17 +77,17 @@
Unknown // not an official code, just the fall back
}
- public class RadioConnection
- {
- public delegate void StateChangedHandler (RadioConnection connection, ConnectionStateChangedArgs args);
- public event StateChangedHandler StateChanged;
+ public class RadioConnection
+ {
+ public delegate void StateChangedHandler (RadioConnection connection, ConnectionStateChangedArgs args);
+ public event StateChangedHandler StateChanged;
- private ConnectionState state;
+ private ConnectionState state;
private string user_agent;
- private string session;
- private string base_url;
- private string base_path;
- private string info_message;
+ private string session;
+ private string base_url;
+ private string base_path;
+ private string info_message;
private bool network_connected = false;
private static Regex station_error_regex = new Regex ("error=(\\d+)", RegexOptions.Compiled);
@@ -97,17 +97,17 @@
get { return account; }
}
- private bool subscriber;
- public bool Subscriber {
- get { return subscriber; }
- }
+ private bool subscriber;
+ public bool Subscriber {
+ get { return subscriber; }
+ }
public string InfoMessage {
get { return info_message; }
}
- public ConnectionState State {
- get { return state; }
+ public ConnectionState State {
+ get { return state; }
private set {
if (value == state)
@@ -120,19 +120,19 @@
handler (this, new ConnectionStateChangedArgs (state));
}
}
- }
+ }
public bool Connected {
get { return state == ConnectionState.Connected; }
}
- private string station;
- public string Station {
- get { return station; }
- }
+ private string station;
+ public string Station {
+ get { return station; }
+ }
- public RadioConnection (Account account, string user_agent)
- {
+ public RadioConnection (Account account, string user_agent)
+ {
this.account = account;
this.user_agent = user_agent;
@@ -165,7 +165,7 @@
// Otherwise, we're good to try to connect
State = ConnectionState.Connecting;
Handshake ();
- }
+ }
public bool Love (string artist, string title) { return PostTrackRequest ("loveTrack", artist, title); }
public bool UnLove (string artist, string title) { return PostTrackRequest ("unLoveTrack", artist, title); }
@@ -202,8 +202,8 @@
}
}
- public Playlist LoadPlaylistFor (string station)
- {
+ public Playlist LoadPlaylistFor (string station)
+ {
lock (this) {
if (station != Station)
return null;
@@ -235,7 +235,7 @@
return pl;
}
- }
+ }
// Private methods
@@ -295,57 +295,57 @@
});
}
- private bool ParseHandshake (string content)
- {
+ private bool ParseHandshake (string content)
+ {
Log.Debug ("Got Last.fm Handshake Response", content);
- string [] lines = content.Split (new Char[] {'\n'});
- foreach (string line in lines) {
- string [] opts = line.Split (new Char[] {'='});
-
- switch (opts[0].Trim ().ToLower ()) {
- case "session":
- if (opts[1].ToLower () == "failed") {
- session = null;
- State = ConnectionState.InvalidAccount;
+ string [] lines = content.Split (new Char[] {'\n'});
+ foreach (string line in lines) {
+ string [] opts = line.Split (new Char[] {'='});
+
+ switch (opts[0].Trim ().ToLower ()) {
+ case "session":
+ if (opts[1].ToLower () == "failed") {
+ session = null;
+ State = ConnectionState.InvalidAccount;
Log.Warning (
Catalog.GetString ("Failed to Login to Last.fm"),
Catalog.GetString ("Either your username or password is invalid."),
false
);
account.CryptedPassword = null;
- return false;
- }
+ return false;
+ }
- session = opts[1];
- break;
+ session = opts[1];
+ break;
- case "stream_url":
- //stream_url = opts[1];
- break;
-
- case "subscriber":
- subscriber = (opts[1] != "0");
- break;
-
- case "base_url":
- base_url = opts[1];
- break;
-
- case "base_path":
- base_path = opts[1];
- break;
-
- case "info_message":
- info_message = opts[1];
- break;
-
- default:
- break;
- }
- }
+ case "stream_url":
+ //stream_url = opts[1];
+ break;
+
+ case "subscriber":
+ subscriber = (opts[1] != "0");
+ break;
+
+ case "base_url":
+ base_url = opts[1];
+ break;
+
+ case "base_path":
+ base_path = opts[1];
+ break;
+
+ case "info_message":
+ info_message = opts[1];
+ break;
- return true;
- }
+ default:
+ break;
+ }
+ }
+
+ return true;
+ }
// Basic HTTP helpers
@@ -413,13 +413,13 @@
get { return String.Format ("http://{0}/1.0/rw/xmlrpc.php", base_url); }
}
- private string StationUrlFor (string station)
- {
+ private string StationUrlFor (string station)
+ {
return String.Format (
"http://{0}{1}/adjust.php?session={2}&url={3}&lang=en",
base_url, base_path, session, HttpUtility.UrlEncode (station)
);
- }
+ }
private string StationRefreshUrl {
get {
@@ -451,7 +451,7 @@
{
switch (state) {
case ConnectionState.Disconnected: return Catalog.GetString ("Not connected to Last.fm.");
- case ConnectionState.NoAccount: return Catalog.GetString ("Need account details before can connect to Last.fm");
+ case ConnectionState.NoAccount: return Catalog.GetString ("Account details are needed before you can connect to Last.fm");
case ConnectionState.NoNetwork: return Catalog.GetString ("No network connection detected.");
case ConnectionState.InvalidAccount: return Catalog.GetString ("Last.fm username or password is invalid.");
case ConnectionState.Connecting: return Catalog.GetString ("Connecting to Last.fm.");
@@ -532,11 +532,11 @@
}
}
- public sealed class StringUtils {
- public static string StringToUTF8 (string s)
- {
- byte [] ba = (new UnicodeEncoding ()).GetBytes (s);
- return System.Text.Encoding.UTF8.GetString (ba);
- }
+ public sealed class StringUtils {
+ public static string StringToUTF8 (string s)
+ {
+ byte [] ba = (new UnicodeEncoding ()).GetBytes (s);
+ return System.Text.Encoding.UTF8.GetString (ba);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]