Permalink
Browse files

eventlog: Fix some update logic

  • Loading branch information...
1 parent ade4e03 commit ee0bc9cc74cdab41afd433c6bd6f49271c9fa4ef @hbons committed Sep 26, 2012
View
@@ -5,11 +5,11 @@
- Fix freeze when adding lots of files
- Fix using hosts with a non-standard SSH port
- Fix receiving of notification service message after the first one
- - Use port 443 on the notification service to work better in
- restricted networks
- New non-animating status icons
- More descriptive error reporting in the status icon
- Add link to debug log in the about dialog
+ - Use port 443 on the notification service to work better in
+ restricted networks
0.9.2 for Linux, Mac and Windows (Wed Aug 29 2012)
@@ -66,10 +66,8 @@ public SparkleEventLog () : base ()
new SizeF (min_width, (int) (NSScreen.MainScreen.Frame.Height * 0.85))),
true);
- StyleMask = (NSWindowStyle.Closable |
- NSWindowStyle.Miniaturizable |
- NSWindowStyle.Titled |
- NSWindowStyle.Resizable);
+ StyleMask = (NSWindowStyle.Closable | NSWindowStyle.Miniaturizable |
+ NSWindowStyle.Titled | NSWindowStyle.Resizable);
MinSize = new SizeF (min_width, min_height);
HasShadow = true;
@@ -185,7 +183,6 @@ public SparkleEventLog () : base ()
using (var a = new NSAutoreleasePool ())
{
InvokeOnMainThread (delegate {
- this.web_view.Hidden = true;
this.progress_indicator.Hidden = true;
PerformClose (this);
});
@@ -214,6 +211,7 @@ public SparkleEventLog () : base ()
using (var a = new NSAutoreleasePool ())
{
InvokeOnMainThread (delegate {
+ this.progress_indicator.Hidden = true;
UpdateContent (html);
});
}
@@ -223,7 +221,7 @@ public SparkleEventLog () : base ()
using (var a = new NSAutoreleasePool ())
{
InvokeOnMainThread (delegate {
- this.web_view.Hidden = true;
+ this.web_view.RemoveFromSuperview ();
this.progress_indicator.Hidden = false;
this.progress_indicator.StartAnimation (this);
@@ -341,8 +339,7 @@ public void UpdateContent (string html)
if (html == null)
html = Controller.HTML;
- string pixmaps_path = "file://" + Path.Combine (
- NSBundle.MainBundle.ResourcePath, "Pixmaps");
+ string pixmaps_path = "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps");
html = html.Replace ("<!-- $body-font-family -->", "Lucida Grande");
html = html.Replace ("<!-- $day-entry-header-font-size -->", "13.6px");
@@ -376,7 +373,7 @@ public void UpdateContent (string html)
this.web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
web_view.PolicyDelegate = new SparkleWebPolicyDelegate ();
- ContentView.AddSubview (this.web_view);
+ ContentView.AddSubview (this.web_view);
(this.web_view.PolicyDelegate as SparkleWebPolicyDelegate).LinkClicked +=
delegate (string href) {
@@ -387,7 +384,6 @@ public void UpdateContent (string html)
};
this.progress_indicator.Hidden = true;
- this.web_view.Hidden = false;
});
}
}
@@ -66,7 +66,7 @@ public class SparkleEventLogController {
// A short delay is less annoying than
// a flashing window
- int delay = 1000;
+ int delay = 500;
if (watch.ElapsedMilliseconds < delay)
Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
@@ -81,9 +81,7 @@ public class SparkleEventLogController {
public string HTML {
get {
List<SparkleChangeSet> change_sets = GetLog (this.selected_folder);
-
string html = GetHTMLLog (change_sets);
- UpdateSizeInfoEvent (Size, HistorySize);
return html;
}
@@ -147,6 +145,7 @@ public SparkleEventLogController ()
Program.Controller.ShowEventLogWindowEvent += delegate {
if (!WindowIsOpen) {
ContentLoadingEvent ();
+ UpdateSizeInfoEvent ("", "");
if (this.selected_folder == null) {
new Thread (() => {
@@ -156,13 +155,14 @@ public SparkleEventLogController ()
string html = HTML;
watch.Stop ();
- int delay = 1000;
+ int delay = 500;
if (watch.ElapsedMilliseconds < delay)
Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
UpdateChooserEvent (Folders);
UpdateContentEvent (html);
+ UpdateSizeInfoEvent (Size, HistorySize);
}).Start ();
}
@@ -173,7 +173,21 @@ public SparkleEventLogController ()
};
Program.Controller.OnIdle += delegate {
- UpdateContentEvent (HTML);
+ ContentLoadingEvent ();
+ UpdateSizeInfoEvent ("", "");
+
+ Stopwatch watch = new Stopwatch ();
+
+ watch.Start ();
+ string html = HTML;
+ watch.Stop ();
+
+ int delay = 500;
+
+ if (watch.ElapsedMilliseconds < delay)
+ Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
+
+ UpdateContentEvent (html);
UpdateSizeInfoEvent (Size, HistorySize);
};
@@ -166,7 +166,8 @@ public SparkleStatusIconController ()
StateText = "Receiving changes…";
}
- StateText += " " + ProgressPercentage + "% " + ProgressSpeed;
+ if (ProgressPercentage > 0)
+ StateText += " " + ProgressPercentage + "% " + ProgressSpeed;
UpdateIconEvent (CurrentState);
UpdateStatusItemEvent (StateText);

0 comments on commit ee0bc9c

Please sign in to comment.