statusicon: syncing state is more important than error state. Also check all repos first
This commit is contained in:
parent
673c49431d
commit
478a82212b
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue