windows: add cancel buttons to Setup and Add pages
This commit is contained in:
parent
21ad9a25ec
commit
95dee4b458
|
@ -25,11 +25,7 @@ using System.Security.Cryptography;
|
|||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
|
||||
#if __MonoCS__
|
||||
using Mono.Unix;
|
||||
#endif
|
||||
using SparkleLib;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
@ -1138,11 +1134,7 @@ namespace SparkleShare {
|
|||
repo.Dispose ();
|
||||
}
|
||||
|
||||
#if __MonoCS__
|
||||
Environment.Exit (0);
|
||||
#else
|
||||
System.Windows.Forms.Application.Exit();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -204,6 +204,12 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
public void SetupPageCancelled ()
|
||||
{
|
||||
Program.Controller.Quit ();
|
||||
}
|
||||
|
||||
|
||||
public void SetupPageCompleted (string full_name, string email)
|
||||
{
|
||||
Program.Controller.UserName = full_name;
|
||||
|
@ -449,9 +455,6 @@ namespace SparkleShare {
|
|||
|
||||
public void ErrorPageCompleted ()
|
||||
{
|
||||
if (ChangePageEvent == null)
|
||||
return;
|
||||
|
||||
if (PendingInvite != null)
|
||||
ChangePageEvent (PageType.Invite, null);
|
||||
else
|
||||
|
|
|
@ -159,5 +159,10 @@ namespace SparkleShare {
|
|||
{
|
||||
Program.Controller.ShowAboutWindow ();
|
||||
}
|
||||
|
||||
public void QuitClicked ()
|
||||
{
|
||||
Program.Controller.Quit ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,6 +89,11 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
|
||||
|
||||
Button cancel_button = new Button () {
|
||||
Content = "Cancel"
|
||||
};
|
||||
|
||||
Button continue_button = new Button () {
|
||||
Content = "Continue",
|
||||
IsEnabled = false
|
||||
|
@ -112,6 +117,7 @@ namespace SparkleShare {
|
|||
Canvas.SetTop (email_box, 230);
|
||||
|
||||
Buttons.Add (continue_button);
|
||||
Buttons.Add (cancel_button);
|
||||
|
||||
|
||||
Controller.UpdateSetupContinueButtonEvent += delegate (bool enabled) {
|
||||
|
@ -128,6 +134,13 @@ namespace SparkleShare {
|
|||
Controller.CheckSetupPage (name_box.Text, email_box.Text);
|
||||
};
|
||||
|
||||
cancel_button.Click += delegate {
|
||||
Dispatcher.Invoke ((Action) delegate {
|
||||
SparkleUI.StatusIcon.Dispose ();
|
||||
Controller.SetupPageCancelled ();
|
||||
});
|
||||
};
|
||||
|
||||
continue_button.Click += delegate {
|
||||
Controller.SetupPageCompleted (name_box.Text, email_box.Text);
|
||||
};
|
||||
|
@ -371,13 +384,25 @@ namespace SparkleShare {
|
|||
|
||||
// TODO: Bullet points
|
||||
|
||||
Button try_again_button = new Button () {
|
||||
Content = "Try again…"
|
||||
|
||||
Button cancel_button = new Button () {
|
||||
Content = "Cancel"
|
||||
};
|
||||
|
||||
Buttons.Add (try_again_button);
|
||||
Button try_again_button = new Button () {
|
||||
Content = "Try again…"
|
||||
};
|
||||
|
||||
try_again_button.Click += delegate {
|
||||
|
||||
Buttons.Add (try_again_button);
|
||||
Buttons.Add (cancel_button);
|
||||
|
||||
|
||||
cancel_button.Click += delegate {
|
||||
Controller.PageCancelled ();
|
||||
};
|
||||
|
||||
try_again_button.Click += delegate {
|
||||
Controller.ErrorPageCompleted ();
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
@ -213,7 +212,7 @@ namespace SparkleShare {
|
|||
|
||||
this.exit_item.Click += delegate {
|
||||
this.notify_icon.Dispose ();
|
||||
Program.Controller.Quit ();
|
||||
Controller.QuitClicked ();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue