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 4b7f967229
commit 864e58c1a9

View file

@ -532,31 +532,39 @@ namespace SparkleShare {
// Fires events for the current syncing state
public void UpdateState ()
{
bool has_syncing_repos = false;
bool has_unsynced_repos = false;
foreach (SparkleRepoBase repo in Repositories) {
if (repo.Status == SyncStatus.SyncDown ||
repo.Status == SyncStatus.SyncUp ||
repo.IsBuffering) {
if (OnSyncing != null)
OnSyncing ();
return;
has_syncing_repos = true;
} else if (repo.HasUnsyncedChanges) {
if (OnError != null)
OnError ();
return;
has_unsynced_repos = true;
}
}
if (OnIdle != null)
OnIdle ();
FolderSize = GetFolderSize ();
if (has_syncing_repos) {
if (OnSyncing != null)
OnSyncing ();
if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize);
} else if (has_unsynced_repos) {
if (OnError != null)
OnError ();
} else {
if (OnIdle != null)
OnIdle ();
FolderSize = GetFolderSize ();
if (FolderSizeChanged != null)
FolderSizeChanged (FolderSize);
}
}