statusicon: syncing state is more important than error state. Also check all repos first

This commit is contained in:
Hylke Bons 2011-12-04 11:37:38 +01:00
parent 673c49431d
commit 478a82212b

View file

@ -532,24 +532,31 @@ namespace SparkleShare {
// Fires events for the current syncing state // Fires events for the current syncing state
public void UpdateState () public void UpdateState ()
{ {
bool has_syncing_repos = false;
bool has_unsynced_repos = false;
foreach (SparkleRepoBase repo in Repositories) { foreach (SparkleRepoBase repo in Repositories) {
if (repo.Status == SyncStatus.SyncDown || if (repo.Status == SyncStatus.SyncDown ||
repo.Status == SyncStatus.SyncUp || repo.Status == SyncStatus.SyncUp ||
repo.IsBuffering) { repo.IsBuffering) {
has_syncing_repos = true;
} else if (repo.HasUnsyncedChanges) {
has_unsynced_repos = true;
}
}
if (has_syncing_repos) {
if (OnSyncing != null) if (OnSyncing != null)
OnSyncing (); OnSyncing ();
return; } else if (has_unsynced_repos) {
} else if (repo.HasUnsyncedChanges) {
if (OnError != null) if (OnError != null)
OnError (); OnError ();
return; } else {
}
}
if (OnIdle != null) if (OnIdle != null)
OnIdle (); OnIdle ();
@ -558,6 +565,7 @@ namespace SparkleShare {
if (FolderSizeChanged != null) if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize); FolderSizeChanged (FolderSize);
} }
}
// Adds a repository to the list of repositories // Adds a repository to the list of repositories