diff --git a/SparkleShare/Mac/SparkleBubbles.cs b/SparkleShare/Mac/SparkleBubbles.cs index 95487186..226ced8d 100755 --- a/SparkleShare/Mac/SparkleBubbles.cs +++ b/SparkleShare/Mac/SparkleBubbles.cs @@ -51,14 +51,34 @@ namespace SparkleShare { if (image_path != null && File.Exists (image_path)) { NSData image_data = NSData.FromFile (image_path); GrowlApplicationBridge.Notify (title, subtext, - "Event", image_data, 0, false, null); + "Event", image_data, 0, false, new NSString ("")); } else { GrowlApplicationBridge.Notify (title, subtext, - "Event", null, 0, false, null); + "Event", null, 0, false, new NSString ("")); } }); }; } } + + + public class SparkleGrowlDelegate : GrowlDelegate { + + [Export("growlNotificationWasClicked")] + public override void GrowlNotificationWasClicked (NSObject o) + { + InvokeOnMainThread (delegate { + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + + if (SparkleUI.EventLog == null) + SparkleUI.EventLog = new SparkleEventLog (); + + SparkleUI.EventLog.Controller.SelectedFolder = null; + + SparkleUI.EventLog.OrderFrontRegardless (); + SparkleUI.EventLog.MakeKeyAndOrderFront (this); + }); + } + } } diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index fc6660ec..27674b43 100755 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -30,7 +30,7 @@ namespace SparkleShare { public class SparkleEventLog : NSWindow { - private SparkleEventLogController controller = new SparkleEventLogController (); + public SparkleEventLogController Controller = new SparkleEventLogController (); private WebView web_view = new WebView (new RectangleF (0, 0, 480, 579), "", "") { PolicyDelegate = new SparkleWebPolicyDelegate () @@ -83,19 +83,19 @@ namespace SparkleShare { // Hook up the controller events - this.controller.UpdateChooserEvent += delegate (string [] folders) { + Controller.UpdateChooserEvent += delegate (string [] folders) { InvokeOnMainThread (delegate { UpdateChooser (folders); }); }; - this.controller.UpdateContentEvent += delegate (string html) { + Controller.UpdateContentEvent += delegate (string html) { InvokeOnMainThread (delegate { UpdateContent (html); }); }; - this.controller.ContentLoadingEvent += delegate { + Controller.ContentLoadingEvent += delegate { InvokeOnMainThread (delegate { if (this.web_view.Superview == ContentView) this.web_view.RemoveFromSuperview (); @@ -109,7 +109,7 @@ namespace SparkleShare { public void UpdateChooser (string [] folders) { if (folders == null) - folders = this.controller.Folders; + folders = Controller.Folders; if (this.popup_button != null) this.popup_button.RemoveFromSuperview (); @@ -129,9 +129,9 @@ namespace SparkleShare { this.popup_button.Activated += delegate { if (this.popup_button.IndexOfSelectedItem == 0) - this.controller.SelectedFolder = null; + Controller.SelectedFolder = null; else - this.controller.SelectedFolder = this.popup_button.SelectedItem.Title; + Controller.SelectedFolder = this.popup_button.SelectedItem.Title; }; ContentView.AddSubview (this.popup_button); @@ -143,7 +143,7 @@ namespace SparkleShare { using (NSAutoreleasePool pool = new NSAutoreleasePool ()) { Thread thread = new Thread (new ThreadStart (delegate { if (html == null) - html = this.controller.HTML; + html = Controller.HTML; html = html.Replace ("", "Lucida Grande"); html = html.Replace ("", "13.6px"); diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index 2f53d0da..94dc621b 100755 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -61,6 +61,7 @@ namespace SparkleShare { // Needed for Growl GrowlApplicationBridge.WeakDelegate = this; + GrowlApplicationBridge.Delegate = new SparkleGrowlDelegate (); NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed ("sparkleshare.icns");