eventlog: fix some window flashes and controller logic

This commit is contained in:
Hylke Bons 2012-09-24 18:24:12 +02:00
parent ab344dc92c
commit 505c2c18f1

View file

@ -66,7 +66,7 @@ namespace SparkleShare {
// A short delay is less annoying than
// a flashing window
int delay = 500;
int delay = 1000;
if (watch.ElapsedMilliseconds < delay)
Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
@ -145,15 +145,27 @@ namespace SparkleShare {
public SparkleEventLogController ()
{
Program.Controller.ShowEventLogWindowEvent += delegate {
if (!WindowIsOpen)
if (!WindowIsOpen) {
ContentLoadingEvent ();
if (this.selected_folder == null) {
new Thread (() => {
UpdateChooserEvent (Folders);
UpdateContentEvent (HTML);
if (this.selected_folder == null) {
new Thread (() => {
Stopwatch watch = new Stopwatch ();
}).Start ();
watch.Start ();
string html = HTML;
watch.Stop ();
int delay = 1000;
if (watch.ElapsedMilliseconds < delay)
Thread.Sleep (delay - (int) watch.ElapsedMilliseconds);
UpdateChooserEvent (Folders);
UpdateContentEvent (html);
}).Start ();
}
}
WindowIsOpen = true;