eventlog: Fix some update logic

This commit is contained in:
Hylke Bons 2012-09-26 16:07:59 +02:00
parent 927d49780e
commit bcf4e32f06
4 changed files with 29 additions and 18 deletions

View file

@ -5,11 +5,11 @@
- Fix freeze when adding lots of files - Fix freeze when adding lots of files
- Fix using hosts with a non-standard SSH port - Fix using hosts with a non-standard SSH port
- Fix receiving of notification service message after the first one - 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 - New non-animating status icons
- More descriptive error reporting in the status icon - More descriptive error reporting in the status icon
- Add link to debug log in the about dialog - 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) 0.9.2 for Linux, Mac and Windows (Wed Aug 29 2012)

View file

@ -66,10 +66,8 @@ namespace SparkleShare {
new SizeF (min_width, (int) (NSScreen.MainScreen.Frame.Height * 0.85))), new SizeF (min_width, (int) (NSScreen.MainScreen.Frame.Height * 0.85))),
true); true);
StyleMask = (NSWindowStyle.Closable | StyleMask = (NSWindowStyle.Closable | NSWindowStyle.Miniaturizable |
NSWindowStyle.Miniaturizable | NSWindowStyle.Titled | NSWindowStyle.Resizable);
NSWindowStyle.Titled |
NSWindowStyle.Resizable);
MinSize = new SizeF (min_width, min_height); MinSize = new SizeF (min_width, min_height);
HasShadow = true; HasShadow = true;
@ -185,7 +183,6 @@ namespace SparkleShare {
using (var a = new NSAutoreleasePool ()) using (var a = new NSAutoreleasePool ())
{ {
InvokeOnMainThread (delegate { InvokeOnMainThread (delegate {
this.web_view.Hidden = true;
this.progress_indicator.Hidden = true; this.progress_indicator.Hidden = true;
PerformClose (this); PerformClose (this);
}); });
@ -214,6 +211,7 @@ namespace SparkleShare {
using (var a = new NSAutoreleasePool ()) using (var a = new NSAutoreleasePool ())
{ {
InvokeOnMainThread (delegate { InvokeOnMainThread (delegate {
this.progress_indicator.Hidden = true;
UpdateContent (html); UpdateContent (html);
}); });
} }
@ -223,7 +221,7 @@ namespace SparkleShare {
using (var a = new NSAutoreleasePool ()) using (var a = new NSAutoreleasePool ())
{ {
InvokeOnMainThread (delegate { InvokeOnMainThread (delegate {
this.web_view.Hidden = true; this.web_view.RemoveFromSuperview ();
this.progress_indicator.Hidden = false; this.progress_indicator.Hidden = false;
this.progress_indicator.StartAnimation (this); this.progress_indicator.StartAnimation (this);
@ -341,8 +339,7 @@ namespace SparkleShare {
if (html == null) if (html == null)
html = Controller.HTML; html = Controller.HTML;
string pixmaps_path = "file://" + Path.Combine ( string pixmaps_path = "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps");
NSBundle.MainBundle.ResourcePath, "Pixmaps");
html = html.Replace ("<!-- $body-font-family -->", "Lucida Grande"); html = html.Replace ("<!-- $body-font-family -->", "Lucida Grande");
html = html.Replace ("<!-- $day-entry-header-font-size -->", "13.6px"); html = html.Replace ("<!-- $day-entry-header-font-size -->", "13.6px");
@ -387,7 +384,6 @@ namespace SparkleShare {
}; };
this.progress_indicator.Hidden = true; this.progress_indicator.Hidden = true;
this.web_view.Hidden = false;
}); });
} }
} }

View file

@ -66,7 +66,7 @@ namespace SparkleShare {
// A short delay is less annoying than // A short delay is less annoying than
// a flashing window // a flashing window
int delay = 1000; int delay = 500;
if (watch.ElapsedMilliseconds < delay) if (watch.ElapsedMilliseconds < delay)
Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
@ -81,9 +81,7 @@ namespace SparkleShare {
public string HTML { public string HTML {
get { get {
List<SparkleChangeSet> change_sets = GetLog (this.selected_folder); List<SparkleChangeSet> change_sets = GetLog (this.selected_folder);
string html = GetHTMLLog (change_sets); string html = GetHTMLLog (change_sets);
UpdateSizeInfoEvent (Size, HistorySize);
return html; return html;
} }
@ -147,6 +145,7 @@ namespace SparkleShare {
Program.Controller.ShowEventLogWindowEvent += delegate { Program.Controller.ShowEventLogWindowEvent += delegate {
if (!WindowIsOpen) { if (!WindowIsOpen) {
ContentLoadingEvent (); ContentLoadingEvent ();
UpdateSizeInfoEvent ("…", "…");
if (this.selected_folder == null) { if (this.selected_folder == null) {
new Thread (() => { new Thread (() => {
@ -156,13 +155,14 @@ namespace SparkleShare {
string html = HTML; string html = HTML;
watch.Stop (); watch.Stop ();
int delay = 1000; int delay = 500;
if (watch.ElapsedMilliseconds < delay) if (watch.ElapsedMilliseconds < delay)
Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
UpdateChooserEvent (Folders); UpdateChooserEvent (Folders);
UpdateContentEvent (html); UpdateContentEvent (html);
UpdateSizeInfoEvent (Size, HistorySize);
}).Start (); }).Start ();
} }
@ -173,7 +173,21 @@ namespace SparkleShare {
}; };
Program.Controller.OnIdle += delegate { 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); UpdateSizeInfoEvent (Size, HistorySize);
}; };

View file

@ -166,6 +166,7 @@ namespace SparkleShare {
StateText = "Receiving changes…"; StateText = "Receiving changes…";
} }
if (ProgressPercentage > 0)
StateText += " " + ProgressPercentage + "% " + ProgressSpeed; StateText += " " + ProgressPercentage + "% " + ProgressSpeed;
UpdateIconEvent (CurrentState); UpdateIconEvent (CurrentState);