[osx] use a dock emblem to indicate new events

This commit is contained in:
Hylke Bons 2011-02-06 18:54:34 +00:00
parent 7719df2b06
commit 68a5b174c1
4 changed files with 21 additions and 6 deletions

1
README
View file

@ -93,6 +93,7 @@ Build on OSX:
=============
Get the Mono Framework, Monodevelop, and MacPorts.
Install git-core, automake and intltool using 'port install'.
Make sure that git or a symbolic link to git is in /usr/bin.

View file

@ -152,4 +152,4 @@ namespace SparkleShare {
}
}
}

View file

@ -380,13 +380,14 @@ namespace SparkleShare {
public override void MenuWillOpen (NSMenu menu)
{
Console.WriteLine ("OPENED");
InvokeOnMainThread (delegate {
foreach (SparkleLog log in SparkleUI.OpenLogs)
log.OrderFrontRegardless ();
SparkleUI.NewEvents = 0;
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
});

View file

@ -36,9 +36,9 @@ namespace SparkleShare {
public static SparkleStatusIcon StatusIcon;
public static List <SparkleLog> OpenLogs;
public static int NewEvents;
public SparkleUI ()
{
@ -49,9 +49,22 @@ namespace SparkleShare {
OpenLogs = new List <SparkleLog> ();
StatusIcon = new SparkleStatusIcon ();
NewEvents = 0;
SparkleShare.Controller.NotificationRaised += delegate {
InvokeOnMainThread (delegate {
NewEvents++;
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
});
};
}
public void Run ()
{