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/>.
|
||||
|
||||
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 ();
|
||||
}
|
||||
|
|
|
@ -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 ();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue