From f3b53db8ab8c160ccc2edbda683b20ac943447a0 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 27 Aug 2011 17:53:17 +0200 Subject: [PATCH] Fix whitespace for last commit --- SparkleLib/Git/SparkleFetcherGit.cs | 68 ++++++++++++------------- SparkleLib/SparkleFetcherBase.cs | 18 +++---- SparkleShare/Mac/SparkleSetup.cs | 70 +++++++++++++------------- SparkleShare/SparkleController.cs | 16 +++--- SparkleShare/SparkleSetup.cs | 8 +-- SparkleShare/SparkleSetupController.cs | 14 +++--- 6 files changed, 97 insertions(+), 97 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index bbb5d22f..060932b4 100644 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -88,44 +88,44 @@ namespace SparkleLib { { this.git = new SparkleGit (SparkleConfig.DefaultConfig.TmpPath, "clone " + - "--progress " + // Redirects progress stats to standarderror - "\"" + base.remote_url + "\" " + "\"" + base.target_folder + "\""); - - this.git.StartInfo.RedirectStandardError = true; + "--progress " + // Redirects progress stats to standarderror + "\"" + base.remote_url + "\" " + "\"" + base.target_folder + "\""); + + this.git.StartInfo.RedirectStandardError = true; this.git.Start (); - - double percentage = 1.0; + + double percentage = 1.0; Regex progress_regex = new Regex (@"([0-9]+)%", RegexOptions.Compiled); - - while (!this.git.StandardError.EndOfStream) { - string line = this.git.StandardError.ReadLine (); - Match match = progress_regex.Match (line); - - double number = 0.0; + + while (!this.git.StandardError.EndOfStream) { + string line = this.git.StandardError.ReadLine (); + Match match = progress_regex.Match (line); + + double number = 0.0; if (match.Success) { number = double.Parse (match.Groups [1].Value); - - // The cloning progress consists of two stages: the "Compressing - // objects" stage which we count as 20% of the total progress, and - // the "Receiving objects" stage which we count as the last 80% - if (line.Contains ("|")) - // "Receiving objects" stage - number = (number / 100 * 75 + 20); - else - // "Compressing objects" stage - number = (number / 100 * 20); - } - - if (number >= percentage) { - percentage = number; - - // FIXME: for some reason it doesn't go above 95% - base.OnProgressChanged (percentage); - } - - System.Threading.Thread.Sleep (100); - } - + + // The cloning progress consists of two stages: the "Compressing + // objects" stage which we count as 20% of the total progress, and + // the "Receiving objects" stage which we count as the last 80% + if (line.Contains ("|")) + // "Receiving objects" stage + number = (number / 100 * 75 + 20); + else + // "Compressing objects" stage + number = (number / 100 * 20); + } + + if (number >= percentage) { + percentage = number; + + // FIXME: for some reason it doesn't go above 95% + base.OnProgressChanged (percentage); + } + + System.Threading.Thread.Sleep (100); + } + this.git.WaitForExit (); SparkleHelpers.DebugInfo ("Git", "Exit code " + this.git.ExitCode.ToString ()); diff --git a/SparkleLib/SparkleFetcherBase.cs b/SparkleLib/SparkleFetcherBase.cs index b4350932..654fd2c9 100644 --- a/SparkleLib/SparkleFetcherBase.cs +++ b/SparkleLib/SparkleFetcherBase.cs @@ -31,12 +31,12 @@ namespace SparkleLib { public delegate void StartedEventHandler (); public delegate void FinishedEventHandler (); public delegate void FailedEventHandler (); - public delegate void ProgressChangedEventHandler (double percentage); + public delegate void ProgressChangedEventHandler (double percentage); public event StartedEventHandler Started; public event FinishedEventHandler Finished; public event FailedEventHandler Failed; - public event ProgressChangedEventHandler ProgressChanged; + public event ProgressChangedEventHandler ProgressChanged; protected string target_folder; protected string remote_url; @@ -119,13 +119,13 @@ namespace SparkleLib { } } - - protected void OnProgressChanged (double percentage) { - if (ProgressChanged != null) - ProgressChanged (percentage); - } - - + + protected void OnProgressChanged (double percentage) { + if (ProgressChanged != null) + ProgressChanged (percentage); + } + + private void DisableHostKeyCheckingForHost (string host) { string path = SparkleConfig.DefaultConfig.HomePath; diff --git a/SparkleShare/Mac/SparkleSetup.cs b/SparkleShare/Mac/SparkleSetup.cs index 0baa75e9..5e99adc2 100644 --- a/SparkleShare/Mac/SparkleSetup.cs +++ b/SparkleShare/Mac/SparkleSetup.cs @@ -28,32 +28,32 @@ using MonoMac.WebKit; namespace SparkleShare { - public class SparkleSetup : SparkleSetupWindow { + public class SparkleSetup : SparkleSetupWindow { public SparkleSetupController Controller = new SparkleSetupController (); - private NSButton ContinueButton; - private NSButton SyncButton; - private NSButton TryAgainButton; - private NSButton CancelButton; - private NSButton OpenFolderButton; - private NSButton FinishButton; - private NSForm UserInfoForm; - private NSProgressIndicator ProgressIndicator; - private NSTextField AddressTextField; - private NSTextField FolderNameTextField; - private NSTextField ServerTypeLabel; - private NSTextField AddressLabel; - private NSTextField FolderNameLabel; - private NSTextField FolderNameHelpLabel; - private NSButtonCell ButtonCellProto; - private NSMatrix Matrix; - private int ServerType; + private NSButton ContinueButton; + private NSButton SyncButton; + private NSButton TryAgainButton; + private NSButton CancelButton; + private NSButton OpenFolderButton; + private NSButton FinishButton; + private NSForm UserInfoForm; + private NSProgressIndicator ProgressIndicator; + private NSTextField AddressTextField; + private NSTextField FolderNameTextField; + private NSTextField ServerTypeLabel; + private NSTextField AddressLabel; + private NSTextField FolderNameLabel; + private NSTextField FolderNameHelpLabel; + private NSButtonCell ButtonCellProto; + private NSMatrix Matrix; + private int ServerType; private Timer timer; - - public SparkleSetup () : base () - { + + public SparkleSetup () : base () + { Controller.ChangePageEvent += delegate (PageType type) { InvokeOnMainThread (delegate { Reset (); @@ -297,18 +297,18 @@ namespace SparkleShare { ProgressIndicator = new NSProgressIndicator () { Frame = new RectangleF (190, Frame.Height - 200, 640 - 150 - 80, 20), Style = NSProgressIndicatorStyle.Bar, - MinValue = 0.0, - MaxValue = 100.0 + MinValue = 0.0, + MaxValue = 100.0 }; - + // ProgressIndicator.StartAnimation (this); - - Controller.UpdateProgressBarEvent += delegate (double percentage) { - InvokeOnMainThread (delegate { + + Controller.UpdateProgressBarEvent += delegate (double percentage) { + InvokeOnMainThread (delegate { ProgressIndicator.DoubleValue = percentage; - }); - }; - + }); + }; + ContentView.AddSubview (ProgressIndicator); FinishButton = new NSButton () { @@ -317,12 +317,12 @@ namespace SparkleShare { }; CancelButton = new NSButton () { - Title = "Cancel" - }; + Title = "Cancel" + }; - CancelButton.Activated += delegate { + CancelButton.Activated += delegate { Controller.SyncingCancelled (); - }; + }; Buttons.Add (FinishButton); Buttons.Add (CancelButton); @@ -387,5 +387,5 @@ namespace SparkleShare { }); }; } - } + } } diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 902142e8..be12ee68 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -46,8 +46,8 @@ namespace SparkleShare { public event FolderFetchErrorEventHandler FolderFetchError; public delegate void FolderFetchErrorEventHandler (); - - public event FolderFetchingEventHandler FolderFetching; + + public event FolderFetchingEventHandler FolderFetching; public delegate void FolderFetchingEventHandler (double percentage); public event FolderListChangedEventHandler FolderListChanged; @@ -1058,12 +1058,12 @@ namespace SparkleShare { if (Directory.Exists (tmp_path)) Directory.Delete (tmp_path, true); }; - - - this.fetcher.ProgressChanged += delegate (double percentage) { - if (FolderFetching != null) - FolderFetching (percentage); - }; + + + this.fetcher.ProgressChanged += delegate (double percentage) { + if (FolderFetching != null) + FolderFetching (percentage); + }; this.fetcher.Start (); diff --git a/SparkleShare/SparkleSetup.cs b/SparkleShare/SparkleSetup.cs index 2d69eb93..72000dbe 100644 --- a/SparkleShare/SparkleSetup.cs +++ b/SparkleShare/SparkleSetup.cs @@ -313,10 +313,10 @@ namespace SparkleShare { AddButton (finish_button); Controller.UpdateProgressBarEvent += delegate (double percentage) { - Application.Invoke (delegate { - this.progress_bar.Fraction = percentage / 100; - }); - }; + Application.Invoke (delegate { + this.progress_bar.Fraction = percentage / 100; + }); + }; if (this.progress_bar.Parent != null) (this.progress_bar.Parent as Container).Remove (this.progress_bar); diff --git a/SparkleShare/SparkleSetupController.cs b/SparkleShare/SparkleSetupController.cs index c0d59251..b314b6a9 100644 --- a/SparkleShare/SparkleSetupController.cs +++ b/SparkleShare/SparkleSetupController.cs @@ -33,8 +33,8 @@ namespace SparkleShare { public event ChangePageEventHandler ChangePageEvent; public delegate void ChangePageEventHandler (PageType page); - - public event UpdateProgressBarEventHandler UpdateProgressBarEvent; + + public event UpdateProgressBarEventHandler UpdateProgressBarEvent; public delegate void UpdateProgressBarEventHandler (double percentage); public string PreviousServer { @@ -123,11 +123,11 @@ namespace SparkleShare { this.syncing_folder = ""; }; - - SparkleShare.Controller.FolderFetching += delegate (double percentage) { - if (UpdateProgressBarEvent != null) - UpdateProgressBarEvent (percentage); - }; + + SparkleShare.Controller.FolderFetching += delegate (double percentage) { + if (UpdateProgressBarEvent != null) + UpdateProgressBarEvent (percentage); + }; SparkleShare.Controller.FetchFolder (server, folder_name); }