From 49b0dd94f754657e588128d1f986c0b6001b8b5e Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 11 Aug 2012 19:05:45 +0100 Subject: [PATCH] Fix gravatars and build on Windows --- SparkleShare/Program.cs | 7 +++--- SparkleShare/SparkleControllerBase.cs | 7 +++--- SparkleShare/SparkleEventLogController.cs | 6 ++--- SparkleShare/Windows/SparkleEventLog.cs | 3 +-- SparkleShare/Windows/SparkleShare.csproj | 22 ++++++------------- SparkleShare/Windows/SparkleShare.sln | 9 -------- SparkleShare/Windows/SparkleShare.wxs | 1 - .../SparkleShareInviteOpener.csproj | 11 +--------- 8 files changed, 20 insertions(+), 46 deletions(-) diff --git a/SparkleShare/Program.cs b/SparkleShare/Program.cs index 6e69bd43..1a7e7722 100644 --- a/SparkleShare/Program.cs +++ b/SparkleShare/Program.cs @@ -37,7 +37,8 @@ namespace SparkleShare { public static void Main (string [] args) { if (args.Length != 0 && !args [0].Equals ("start") && - SparkleBackend.Platform != PlatformID.MacOSX) { + SparkleBackend.Platform != PlatformID.MacOSX && + SparkleBackend.Platform != PlatformID.Win32NT) { string n = Environment.NewLine; @@ -53,10 +54,10 @@ namespace SparkleShare { "under certain conditions. Please read the GNU GPLv3 for details." + n + n + "Usage: sparkleshare [start|stop|restart]"); - + Console.WriteLine ("SparkleShare is already running."); Environment.Exit (-1); } - + // Only allow one instance of SparkleShare (on Windows) if (!program_mutex.WaitOne (0, false)) { Console.WriteLine ("SparkleShare is already running."); diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index c3df731c..3b4fb97f 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -666,7 +666,7 @@ namespace SparkleShare { string avatars_path = new string [] { Path.GetDirectoryName (this.config.FullPath), "avatars", size + "x" + size }.Combine (); - string avatar_file_path = Path.Combine (avatars_path, email.MD5 () + ".jpg"); + string avatar_file_path = Path.Combine (avatars_path, email.MD5 () + ".png"); if (File.Exists (avatar_file_path)) { if (new FileInfo (avatar_file_path).CreationTime < DateTime.Now.AddDays (-1)) @@ -676,7 +676,7 @@ namespace SparkleShare { } WebClient client = new WebClient (); - string url = "https://gravatar.com/avatar/" + email.MD5 () + ".jpg?s=" + size + "&d=404"; + string url = "https://gravatar.com/avatar/" + email.MD5 () + ".png?s=" + size + "&d=404"; try { byte [] buffer = client.DownloadData (url); @@ -696,7 +696,8 @@ namespace SparkleShare { return null; } - } catch (WebException) { + } catch (WebException e) { + SparkleLogger.LogInfo ("Controller", "Error fetching avatar: " + e.Message); return null; } } diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index b772567e..bf629361 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -295,11 +295,11 @@ namespace SparkleShare { string change_set_avatar = Program.Controller.GetAvatar (change_set.User.Email, 48); if (change_set_avatar != null) { - change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); - + change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); + } else { change_set_avatar = "file:///" + - Program.Controller.AssignAvatar (change_set.User.Email); + Program.Controller.AssignAvatar (change_set.User.Email); } event_entry += ""; diff --git a/SparkleShare/Windows/SparkleEventLog.cs b/SparkleShare/Windows/SparkleEventLog.cs index 26186f42..67a0d69c 100644 --- a/SparkleShare/Windows/SparkleEventLog.cs +++ b/SparkleShare/Windows/SparkleEventLog.cs @@ -279,8 +279,7 @@ namespace SparkleShare { html = html.Replace ("", pixmaps_path + "/document-moved-12.png"); - - + Dispatcher.BeginInvoke ((Action) delegate { this.spinner.Stop (); diff --git a/SparkleShare/Windows/SparkleShare.csproj b/SparkleShare/Windows/SparkleShare.csproj index 362b7d5e..ecb3561e 100644 --- a/SparkleShare/Windows/SparkleShare.csproj +++ b/SparkleShare/Windows/SparkleShare.csproj @@ -1,7 +1,7 @@  - Debug + Release AnyCPU 9.0.30729 {728483AA-E34B-4441-BF2C-C8BC2901E4E0} @@ -32,17 +32,6 @@ Pixmaps\sparkleshare-app.ico - - true - full - false - ..\..\bin - DEBUG - prompt - 4 - x86 - AllRules.ruleset - none false @@ -64,9 +53,6 @@ - - ..\..\bin\Gettext.Cs.dll - @@ -242,6 +228,12 @@ Plugins\bitbucket.png Always + + Plugins\ssnet.png + + + Plugins\ssnet.xml + diff --git a/SparkleShare/Windows/SparkleShare.sln b/SparkleShare/Windows/SparkleShare.sln index 1532ac72..59379301 100644 --- a/SparkleShare/Windows/SparkleShare.sln +++ b/SparkleShare/Windows/SparkleShare.sln @@ -15,24 +15,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleLib.Git", "..\..\Spa EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}.Release|Any CPU.Build.0 = Release|Any CPU - {1DB5492D-B897-4A5E-8DD7-175EC65F52F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1DB5492D-B897-4A5E-8DD7-175EC65F52F2}.Debug|Any CPU.Build.0 = Debug|Any CPU {1DB5492D-B897-4A5E-8DD7-175EC65F52F2}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DB5492D-B897-4A5E-8DD7-175EC65F52F2}.Release|Any CPU.Build.0 = Release|Any CPU - {2C914413-B31C-4362-93C7-1AE34F09112A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2C914413-B31C-4362-93C7-1AE34F09112A}.Debug|Any CPU.Build.0 = Debug|Any CPU {2C914413-B31C-4362-93C7-1AE34F09112A}.Release|Any CPU.ActiveCfg = Release|Any CPU {2C914413-B31C-4362-93C7-1AE34F09112A}.Release|Any CPU.Build.0 = Release|Any CPU - {728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection diff --git a/SparkleShare/Windows/SparkleShare.wxs b/SparkleShare/Windows/SparkleShare.wxs index 2048b4e0..4172945a 100644 --- a/SparkleShare/Windows/SparkleShare.wxs +++ b/SparkleShare/Windows/SparkleShare.wxs @@ -21,7 +21,6 @@ - diff --git a/SparkleShare/Windows/SparkleShareInviteOpener/SparkleShareInviteOpener.csproj b/SparkleShare/Windows/SparkleShareInviteOpener/SparkleShareInviteOpener.csproj index 8e78e1d5..4732f425 100644 --- a/SparkleShare/Windows/SparkleShareInviteOpener/SparkleShareInviteOpener.csproj +++ b/SparkleShare/Windows/SparkleShareInviteOpener/SparkleShareInviteOpener.csproj @@ -1,7 +1,7 @@  - Debug + Release AnyCPU 9.0.30729 2.0 @@ -14,15 +14,6 @@ ..\Pixmaps\sparkleshare-app.ico - - true - full - false - ..\..\..\bin\ - DEBUG;TRACE - prompt - 4 - pdbonly true