From eeb52d39792733a463dd67bb2de570ccd78e9d6e Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 7 Mar 2012 02:40:21 +0000 Subject: [PATCH] setup: Add cancel buttons to Linux and Mac too --- SparkleShare/Linux/SparkleSetup.cs | 17 +++++++++++++++-- SparkleShare/Linux/SparkleStatusIcon.cs | 2 +- SparkleShare/Mac/SparkleSetup.cs | 19 +++++++++++++++++++ SparkleShare/Mac/SparkleStatusIcon.cs | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/SparkleShare/Linux/SparkleSetup.cs b/SparkleShare/Linux/SparkleSetup.cs index a8a072b9..21bf1c36 100755 --- a/SparkleShare/Linux/SparkleSetup.cs +++ b/SparkleShare/Linux/SparkleSetup.cs @@ -106,7 +106,13 @@ namespace SparkleShare { VBox wrapper = new VBox (false, 9); wrapper.PackStart (table, true, false, 0); + + Button cancel_button = new Button (_("Cancel")); + cancel_button.Clicked += delegate { + Controller.SetupPageCancelled (); + }; + Button continue_button = new Button (_("Continue")) { Sensitive = false }; @@ -117,7 +123,8 @@ namespace SparkleShare { Controller.SetupPageCompleted (full_name, email); }; - + + AddButton (cancel_button); AddButton (continue_button); Add (wrapper); @@ -472,7 +479,12 @@ namespace SparkleShare { points.PackStart (new Label (""), true, true, 0); + Button cancel_button = new Button (_("Cancel")); + cancel_button.Clicked += delegate { + Controller.PageCancelled (); + }; + Button try_again_button = new Button (_("Try Again…")) { Sensitive = true }; @@ -480,7 +492,8 @@ namespace SparkleShare { try_again_button.Clicked += delegate { Controller.ErrorPageCompleted (); }; - + + AddButton (cancel_button); AddButton (try_again_button); Add (points); diff --git a/SparkleShare/Linux/SparkleStatusIcon.cs b/SparkleShare/Linux/SparkleStatusIcon.cs index b69c36e3..3e3e2659 100644 --- a/SparkleShare/Linux/SparkleStatusIcon.cs +++ b/SparkleShare/Linux/SparkleStatusIcon.cs @@ -298,7 +298,7 @@ namespace SparkleShare { }; this.quit_item.Activated += delegate { - Program.Controller.Quit (); + Controller.QuitClicked (); }; this.menu.Add (this.quit_item); diff --git a/SparkleShare/Mac/SparkleSetup.cs b/SparkleShare/Mac/SparkleSetup.cs index cdc028b3..1782539f 100755 --- a/SparkleShare/Mac/SparkleSetup.cs +++ b/SparkleShare/Mac/SparkleSetup.cs @@ -150,6 +150,15 @@ namespace SparkleShare { Controller.SetupPageCompleted (full_name, email); }; + + CancelButton = new NSButton () { + Title = "Cancel" + }; + + CancelButton.Activated += delegate { + Controller.SetupPageCancelled (); + }; + Controller.UpdateSetupContinueButtonEvent += delegate (bool button_enabled) { InvokeOnMainThread (delegate { @@ -164,6 +173,7 @@ namespace SparkleShare { ContentView.AddSubview (EmailTextField); Buttons.Add (ContinueButton); + Buttons.Add (CancelButton); Controller.CheckSetupPage ( FullNameTextField.StringValue, @@ -553,8 +563,17 @@ namespace SparkleShare { TryAgainButton.Activated += delegate { Controller.ErrorPageCompleted (); }; + + CancelButton = new NSButton () { + Title = "Cancel" + }; + + CancelButton.Activated += delegate { + Controller.PageCancelled (); + }; Buttons.Add (TryAgainButton); + Buttons.Add (CancelButton); break; } diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 23a7b124..fb51f541 100755 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -302,7 +302,7 @@ namespace SparkleShare { }; QuitMenuItem.Activated += delegate { - Program.Controller.Quit (); + Controller.QuitClicked (); }; Menu.AddItem (QuitMenuItem);