From 29ff2335f8778abc7f3b27283095c77a11f1fd2d Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 24 Feb 2012 21:58:39 +0100 Subject: [PATCH] setup: Add UI for '[X] Add SparkleShare to startup items' on Linux --- SparkleShare/SparkleSetup.cs | 8 +++++++- SparkleShare/SparkleSetupWindow.cs | 23 ++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/SparkleShare/SparkleSetup.cs b/SparkleShare/SparkleSetup.cs index 6f31c200..29578ac2 100755 --- a/SparkleShare/SparkleSetup.cs +++ b/SparkleShare/SparkleSetup.cs @@ -623,9 +623,15 @@ namespace SparkleShare { Controller.FinishPageCompleted (); }; - // TODO: Add startup item checkbox here + + check_button = new CheckButton ("Add SparkleShare to startup items"); + + check_button.Toggled += delegate { + Controller.StartupItemChanged (check_button.Active); + }; Add (slide); + AddOption (check_button); AddButton (finish_button); break; diff --git a/SparkleShare/SparkleSetupWindow.cs b/SparkleShare/SparkleSetupWindow.cs index 1f13927f..1f4f347b 100755 --- a/SparkleShare/SparkleSetupWindow.cs +++ b/SparkleShare/SparkleSetupWindow.cs @@ -29,9 +29,11 @@ namespace SparkleShare { public class SparkleSetupWindow : Window { + // TODO: caps private HBox HBox; private VBox VBox; private VBox Wrapper; + private VBox OptionArea; private HButtonBox Buttons; public string Header; @@ -72,10 +74,22 @@ namespace SparkleShare { BorderWidth = 0 }; + OptionArea = new VBox (false, 0) { + BorderWidth = 0 + }; + Buttons = CreateButtonBox (); + + HBox layout_horizontal = new HBox (false , 0) { + BorderWidth = 0 + }; + + layout_horizontal.PackStart (OptionArea, true, true, 0); + layout_horizontal.PackStart (Buttons, false, false, 0); + VBox.PackStart (Wrapper, true, true, 0); - VBox.PackStart (Buttons, false, false, 15); + VBox.PackStart (layout_horizontal, false, false, 15); EventBox box = new EventBox (); Gdk.Color bg_color = new Gdk.Color (); @@ -111,6 +125,13 @@ namespace SparkleShare { } + public void AddOption (Widget widget) + { + OptionArea.Add (widget); + ShowAll (); + } + + new public void Add (Widget widget) { Label header = new Label ("" + Header + "") {