[ui] Only update relevant logs

This commit is contained in:
Hylke Bons 2011-03-24 00:17:44 +00:00
parent c1c63a9c7d
commit 7c3d98c485
2 changed files with 10 additions and 18 deletions

View file

@ -99,11 +99,8 @@ namespace SparkleShare {
InvokeOnMainThread (delegate {
foreach (SparkleLog log in OpenLogs) {
Console.WriteLine (log.LocalPath + " " +repository_path);
if (log.LocalPath.Equals (repository_path)) {
Console.WriteLine ("UPDATING " + repository_path);
if (log.LocalPath.Equals (repository_path))
log.UpdateEventLog ();
}
}
if (SparkleShare.Controller.NotificationsEnabled) {

View file

@ -82,23 +82,18 @@ namespace SparkleShare {
SparkleShare.Controller.NotificationRaised += delegate (string user_name, string user_email,
string message, string repository_path) {
foreach (SparkleLog log in OpenLogs) {
if (log.LocalPath.Equals (repository_path)) {
Application.Invoke (delegate {
log.UpdateEventLog ();
});
}
}
Application.Invoke (delegate {
// TODO: move to controller and do translation here
if (!SparkleShare.Controller.NotificationsEnabled)
return;
foreach (SparkleLog log in OpenLogs) {
if (log.LocalPath.Equals (repository_path))
log.UpdateEventLog ();
}
if (!SparkleShare.Controller.NotificationsEnabled)
return;
Application.Invoke (delegate {
SparkleBubble bubble = new SparkleBubble (user_name, message);
SparkleBubble bubble = new SparkleBubble (user_name, message);
string avatar_file_path = SparkleUIHelpers.GetAvatar (user_email, 32);
if (avatar_file_path != null)