diff --git a/SparkleShare/SparkleSetup.cs b/SparkleShare/SparkleSetup.cs index 5084f75d..a35e7b02 100644 --- a/SparkleShare/SparkleSetup.cs +++ b/SparkleShare/SparkleSetup.cs @@ -425,6 +425,104 @@ namespace SparkleShare { AddButton (open_folder_button); AddButton (finish_button); + break; + } + + + case PageType.Tutorial: { + + switch (Controller.TutorialPageNumber) { + case 1: { + Header = _("What's next?"); + Description = _(@"SparkleShare creates a special folder on your computer + that will keep track of your projects."); + + Button skip_tutorial_button = new Button (_("Skip Tutorial")); + skip_tutorial_button.Clicked += delegate { + // Controller.TutorialSkipped (); + }; + + Button continue_button = new Button (_("Continue")); + continue_button.Clicked += delegate { + Controller.TutorialPageCompleted (); + }; + + // Add (null); TODO image Controller.TutorialPageNumber + AddButton (skip_tutorial_button); + AddButton (continue_button); + + break; + } + + case 2: { + Header = _("Adding files"); + Description = _(@"All files added to your project folders are synced with the host + automatically, as well as with all of your collaborators."); + + Button continue_button = new Button (_("Continue")); + continue_button.Clicked += delegate { + Controller.TutorialPageCompleted (); + }; + + // Add (null); TODO image Controller.TutorialPageNumber + AddButton (continue_button); + + break; + } + + case 3: { + Header = _("The status icon"); + Description = _(@"All files added to your project folders are synced with the host + automatically, as well as with all of your collaborators."); + + Button continue_button = new Button (_("Continue")); + continue_button.Clicked += delegate { + Controller.TutorialPageCompleted (); + }; + + // Add (null); TODO image Controller.TutorialPageNumber + AddButton (continue_button); + + break; + } + + case 4: { + Header = _("Adding Projects"); + Description = _(@"Whenever you see this button on a website, just click it, + and the project will be immediately added to SparkleShare:"); + + Button continue_button = new Button (_("Continue")); + continue_button.Clicked += delegate { + Controller.TutorialPageCompleted (); + }; + + + Label label = new Label (_(@"…or click the status icon and select Add Project… + to manually add a project.")); + // Add (null); TODO image Controller.TutorialPageNumber + + + Button add_project_button = new Button (_("Add Project…")); + add_project_button.Clicked += delegate { + Controller.TutorialPageCompleted (); + }; + + Button finish_button = new Button (_("Finish")); + finish_button.Clicked += delegate { + Close (); + }; + + AddButton (add_project_button); + AddButton (finish_button); + + break; + } + } + + + + + break; } } diff --git a/SparkleShare/SparkleSetupController.cs b/SparkleShare/SparkleSetupController.cs index 5b19d896..e4c75da7 100644 --- a/SparkleShare/SparkleSetupController.cs +++ b/SparkleShare/SparkleSetupController.cs @@ -25,7 +25,8 @@ namespace SparkleShare { Add, Syncing, Error, - Finished + Finished, + Tutorial } @@ -37,6 +38,13 @@ namespace SparkleShare { public event UpdateProgressBarEventHandler UpdateProgressBarEvent; public delegate void UpdateProgressBarEventHandler (double percentage); + + public int TutorialPageNumber { + get { + return this.tutorial_page_number; + } + } + public string PreviousUrl { get { return this.previous_url; @@ -67,12 +75,15 @@ namespace SparkleShare { } } - private string previous_server = ""; - private string previous_folder = ""; - private string previous_url = ""; - private string syncing_folder = ""; + + private string previous_server = ""; + private string previous_folder = ""; + private string previous_url = ""; + private string syncing_folder = ""; + private int tutorial_page_number = 1; private PageType previous_page; + public SparkleSetupController () { ChangePageEvent += delegate (PageType page) { @@ -104,7 +115,32 @@ namespace SparkleShare { Program.Controller.UpdateState (); if (ChangePageEvent != null) - ChangePageEvent (PageType.Add); + ChangePageEvent (PageType.Tutorial); + } + + + public void TutorialPageCompleted () + { + if (this.tutorial_page_number == 4) { + if (ChangePageEvent != null) + ChangePageEvent (PageType.Add); + + } else { + this.tutorial_page_number++; + } + + + if (ChangePageEvent != null) + ChangePageEvent (PageType.Tutorial); + } + + + public void TutorialSkipped () + { + this.tutorial_page_number = 4; + + if (ChangePageEvent != null) + ChangePageEvent (PageType.Tutorial); }