diff --git a/SparkleLib/SparkleListenerFactory.cs b/SparkleLib/SparkleListenerFactory.cs
index c5e93776..a105feb2 100644
--- a/SparkleLib/SparkleListenerFactory.cs
+++ b/SparkleLib/SparkleListenerFactory.cs
@@ -32,25 +32,21 @@ namespace SparkleLib {
// Check if the user wants a use a custom notification service for this folder
if (string.IsNullOrEmpty (uri))
- uri = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute (
- folder_name, "announcements_url");
-
- // Fall back to the fallback service is neither is the case
- if (string.IsNullOrEmpty (uri)) {
- // This is SparkleShare's centralized notification service.
- // It communicates "It's time to sync!" signals between clients.
- //
- // Here's how it works: the client listens to a channel (the
- // folder identifier, a SHA-1 hash) for when it's time to sync.
- // Clients also send the current revision hash to the channel
- // for other clients to pick up when you've synced up any
- // changes.
- //
- // Please see the SparkleShare wiki if you wish to run
- // your own service instead
+ uri = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute (folder_name, "announcements_url");
+ // This is SparkleShare's centralized notification service.
+ // It communicates "It's time to sync!" signals between clients.
+ //
+ // Here's how it works: the client listens to a channel (the
+ // folder identifier, a SHA-1 hash) for when it's time to sync.
+ // Clients also send the current revision hash to the channel
+ // for other clients to pick up when you've synced up any
+ // changes.
+ //
+ // Please see the SparkleShare wiki if you wish to run
+ // your own service instead
+ if (string.IsNullOrEmpty (uri))
uri = "tcp://notifications.sparkleshare.org:80";
- }
Uri announce_uri = new Uri (uri);
@@ -58,8 +54,7 @@ namespace SparkleLib {
// the number of connections as low as possible
foreach (SparkleListenerBase listener in listeners) {
if (listener.Server.Equals (announce_uri)) {
- SparkleHelpers.DebugInfo ("ListenerFactory",
- "Refered to existing " + announce_uri.Scheme +
+ SparkleHelpers.DebugInfo ("ListenerFactory", "Refered to existing " + announce_uri.Scheme +
" listener for " + announce_uri);
// We already seem to have a listener for this server,
@@ -80,8 +75,8 @@ namespace SparkleLib {
break;
}
- SparkleHelpers.DebugInfo ("ListenerFactory",
- "Issued new " + announce_uri.Scheme + " listener for " + announce_uri);
+ SparkleHelpers.DebugInfo ("ListenerFactory", "Issued new " + announce_uri.Scheme +
+ " listener for " + announce_uri);
return (SparkleListenerBase) listeners [listeners.Count - 1];
}
diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs
index 546fdb53..881680cb 100755
--- a/SparkleShare/Mac/SparkleEventLog.cs
+++ b/SparkleShare/Mac/SparkleEventLog.cs
@@ -233,7 +233,10 @@ namespace SparkleShare {
if (this.web_view.Superview == ContentView)
this.web_view.RemoveFromSuperview ();
- ContentView.AddSubview (this.progress_indicator);
+ if (this.progress_indicator.Superview != ContentView)
+ ContentView.AddSubview (this.progress_indicator);
+
+ this.progress_indicator.StartAnimation (this);
});
}
};
diff --git a/SparkleShare/Mac/SparkleSetup.cs b/SparkleShare/Mac/SparkleSetup.cs
index 8b4da519..f4448f56 100755
--- a/SparkleShare/Mac/SparkleSetup.cs
+++ b/SparkleShare/Mac/SparkleSetup.cs
@@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Drawing;
using System.IO;
-using Mono.Unix;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
diff --git a/SparkleShare/Mac/SparkleSetupWindow.cs b/SparkleShare/Mac/SparkleSetupWindow.cs
index 60c0041b..d6f968bd 100755
--- a/SparkleShare/Mac/SparkleSetupWindow.cs
+++ b/SparkleShare/Mac/SparkleSetupWindow.cs
@@ -24,7 +24,6 @@ using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
using MonoMac.WebKit;
-using Mono.Unix;
namespace SparkleShare {
@@ -52,8 +51,7 @@ namespace SparkleShare {
Center ();
- string side_splash_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
- "Pixmaps", "side-splash.png");
+ string side_splash_path = Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "side-splash.png");
SideSplash = new NSImage (side_splash_path) {
Size = new SizeF (150, 482)
@@ -69,8 +67,8 @@ namespace SparkleShare {
BackgroundColor = NSColor.WindowBackground,
Bordered = false,
Editable = false,
- Font = NSFontManager.SharedFontManager.FontWithFamily
- ("Lucida Grande", NSFontTraitMask.Bold, 0, 15)
+ Font = NSFontManager.SharedFontManager.FontWithFamily (
+ "Lucida Grande", NSFontTraitMask.Bold, 0, 15)
};
DescriptionTextField = new NSTextField () {
@@ -78,8 +76,8 @@ namespace SparkleShare {
BackgroundColor = NSColor.WindowBackground,
Bordered = false,
Editable = false,
- Font = NSFontManager.SharedFontManager.FontWithFamily
- ("Lucida Grande", NSFontTraitMask.Condensed, 0, 13)
+ Font = NSFontManager.SharedFontManager.FontWithFamily (
+ "Lucida Grande", NSFontTraitMask.Condensed, 0, 13)
};
if (Program.UI != null)
diff --git a/SparkleShare/Mac/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare.csproj
index 1add0349..aada9751 100644
--- a/SparkleShare/Mac/SparkleShare.csproj
+++ b/SparkleShare/Mac/SparkleShare.csproj
@@ -42,7 +42,6 @@
-
..\..\bin\SparkleLib.dll
diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs
index 20d87615..76203219 100755
--- a/SparkleShare/Mac/SparkleStatusIcon.cs
+++ b/SparkleShare/Mac/SparkleStatusIcon.cs
@@ -19,7 +19,6 @@ using System;
using System.Drawing;
using System.IO;
-using Mono.Unix;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
@@ -59,13 +58,6 @@ namespace SparkleShare {
private EventHandler [] overflow_tasks;
- // Short alias for the translations
- public static string _ (string s)
- {
- return Catalog.GetString (s);
- }
-
-
public SparkleStatusIcon () : base ()
{
using (var a = new NSAutoreleasePool ())
diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs
index 3a0a410c..35a5f5de 100755
--- a/SparkleShare/Mac/SparkleUI.cs
+++ b/SparkleShare/Mac/SparkleUI.cs
@@ -19,7 +19,6 @@ using System;
using System.Drawing;
using System.IO;
-using Mono.Unix;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
@@ -46,8 +45,6 @@ namespace SparkleShare {
{
using (var a = new NSAutoreleasePool ())
{
- Catalog.Init ("sparkleshare", Path.Combine (NSBundle.MainBundle.ResourcePath, "Translations"));
-
GrowlApplicationBridge.WeakDelegate = this;
GrowlApplicationBridge.Delegate = new SparkleGrowlDelegate ();
diff --git a/SparkleShare/Program.cs b/SparkleShare/Program.cs
index c4f7c093..30878322 100644
--- a/SparkleShare/Program.cs
+++ b/SparkleShare/Program.cs
@@ -18,10 +18,6 @@
using System;
using System.Threading;
-#if __MonoCS__
-using Mono.Unix;
-#endif
-
namespace SparkleShare {
// This is SparkleShare!
diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs
index 240a2dd6..e8e46e61 100644
--- a/SparkleShare/SparkleControllerBase.cs
+++ b/SparkleShare/SparkleControllerBase.cs
@@ -177,7 +177,7 @@ namespace SparkleShare {
public virtual void Initialize ()
{
- SparklePlugin.PluginsPath = PluginsPath;
+ SparklePlugin.PluginsPath = PluginsPath;
InstallProtocolHandler ();
// Create the SparkleShare folder and add it to the bookmarks
diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs
index 6c663492..ff9ad0a4 100755
--- a/SparkleShare/SparkleEventLogController.cs
+++ b/SparkleShare/SparkleEventLogController.cs
@@ -45,6 +45,8 @@ namespace SparkleShare {
private string selected_folder;
+ public bool WindowIsOpen { get; private set; }
+
public string SelectedFolder {
get {
return this.selected_folder;
@@ -144,6 +146,9 @@ namespace SparkleShare {
public SparkleEventLogController ()
{
Program.Controller.ShowEventLogWindowEvent += delegate {
+ if (!WindowIsOpen)
+ ContentLoadingEvent ();
+
if (this.selected_folder == null) {
new Thread (() => {
UpdateChooserEvent (Folders);
@@ -152,6 +157,7 @@ namespace SparkleShare {
}).Start ();
}
+ WindowIsOpen = true;
ShowWindowEvent ();
};
@@ -172,6 +178,7 @@ namespace SparkleShare {
public void WindowClosed ()
{
+ WindowIsOpen = false;
HideWindowEvent ();
this.selected_folder = null;
}
diff --git a/SparkleShare/SparklePlugin.cs b/SparkleShare/SparklePlugin.cs
index ba73a14c..379d6dca 100644
--- a/SparkleShare/SparklePlugin.cs
+++ b/SparkleShare/SparklePlugin.cs
@@ -16,18 +16,18 @@
using System;
-using System.IO;
using System.Xml;
+using IO = System.IO;
+
namespace SparkleShare {
public class SparklePlugin {
public static string PluginsPath = "";
- public static string LocalPluginsPath =
- new string [] { Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
- "sparkleshare", "plugins" }.Combine ();
+ public static string LocalPluginsPath = new string [] {
+ Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "sparkleshare", "plugins" }.Combine ();
public string Name {
@@ -45,17 +45,12 @@ namespace SparkleShare {
public string ImagePath {
get {
string image_file_name = GetValue ("info", "icon");
+ string image_path = IO.Path.Combine (this.plugin_directory, image_file_name);
- string image_path = System.IO.Path.Combine (
- this.plugin_directory,
- image_file_name
- );
-
- if (File.Exists (image_path))
+ if (IO.File.Exists (image_path))
return image_path;
else
- return System.IO.Path.Combine (
- PluginsPath, image_file_name);
+ return IO.Path.Combine (PluginsPath, image_file_name);
}
}
@@ -128,7 +123,7 @@ namespace SparkleShare {
{
string plugin_path = System.IO.Path.Combine (LocalPluginsPath, name + ".xml");
- if (File.Exists (plugin_path))
+ if (IO.File.Exists (plugin_path))
return null;
string plugin_xml = "" +
@@ -153,10 +148,10 @@ namespace SparkleShare {
plugin_xml = plugin_xml.Replace ("", "");
plugin_xml = plugin_xml.Replace ("", "");
- if (!Directory.Exists (LocalPluginsPath))
- Directory.CreateDirectory (LocalPluginsPath);
+ if (!IO.Directory.Exists (LocalPluginsPath))
+ IO.Directory.CreateDirectory (LocalPluginsPath);
- File.WriteAllText (plugin_path, plugin_xml);
+ IO.File.WriteAllText (plugin_path, plugin_xml);
return new SparklePlugin (plugin_path);
}
@@ -164,8 +159,7 @@ namespace SparkleShare {
private string GetValue (string a, string b)
{
- XmlNode node = this.xml.SelectSingleNode (
- "/sparkleshare/plugin/" + a + "/" + b + "/text()");
+ XmlNode node = this.xml.SelectSingleNode ("/sparkleshare/plugin/" + a + "/" + b + "/text()");
if (node != null && !string.IsNullOrEmpty (node.Value))
return node.Value;