From 112bea3b4a9ca7c2d02f3e74416e1c36abd6135f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 4 Sep 2010 17:30:09 +0100 Subject: [PATCH] [log] Refresh the event log when there are changes --- SparkleShare/SparkleLog.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/SparkleShare/SparkleLog.cs b/SparkleShare/SparkleLog.cs index 3215240a..831b51a5 100644 --- a/SparkleShare/SparkleLog.cs +++ b/SparkleShare/SparkleLog.cs @@ -93,7 +93,7 @@ namespace SparkleShare { } - public void UpdateEventLog () + public void UpdateEventLog (object o, EventArgs args) { LayoutVertical.Remove (ScrolledWindow); @@ -112,9 +112,21 @@ namespace SparkleShare { foreach (SparkleRepo repo in SparkleUI.Repositories) { + // Get commits from the repository if (repo.LocalPath.Equals (LocalPath)) { - commits = repo.GetCommits (40); + commits = repo.GetCommits (25); + + // Update the log when there are new remote changes + repo.NewCommit += delegate { + Application.Invoke (UpdateEventLog); + }; + + // Update the log when changes are being sent + repo.PushingStarted += delegate { + Application.Invoke (UpdateEventLog); + }; + break; }