[log] update when avatars are fetched

This commit is contained in:
Hylke Bons 2011-02-07 17:09:31 +00:00
parent a52eb340d6
commit bd7df75212
4 changed files with 28 additions and 2 deletions

View file

@ -110,6 +110,8 @@ namespace SparkleShare {
html = html.Replace ("<!-- $a-color -->", "#0085cf"); html = html.Replace ("<!-- $a-color -->", "#0085cf");
WebView.MainFrame.LoadHtmlString (html, new NSUrl ("")); WebView.MainFrame.LoadHtmlString (html, new NSUrl (""));
Update ();
} }

View file

@ -63,9 +63,24 @@ namespace SparkleShare {
NewEvents++; NewEvents++;
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString (); NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
foreach (SparkleLog log in SparkleUI.OpenLogs)
log.UpdateEventLog ();
}); });
}; };
SparkleShare.Controller.AvatarFetched += delegate {
InvokeOnMainThread (delegate {
foreach (SparkleLog log in SparkleUI.OpenLogs)
log.UpdateEventLog ();
});
};
} }

View file

@ -52,6 +52,9 @@ namespace SparkleShare {
public event FolderSizeChangedEventHandler FolderSizeChanged; public event FolderSizeChangedEventHandler FolderSizeChanged;
public delegate void FolderSizeChangedEventHandler (string folder_size); public delegate void FolderSizeChangedEventHandler (string folder_size);
public event AvatarFetchedEventHandler AvatarFetched;
public delegate void AvatarFetchedEventHandler ();
public event OnIdleEventHandler OnIdle; public event OnIdleEventHandler OnIdle;
public delegate void OnIdleEventHandler (); public delegate void OnIdleEventHandler ();
@ -999,7 +1002,7 @@ namespace SparkleShare {
// Gets the avatar for a specific email address and size // Gets the avatar for a specific email address and size
public static string GetAvatar (string email, int size) public string GetAvatar (string email, int size)
{ {
string avatar_path = SparkleHelpers.CombineMore (SparklePaths.SparkleLocalIconPath, string avatar_path = SparkleHelpers.CombineMore (SparklePaths.SparkleLocalIconPath,
@ -1040,6 +1043,9 @@ namespace SparkleShare {
if (tmp_file_info.Length > 255) if (tmp_file_info.Length > 255)
File.Move (tmp_file_path, avatar_file_path); File.Move (tmp_file_path, avatar_file_path);
if (AvatarFetched != null)
AvatarFetched ();
}; };

View file

@ -66,7 +66,10 @@
} }
img { img {
margin-right: 12px; margin-right: 12px;
width: 36px;
height: 36px;
background-color: <!-- $small-color -->;
} }
</style> </style>