linux statusicon: Simplify status icon allocation

Conflicts:
	SparkleShare/Linux/SparkleStatusIcon.cs
This commit is contained in:
Hylke Bons 2013-10-10 13:06:16 +02:00
parent f3decdc503
commit 485e12b8ae

View file

@ -58,53 +58,28 @@ namespace SparkleShare {
Controller.UpdateIconEvent += delegate (IconState state) { Controller.UpdateIconEvent += delegate (IconState state) {
Application.Invoke (delegate { Application.Invoke (delegate {
switch (state) { #if HAVE_APP_INDICATOR
case IconState.Idle: { string icon_name = "process-syncing-idle";
#if HAVE_APP_INDICATOR #else
this.indicator.IconName = "process-syncing-idle"; string icon_name = "sparkleshare";
#else #endif
this.status_icon.IconName = "sparkleshare";
#endif if (state == IconState.SyncingUp)
break; icon_name = "process-syncing-up";
} else if (state == IconState.SyncingDown)
case IconState.SyncingUp: { icon_name = "process-syncing-down";
#if HAVE_APP_INDICATOR else if (state == IconState.Syncing)
this.indicator.IconName = "process-syncing-up"; icon_name = "process-syncing";
#else else if (state == IconState.Error)
this.status_icon.IconName = "process-syncing-up"; icon_name = "process-syncing-error";
#endif
break;
}
case IconState.SyncingDown: {
#if HAVE_APP_INDICATOR
this.indicator.IconName = "process-syncing-down";
#else
this.status_icon.IconName = "process-syncing-down";
#endif
break;
}
case IconState.Syncing: {
#if HAVE_APP_INDICATOR
this.indicator.IconName = "process-syncing";
#else
this.status_icon.IconName = "process-syncing";
#endif
break;
}
case IconState.Error: {
#if HAVE_APP_INDICATOR
this.indicator.IconName = "process-syncing-error";
#else
this.status_icon.IconName = "process-syncing-error";
#endif
break;
}
}
#if HAVE_APP_INDICATOR #if HAVE_APP_INDICATOR
// Force update of the status icon this.indicator.IconName = icon_name;
this.indicator.Status = Status.Attention; this.indicator.Status = Status.Attention;
this.indicator.Status = Status.Active; this.indicator.Status = Status.Active;
#else
this.status_icon.IconName = icon_name
#endif #endif
}); });
}; };