From adc742d9e46a090de9af8e96da5d147d871ec500 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 8 May 2010 18:23:40 +0100 Subject: [PATCH] make statusicon static and allow icon changes --- SparkleShare/SparkleRepo.cs | 3 +++ SparkleShare/SparkleUI.cs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SparkleShare/SparkleRepo.cs b/SparkleShare/SparkleRepo.cs index 97427157..c119233f 100644 --- a/SparkleShare/SparkleRepo.cs +++ b/SparkleShare/SparkleRepo.cs @@ -15,6 +15,7 @@ // along with this program. If not, see . using Gtk; +using SparkleShare; using System; using System.Diagnostics; using System.IO; @@ -207,10 +208,12 @@ namespace SparkleShare { public void Fetch () { // TODO: change status icon to sync FetchTimer.Stop (); + SparkleUI.NotificationIcon.SetSyncingState (); Console.WriteLine ("[Git][" + Name + "] Fetching changes..."); Process.StartInfo.Arguments = "fetch"; Process.Start(); Process.WaitForExit (); + SparkleUI.NotificationIcon.SetIdleState (); Merge (); FetchTimer.Start (); } diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index af3a98b7..d67a0b66 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -27,7 +27,7 @@ namespace SparkleShare { public SparkleRepo [] Repositories; public SparkleWindow SparkleWindow; - public SparkleStatusIcon SparkleStatusIcon; + public static SparkleStatusIcon NotificationIcon; public SparkleUI (bool HideUI) { @@ -108,8 +108,8 @@ namespace SparkleShare { SparkleWindow.DeleteEvent += CloseSparkleWindow; // Create the status icon - SparkleStatusIcon = new SparkleStatusIcon (); - SparkleStatusIcon.Activate += delegate { + NotificationIcon = new SparkleStatusIcon (); + NotificationIcon.Activate += delegate { SparkleWindow.ToggleVisibility (); };