Fix notifications
This commit is contained in:
parent
3bf278ffe2
commit
b947908a46
|
@ -53,7 +53,7 @@ namespace SparkleLib {
|
||||||
Nick = GetSHA1 (DateTime.Now.ToString () + "sparkles");
|
Nick = GetSHA1 (DateTime.Now.ToString () + "sparkles");
|
||||||
|
|
||||||
Nick = "s" + Nick.Substring (0, 7);
|
Nick = "s" + Nick.Substring (0, 7);
|
||||||
Channel = "#" + GetSHA1 (server + folder_name);
|
Channel = "#" + GetSHA1 (server + folder_name + "sparkles");
|
||||||
|
|
||||||
Client = new IrcClient () {
|
Client = new IrcClient () {
|
||||||
PingTimeout = 180,
|
PingTimeout = 180,
|
||||||
|
|
|
@ -256,8 +256,8 @@ namespace SparkleLib {
|
||||||
LocalPath = path;
|
LocalPath = path;
|
||||||
Name = Path.GetFileName (LocalPath);
|
Name = Path.GetFileName (LocalPath);
|
||||||
|
|
||||||
RemoteName = Path.GetFileNameWithoutExtension (RemoteOriginUrl);
|
|
||||||
RemoteOriginUrl = Config ["remote.origin.url"];
|
RemoteOriginUrl = Config ["remote.origin.url"];
|
||||||
|
RemoteName = Path.GetFileNameWithoutExtension (RemoteOriginUrl);
|
||||||
Domain = GetDomain (RemoteOriginUrl);
|
Domain = GetDomain (RemoteOriginUrl);
|
||||||
Description = GetDescription ();
|
Description = GetDescription ();
|
||||||
UserName = Config ["user.name"];
|
UserName = Config ["user.name"];
|
||||||
|
@ -307,7 +307,7 @@ namespace SparkleLib {
|
||||||
|
|
||||||
|
|
||||||
// Listen to the irc channel on the server...
|
// 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
|
// ...fetch remote changes every 60 seconds if that fails
|
||||||
RemoteTimer = new Timer () {
|
RemoteTimer = new Timer () {
|
||||||
|
|
|
@ -30,11 +30,25 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public partial class AppDelegate : NSApplicationDelegate {
|
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 SparkleStatusIcon StatusIcon;
|
||||||
public static List <SparkleLog> OpenLogs;
|
public static List <SparkleLog> OpenLogs;
|
||||||
|
@ -45,6 +59,7 @@ namespace SparkleShare {
|
||||||
private SparkleAbout About;
|
private SparkleAbout About;
|
||||||
private NSAlert Alert;
|
private NSAlert Alert;
|
||||||
|
|
||||||
|
|
||||||
public SparkleUI ()
|
public SparkleUI ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -78,8 +93,11 @@ namespace SparkleShare {
|
||||||
|
|
||||||
InvokeOnMainThread (delegate {
|
InvokeOnMainThread (delegate {
|
||||||
|
|
||||||
NewEvents++;
|
if (NSApplication.SharedApplication.DockTile.BadgeLabel == null)
|
||||||
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
|
NSApplication.SharedApplication.DockTile.BadgeLabel = "1";
|
||||||
|
else
|
||||||
|
NSApplication.SharedApplication.DockTile.BadgeLabel =
|
||||||
|
(int.Parse (NSApplication.SharedApplication.DockTile.BadgeLabel) + 1).ToString ();
|
||||||
|
|
||||||
foreach (SparkleLog log in SparkleUI.OpenLogs)
|
foreach (SparkleLog log in SparkleUI.OpenLogs)
|
||||||
log.UpdateEventLog ();
|
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 ();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue