make statusicon static and allow icon changes

This commit is contained in:
Hylke Bons 2010-05-08 18:23:40 +01:00
parent a0667aa9b0
commit adc742d9e4
2 changed files with 6 additions and 3 deletions

View file

@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
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 ();
}

View file

@ -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 ();
};