mac: open event log when dock icon with badge is clicked

This commit is contained in:
Hylke Bons 2012-03-01 21:02:18 +00:00
parent 84413d2c53
commit f2d6daeda2
4 changed files with 678 additions and 669 deletions

View file

@ -68,6 +68,7 @@ namespace SparkleShare {
[Export("growlNotificationWasClicked")] [Export("growlNotificationWasClicked")]
public override void GrowlNotificationWasClicked (NSObject o) public override void GrowlNotificationWasClicked (NSObject o)
{ {
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
SparkleUI.Bubbles.Controller.BubbleClicked (); SparkleUI.Bubbles.Controller.BubbleClicked ();
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -92,18 +92,23 @@ namespace SparkleShare {
Menu.Delegate = new SparkleStatusIconMenuDelegate (); Menu.Delegate = new SparkleStatusIconMenuDelegate ();
} }
Controller.UpdateQuitItemEvent += delegate (bool quit_item_enabled) { Controller.UpdateQuitItemEvent += delegate (bool quit_item_enabled) {
InvokeOnMainThread (delegate { using (var a = new NSAutoreleasePool ())
if (QuitMenuItem != null) { {
QuitMenuItem.Enabled = quit_item_enabled; InvokeOnMainThread (delegate {
StatusItem.Menu.Update (); if (QuitMenuItem != null) {
} QuitMenuItem.Enabled = quit_item_enabled;
}); StatusItem.Menu.Update ();
}
});
}
}; };
Controller.UpdateMenuEvent += delegate (IconState state) { Controller.UpdateMenuEvent += delegate (IconState state) {
InvokeOnMainThread (delegate { using (var a = new NSAutoreleasePool ())
using (var a = new NSAutoreleasePool ()) { {
InvokeOnMainThread (delegate {
switch (state) { switch (state) {
case IconState.Idle: case IconState.Idle:
@ -149,8 +154,8 @@ namespace SparkleShare {
} }
StatusItem.Menu.Update (); StatusItem.Menu.Update ();
} });
}); }
}; };
} }

View file

@ -117,10 +117,7 @@ namespace SparkleShare {
private void ShowDockIcon () private void ShowDockIcon ()
{ {
using (var a = new NSAutoreleasePool ()) NSApplication.SharedApplication.ActivationPolicy = NSApplicationActivationPolicy.Regular;
{
NSApplication.SharedApplication.ActivationPolicy = NSApplicationActivationPolicy.Regular;
}
} }
@ -137,7 +134,10 @@ namespace SparkleShare {
public override void WillBecomeActive (NSNotification notification) public override void WillBecomeActive (NSNotification notification)
{ {
NSApplication.SharedApplication.DockTile.BadgeLabel = null; if (NSApplication.SharedApplication.DockTile.BadgeLabel != null) {
Program.Controller.ShowEventLogWindow ();
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
}
} }