statusicon: tell whether we're sending or receiving files (or both)
This commit is contained in:
parent
daf4818cc2
commit
881eb94d48
|
@ -112,9 +112,17 @@ namespace SparkleShare {
|
|||
|
||||
break;
|
||||
|
||||
case IconState.Syncing:
|
||||
case default:
|
||||
string state_text;
|
||||
|
||||
if (state == IconState.SyncingUp)
|
||||
state_text = _("Sending files…");
|
||||
else if (state == IconState.SyncingDown)
|
||||
state_text = _("Receiving files…");
|
||||
else
|
||||
state_text = _("Syncing…");
|
||||
|
||||
this.state_text = _("Syncing… ") +
|
||||
this.state_text = state_text +
|
||||
Controller.ProgressPercentage + "% " +
|
||||
Controller.ProgressSpeed;
|
||||
|
||||
|
|
|
@ -124,9 +124,17 @@ namespace SparkleShare {
|
|||
|
||||
break;
|
||||
|
||||
case IconState.Syncing:
|
||||
case default:
|
||||
string state_text;
|
||||
|
||||
if (state == IconState.SyncingUp)
|
||||
state_text = "Sending files…";
|
||||
else if (state == IconState.SyncingDown)
|
||||
state_text = "Receiving files…";
|
||||
else
|
||||
state_text = "Syncing…";
|
||||
|
||||
StateText = _("Syncing… ") +
|
||||
StateText = state_text +
|
||||
Controller.ProgressPercentage + "% " +
|
||||
Controller.ProgressSpeed;
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ namespace SparkleShare {
|
|||
UpdateMenuEvent (CurrentState);
|
||||
};
|
||||
|
||||
|
||||
Program.Controller.OnIdle += delegate {
|
||||
if (CurrentState != IconState.Error)
|
||||
CurrentState = IconState.Idle;
|
||||
|
@ -107,18 +106,40 @@ namespace SparkleShare {
|
|||
UpdateMenuEvent (CurrentState);
|
||||
};
|
||||
|
||||
|
||||
Program.Controller.OnSyncing += delegate {
|
||||
CurrentState = IconState.Syncing;
|
||||
int repos_syncing_up = 0;
|
||||
int repos_syncing_down = 0;
|
||||
|
||||
foreach (SparkleRepoBase repo in
|
||||
Program.Controller.Repositories.GetRange (
|
||||
0, Program.Controller.Repositories.Count)) {
|
||||
|
||||
if (repo.Status == SyncStatus.SyncUp)
|
||||
repos_syncing_up++;
|
||||
|
||||
if (repo.Status == SyncStatus.SyncDown)
|
||||
repos_syncing_down++;
|
||||
}
|
||||
|
||||
if (repos_syncing_up > 0 &&
|
||||
repos_syncing_down > 0) {
|
||||
|
||||
CurrentState = IconState.Syncing;
|
||||
|
||||
} else if (repos_syncing_down == 0) {
|
||||
CurrentState = IconState.SyncingUp;
|
||||
|
||||
} else {
|
||||
CurrentState = IconState.SyncingDown;
|
||||
}
|
||||
|
||||
if (UpdateQuitItemEvent != null)
|
||||
UpdateQuitItemEvent (QuitItemEnabled);
|
||||
|
||||
if (UpdateMenuEvent != null)
|
||||
UpdateMenuEvent (IconState.Syncing);
|
||||
UpdateMenuEvent (CurrentState);
|
||||
};
|
||||
|
||||
|
||||
Program.Controller.OnError += delegate {
|
||||
CurrentState = IconState.Error;
|
||||
|
||||
|
@ -126,7 +147,7 @@ namespace SparkleShare {
|
|||
UpdateQuitItemEvent (QuitItemEnabled);
|
||||
|
||||
if (UpdateMenuEvent != null)
|
||||
UpdateMenuEvent (IconState.Error);
|
||||
UpdateMenuEvent (CurrentState);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -160,6 +181,7 @@ namespace SparkleShare {
|
|||
Program.Controller.ShowAboutWindow ();
|
||||
}
|
||||
|
||||
|
||||
public void QuitClicked ()
|
||||
{
|
||||
Program.Controller.Quit ();
|
||||
|
|
|
@ -96,9 +96,17 @@ namespace SparkleShare {
|
|||
break;
|
||||
}
|
||||
|
||||
case IconState.Syncing: {
|
||||
|
||||
this.notify_icon.Text = StateText = "Syncing… " +
|
||||
default: {
|
||||
string state_text;
|
||||
|
||||
if (state == IconState.SyncingUp)
|
||||
state_text = "Sending files…";
|
||||
else if (state == IconState.SyncingDown)
|
||||
state_text = "Receiving files…";
|
||||
else
|
||||
state_text = "Syncing…";
|
||||
|
||||
this.notify_icon.Text = StateText = state_text + " " +
|
||||
Controller.ProgressPercentage + "% " +
|
||||
Controller.ProgressSpeed;
|
||||
|
||||
|
|
Loading…
Reference in a new issue