log: fix coding style and whitespace
This commit is contained in:
parent
9901ca56ba
commit
a38442caf6
|
@ -50,7 +50,6 @@ namespace SparkleShare {
|
|||
|
||||
public SparkleLog (string path) : base ("")
|
||||
{
|
||||
|
||||
LocalPath = path;
|
||||
|
||||
string name = System.IO.Path.GetFileName (LocalPath);
|
||||
|
@ -78,12 +77,11 @@ namespace SparkleShare {
|
|||
|
||||
CreateEventLog ();
|
||||
UpdateEventLog ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void CreateEventLog () {
|
||||
|
||||
private void CreateEventLog ()
|
||||
{
|
||||
LogContent = new EventBox ();
|
||||
VBox layout_vertical = new VBox (false, 0);
|
||||
|
||||
|
@ -97,21 +95,16 @@ namespace SparkleShare {
|
|||
LinkStatus = args.Link;
|
||||
};
|
||||
|
||||
// FIXME: Use the right event, waiting for newer webkit bindings
|
||||
WebView.NavigationRequested += delegate (object o, WebKit.NavigationRequestedArgs args) {
|
||||
|
||||
if (args.Request.Uri == LinkStatus) {
|
||||
|
||||
Process process = new Process ();
|
||||
process.StartInfo.FileName = "xdg-open";
|
||||
process.StartInfo.Arguments = args.Request.Uri.Replace (" ", "\\ "); // Escape space-characters
|
||||
process.Start ();
|
||||
|
||||
// FIXME: Use the right event, waiting for newer webkit bindings
|
||||
|
||||
UpdateEventLog ();
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ScrolledWindow.AddWithViewport (WebView);
|
||||
|
@ -119,7 +112,6 @@ namespace SparkleShare {
|
|||
|
||||
layout_vertical.PackStart (LogContent, true, true, 0);
|
||||
|
||||
|
||||
HButtonBox dialog_buttons = new HButtonBox {
|
||||
Layout = ButtonBoxStyle.Edge,
|
||||
BorderWidth = 12
|
||||
|
@ -130,12 +122,10 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
open_folder_button.Clicked += delegate (object o, EventArgs args) {
|
||||
|
||||
Process process = new Process ();
|
||||
process.StartInfo.FileName = "xdg-open";
|
||||
process.StartInfo.Arguments = LocalPath.Replace (" ", "\\ "); // Escape space-characters
|
||||
process.Start ();
|
||||
|
||||
};
|
||||
|
||||
Button close_button = new Button (Stock.Close);
|
||||
|
@ -154,38 +144,29 @@ namespace SparkleShare {
|
|||
Add (layout_vertical);
|
||||
|
||||
ShowAll ();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void UpdateEventLog ()
|
||||
{
|
||||
|
||||
if (HTML == null) { // TODO: there may be a race condition here
|
||||
|
||||
LogContent.Remove (LogContent.Child);
|
||||
Spinner = new SparkleSpinner (22);
|
||||
LogContent.Add (Spinner);
|
||||
LogContent.ShowAll ();
|
||||
|
||||
}
|
||||
|
||||
Thread thread = new Thread (new ThreadStart (delegate {
|
||||
|
||||
GenerateHTML ();
|
||||
AddHTML ();
|
||||
|
||||
}));
|
||||
|
||||
thread.Start ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void GenerateHTML () {
|
||||
|
||||
private void GenerateHTML ()
|
||||
{
|
||||
HTML = SparkleShare.Controller.GetHTMLLog (System.IO.Path.GetFileName (LocalPath));
|
||||
|
||||
HTML = HTML.Replace ("<!-- $body-font-size -->", (double) (Style.FontDescription.Size / 1024 + 3) + "px");
|
||||
|
@ -201,15 +182,12 @@ namespace SparkleShare {
|
|||
HTML = HTML.Replace ("<!-- $no-buddy-icon-background-image -->", "file://" +
|
||||
SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons",
|
||||
"hicolor", "32x32", "status", "avatar-default.png"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void AddHTML ()
|
||||
{
|
||||
|
||||
Application.Invoke (delegate {
|
||||
|
||||
Spinner.Stop ();
|
||||
LogContent.Remove (LogContent.Child);
|
||||
|
||||
|
@ -228,25 +206,20 @@ namespace SparkleShare {
|
|||
|
||||
LogContent.Add (ScrolledWindow);
|
||||
LogContent.ShowAll ();
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Close (object o, DeleteEventArgs args)
|
||||
{
|
||||
|
||||
HideAll ();
|
||||
args.RetVal = true;
|
||||
// FIXME: window positions aren't saved
|
||||
|
||||
// TODO: window positions aren't saved
|
||||
}
|
||||
|
||||
|
||||
private MenuBar CreateShortcutsBar () {
|
||||
|
||||
private MenuBar CreateShortcutsBar ()
|
||||
{
|
||||
// Adds a hidden menubar that contains to enable keyboard
|
||||
// shortcuts to close the log
|
||||
MenuBar = new MenuBar ();
|
||||
|
@ -286,10 +259,6 @@ namespace SparkleShare {
|
|||
MenuBar.ModifyBg (StateType.Normal, Style.Background (StateType.Normal));
|
||||
|
||||
return MenuBar;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue