diff --git a/SparkleShare/Mac/SparkleShare/SparkleIntro.cs b/SparkleShare/Mac/SparkleShare/SparkleIntro.cs index 3a42588a..4dd46fd7 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleIntro.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleIntro.cs @@ -36,6 +36,7 @@ namespace SparkleShare { private NSButton OpenFolderButton; private NSButton FinishButton; private NSForm UserInfoForm; + private NSProgressIndicator ProgressIndicator; private bool ServerFormOnly; @@ -69,7 +70,7 @@ namespace SparkleShare { NextButton = new NSButton () { - Title = "Next", + Title = "Next", Enabled = false }; @@ -99,8 +100,8 @@ namespace SparkleShare { bool name_is_correct = !UserInfoForm.Cells [0].StringValue.Trim ().Equals (""); - bool email_is_correct = - !UserInfoForm.Cells [1].StringValue.Trim ().Equals (""); + bool email_is_correct = SparkleShare.Controller.IsValidEmail + (UserInfoForm.Cells [1].StringValue.Trim ()); NextButton.Enabled = (name_is_correct && email_is_correct); @@ -137,8 +138,8 @@ namespace SparkleShare { SyncButton = new NSButton () { - Title = "Sync", - Enabled = false + Title = "Sync" + //Enabled = false TODO }; Buttons.Add (SyncButton); @@ -151,7 +152,7 @@ namespace SparkleShare { }; CancelButton.Activated += delegate { - PerformClose (this); + Close (); }; Buttons.Add (CancelButton); @@ -200,6 +201,37 @@ namespace SparkleShare { } + private void ShowSyncingPage (string name) + { + + Reset (); + + Header = "Syncing folder ‘" + name + "’…"; + Description = "This may take a while.\n" + + "You sure it’s not coffee o-clock?"; + + + ProgressIndicator = new NSProgressIndicator (new RectangleF (200, 230, 390, 20)) { + Style = NSProgressIndicatorStyle.Bar + }; + + ProgressIndicator.StartAnimation (this); + + ContentView.AddSubview (ProgressIndicator); + + + FinishButton = new NSButton () { + Title = "Finish", + Enabled = false + }; + + Buttons.Add (FinishButton); + + ShowAll (); + + } + + private void ShowSuccessPage (string folder_name) { @@ -232,6 +264,9 @@ namespace SparkleShare { Buttons.Add (OpenFolderButton); ShowAll (); + + NSApplication.SharedApplication.RequestUserAttention + (NSRequestUserAttentionType.CriticalRequest); } diff --git a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs index 82ab7fd3..a6d26e89 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs @@ -254,7 +254,8 @@ namespace SparkleShare { SparkleUI.Intro.ShowServerForm (true); SparkleUI.Intro.OrderFrontRegardless (); - + SparkleUI.Intro.MakeKeyAndOrderFront (this); + }); }; diff --git a/SparkleShare/Mac/SparkleShare/SparkleWindow.cs b/SparkleShare/Mac/SparkleShare/SparkleWindow.cs index 686957c7..6677407f 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleWindow.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleWindow.cs @@ -42,15 +42,14 @@ namespace SparkleShare { public SparkleWindow () : base () { + +// Title = "SparkleShare Configuration"; SetFrame (new RectangleF (0, 0, 640, 480), true); Center (); - StyleMask = ( - - NSWindowStyle.Titled); - + StyleMask = NSWindowStyle.Titled; MaxSize = new SizeF (640, 480); MinSize = new SizeF (640, 480); HasShadow = true; @@ -124,7 +123,7 @@ namespace SparkleShare { foreach (NSButton button in Buttons) { button.BezelStyle = NSBezelStyle.Rounded; - button.Frame = new RectangleF (Frame.Width - 20 - (120 * (i + 1)) - (4 * i), 12, 120, 31); + button.Frame = new RectangleF (Frame.Width - 15 - (105 * (i + 1)) , 12, 105, 31); ContentView.AddSubview (button); i++; diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 6b69202f..8f8f3f28 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -1150,7 +1150,7 @@ namespace SparkleShare { Quit (); } - + public void Quit () { @@ -1166,7 +1166,18 @@ namespace SparkleShare { Environment.Exit (0); - } + } + + + // Checks to see if an email address is valid + public bool IsValidEmail (string email) + { + + Regex regex = new Regex (@"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", RegexOptions.IgnoreCase); + return regex.IsMatch (email); + + } + }