[intro] implement even more
This commit is contained in:
parent
74c0b2b6e3
commit
d3d665f13f
|
@ -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)
|
||||
{
|
||||
|
||||
|
@ -233,6 +265,9 @@ namespace SparkleShare {
|
|||
|
||||
ShowAll ();
|
||||
|
||||
NSApplication.SharedApplication.RequestUserAttention
|
||||
(NSRequestUserAttentionType.CriticalRequest);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -254,6 +254,7 @@ namespace SparkleShare {
|
|||
SparkleUI.Intro.ShowServerForm (true);
|
||||
|
||||
SparkleUI.Intro.OrderFrontRegardless ();
|
||||
SparkleUI.Intro.MakeKeyAndOrderFront (this);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -43,14 +43,13 @@ 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++;
|
||||
|
|
|
@ -1168,6 +1168,17 @@ namespace SparkleShare {
|
|||
|
||||
}
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue