make statusicon static and allow icon changes
This commit is contained in:
parent
a0667aa9b0
commit
adc742d9e4
|
@ -15,6 +15,7 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
using SparkleShare;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -207,10 +208,12 @@ namespace SparkleShare {
|
||||||
public void Fetch () {
|
public void Fetch () {
|
||||||
// TODO: change status icon to sync
|
// TODO: change status icon to sync
|
||||||
FetchTimer.Stop ();
|
FetchTimer.Stop ();
|
||||||
|
SparkleUI.NotificationIcon.SetSyncingState ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Fetching changes...");
|
Console.WriteLine ("[Git][" + Name + "] Fetching changes...");
|
||||||
Process.StartInfo.Arguments = "fetch";
|
Process.StartInfo.Arguments = "fetch";
|
||||||
Process.Start();
|
Process.Start();
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
|
SparkleUI.NotificationIcon.SetIdleState ();
|
||||||
Merge ();
|
Merge ();
|
||||||
FetchTimer.Start ();
|
FetchTimer.Start ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace SparkleShare {
|
||||||
public SparkleRepo [] Repositories;
|
public SparkleRepo [] Repositories;
|
||||||
|
|
||||||
public SparkleWindow SparkleWindow;
|
public SparkleWindow SparkleWindow;
|
||||||
public SparkleStatusIcon SparkleStatusIcon;
|
public static SparkleStatusIcon NotificationIcon;
|
||||||
|
|
||||||
public SparkleUI (bool HideUI) {
|
public SparkleUI (bool HideUI) {
|
||||||
|
|
||||||
|
@ -108,8 +108,8 @@ namespace SparkleShare {
|
||||||
SparkleWindow.DeleteEvent += CloseSparkleWindow;
|
SparkleWindow.DeleteEvent += CloseSparkleWindow;
|
||||||
|
|
||||||
// Create the status icon
|
// Create the status icon
|
||||||
SparkleStatusIcon = new SparkleStatusIcon ();
|
NotificationIcon = new SparkleStatusIcon ();
|
||||||
SparkleStatusIcon.Activate += delegate {
|
NotificationIcon.Activate += delegate {
|
||||||
SparkleWindow.ToggleVisibility ();
|
SparkleWindow.ToggleVisibility ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue