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 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)

View file

@ -66,10 +66,8 @@ namespace SparkleShare {
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 @@ namespace SparkleShare {
using (var a = new NSAutoreleasePool ())
{
InvokeOnMainThread (delegate {
this.web_view.Hidden = true;
this.progress_indicator.Hidden = true;
PerformClose (this);
});
@ -214,6 +211,7 @@ namespace SparkleShare {
using (var a = new NSAutoreleasePool ())
{
InvokeOnMainThread (delegate {
this.progress_indicator.Hidden = true;
UpdateContent (html);
});
}
@ -223,7 +221,7 @@ namespace SparkleShare {
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 @@ namespace SparkleShare {
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 @@ namespace SparkleShare {
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 @@ namespace SparkleShare {
};
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 flashing window
int delay = 1000;
int delay = 500;
if (watch.ElapsedMilliseconds < delay)
Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
@ -81,9 +81,7 @@ namespace SparkleShare {
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 @@ namespace SparkleShare {
Program.Controller.ShowEventLogWindowEvent += delegate {
if (!WindowIsOpen) {
ContentLoadingEvent ();
UpdateSizeInfoEvent ("…", "…");
if (this.selected_folder == null) {
new Thread (() => {
@ -156,13 +155,14 @@ namespace SparkleShare {
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 @@ namespace SparkleShare {
};
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);
};

View file

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