Fix notifications

This commit is contained in:
Hylke Bons 2011-03-13 02:07:47 +00:00
parent 3bf278ffe2
commit b947908a46
3 changed files with 26 additions and 23 deletions

View file

@ -53,8 +53,8 @@ namespace SparkleLib {
Nick = GetSHA1 (DateTime.Now.ToString () + "sparkles");
Nick = "s" + Nick.Substring (0, 7);
Channel = "#" + GetSHA1 (server + folder_name);
Channel = "#" + GetSHA1 (server + folder_name + "sparkles");
Client = new IrcClient () {
PingTimeout = 180,
PingInterval = 90

View file

@ -256,8 +256,8 @@ namespace SparkleLib {
LocalPath = path;
Name = Path.GetFileName (LocalPath);
RemoteName = Path.GetFileNameWithoutExtension (RemoteOriginUrl);
RemoteOriginUrl = Config ["remote.origin.url"];
RemoteName = Path.GetFileNameWithoutExtension (RemoteOriginUrl);
Domain = GetDomain (RemoteOriginUrl);
Description = GetDescription ();
UserName = Config ["user.name"];
@ -307,7 +307,7 @@ namespace SparkleLib {
// Listen to the irc channel on the server...
Listener = new SparkleListener (Domain, "#" + RemoteName, UserEmail);
Listener = new SparkleListener (Domain, RemoteName, UserEmail);
// ...fetch remote changes every 60 seconds if that fails
RemoteTimer = new Timer () {

View file

@ -30,11 +30,25 @@ namespace SparkleShare {
public partial class AppDelegate : NSApplicationDelegate {
public override void WillBecomeActive (NSNotification notification)
{
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
}
public override void OrderFrontStandardAboutPanel (NSObject sender)
{
// FIXME: Doesn't work
new SparkleAbout ();
}
}
public class SparkleUI : AppDelegate
{
public class SparkleUI : AppDelegate {
public static SparkleStatusIcon StatusIcon;
public static List <SparkleLog> OpenLogs;
@ -45,6 +59,7 @@ namespace SparkleShare {
private SparkleAbout About;
private NSAlert Alert;
public SparkleUI ()
{
@ -78,8 +93,11 @@ namespace SparkleShare {
InvokeOnMainThread (delegate {
NewEvents++;
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
if (NSApplication.SharedApplication.DockTile.BadgeLabel == null)
NSApplication.SharedApplication.DockTile.BadgeLabel = "1";
else
NSApplication.SharedApplication.DockTile.BadgeLabel =
(int.Parse (NSApplication.SharedApplication.DockTile.BadgeLabel) + 1).ToString ();
foreach (SparkleLog log in SparkleUI.OpenLogs)
log.UpdateEventLog ();
@ -147,22 +165,7 @@ namespace SparkleShare {
}
public override void WillBecomeActive (NSNotification notification)
{
NewEvents = 0;
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
}
public override void OrderFrontStandardAboutPanel (NSObject sender)
{
// FIXME: Doesn't work
About = new SparkleAbout ();
About.Update ();
}
}