[log] Fix spinner not being removed and logs popping up
This commit is contained in:
parent
d51b984617
commit
5a96bab825
|
@ -32,13 +32,13 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public readonly string LocalPath;
|
public readonly string LocalPath;
|
||||||
|
|
||||||
private VBox LayoutVertical;
|
|
||||||
private ScrolledWindow ScrolledWindow;
|
private ScrolledWindow ScrolledWindow;
|
||||||
private MenuBar MenuBar;
|
private MenuBar MenuBar;
|
||||||
private WebView WebView;
|
private WebView WebView;
|
||||||
private string LinkStatus;
|
private string LinkStatus;
|
||||||
private SparkleSpinner Spinner;
|
private SparkleSpinner Spinner;
|
||||||
private string HTML;
|
private string HTML;
|
||||||
|
private EventBox LogContent;
|
||||||
|
|
||||||
|
|
||||||
// Short alias for the translations
|
// Short alias for the translations
|
||||||
|
@ -77,13 +77,15 @@ namespace SparkleShare {
|
||||||
DeleteEvent += Close;
|
DeleteEvent += Close;
|
||||||
|
|
||||||
CreateEventLog ();
|
CreateEventLog ();
|
||||||
|
UpdateEventLog ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void CreateEventLog () {
|
private void CreateEventLog () {
|
||||||
|
|
||||||
LayoutVertical = new VBox (false, 0);
|
LogContent = new EventBox ();
|
||||||
|
VBox layout_vertical = new VBox (false, 0);
|
||||||
|
|
||||||
ScrolledWindow = new ScrolledWindow ();
|
ScrolledWindow = new ScrolledWindow ();
|
||||||
|
|
||||||
|
@ -113,10 +115,10 @@ namespace SparkleShare {
|
||||||
};
|
};
|
||||||
|
|
||||||
ScrolledWindow.AddWithViewport (WebView);
|
ScrolledWindow.AddWithViewport (WebView);
|
||||||
|
LogContent.Add (ScrolledWindow);
|
||||||
|
|
||||||
LayoutVertical.PackStart (ScrolledWindow, true, true, 0);
|
layout_vertical.PackStart (LogContent, true, true, 0);
|
||||||
|
|
||||||
UpdateEventLog ();
|
|
||||||
|
|
||||||
HButtonBox dialog_buttons = new HButtonBox {
|
HButtonBox dialog_buttons = new HButtonBox {
|
||||||
Layout = ButtonBoxStyle.Edge,
|
Layout = ButtonBoxStyle.Edge,
|
||||||
|
@ -146,10 +148,14 @@ namespace SparkleShare {
|
||||||
dialog_buttons.Add (close_button);
|
dialog_buttons.Add (close_button);
|
||||||
|
|
||||||
// We have to hide the menubar somewhere...
|
// We have to hide the menubar somewhere...
|
||||||
LayoutVertical.PackStart (CreateShortcutsBar (), false, false, 0);
|
layout_vertical.PackStart (CreateShortcutsBar (), false, false, 0);
|
||||||
LayoutVertical.PackStart (dialog_buttons, false, false, 0);
|
layout_vertical.PackStart (dialog_buttons, false, false, 0);
|
||||||
|
|
||||||
|
Add (layout_vertical);
|
||||||
|
|
||||||
|
ShowAll ();
|
||||||
|
|
||||||
|
|
||||||
Add (LayoutVertical);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,9 +165,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
if (HTML == null) { // TODO: there may be a race condition here
|
if (HTML == null) { // TODO: there may be a race condition here
|
||||||
|
|
||||||
LayoutVertical.Remove (ScrolledWindow);
|
LogContent.Remove (LogContent.Child);
|
||||||
Spinner = new SparkleSpinner (22);
|
Spinner = new SparkleSpinner (22);
|
||||||
LayoutVertical.PackStart (Spinner, true, true, 0);
|
LogContent.Add (Spinner);
|
||||||
|
LogContent.ShowAll ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,31 +211,24 @@ namespace SparkleShare {
|
||||||
Application.Invoke (delegate {
|
Application.Invoke (delegate {
|
||||||
|
|
||||||
Spinner.Stop ();
|
Spinner.Stop ();
|
||||||
|
LogContent.Remove (LogContent.Child);
|
||||||
if (Spinner.Parent == LayoutVertical) {
|
|
||||||
|
|
||||||
LayoutVertical.Remove (Spinner);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
LayoutVertical.Remove (ScrolledWindow);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrolledWindow = new ScrolledWindow () {
|
ScrolledWindow = new ScrolledWindow () {
|
||||||
HscrollbarPolicy = PolicyType.Never
|
HscrollbarPolicy = PolicyType.Never
|
||||||
};
|
};
|
||||||
|
|
||||||
Viewport viewport = new Viewport ();
|
Viewport viewport = new Viewport () {
|
||||||
|
ShadowType = ShadowType.None
|
||||||
|
};
|
||||||
|
|
||||||
WebView.Reparent (viewport);
|
WebView.Reparent (viewport);
|
||||||
ScrolledWindow.Add (viewport);
|
ScrolledWindow.Add (viewport);
|
||||||
(ScrolledWindow.Child as Viewport).ShadowType = ShadowType.None;
|
|
||||||
LayoutVertical.PackStart (ScrolledWindow, true, true, 0);
|
|
||||||
LayoutVertical.ReorderChild (ScrolledWindow, 0);
|
|
||||||
|
|
||||||
WebView.LoadString (HTML, null, null, "file://");
|
WebView.LoadString (HTML, null, null, "file://");
|
||||||
|
|
||||||
ShowAll ();
|
LogContent.Add (ScrolledWindow);
|
||||||
|
LogContent.ShowAll ();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue