diff --git a/AUTHORS b/AUTHORS index 230a6c16..691d6dbe 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,6 +5,7 @@ Maintainer: Contributors: Andreas Nilsson + Benjamin Podszun Bertrand Lorentz Garrett LeSage Jakub Steiner diff --git a/SparkleShare/SparkleDialog.cs b/SparkleShare/SparkleDialog.cs index ffb8f724..eb55eb03 100644 --- a/SparkleShare/SparkleDialog.cs +++ b/SparkleShare/SparkleDialog.cs @@ -115,24 +115,6 @@ namespace SparkleShare { int SlashPos = RepoRemoteUrl.LastIndexOf ("/"); int ColumnPos = RepoRemoteUrl.LastIndexOf (":"); - // Check whether a "/" or ":" is used to separate the - // repo name from the domain. - string RepoName; - if (SlashPos > ColumnPos) - RepoName = RepoRemoteUrl.Substring (SlashPos + 1); - else - RepoName = RepoRemoteUrl.Substring (ColumnPos + 1); - - SparkleBubble SyncingBubble; - SyncingBubble = new SparkleBubble (String.Format(_("Syncing folder ‘{0}’"), RepoName), - _("SparkleShare will notify you when this is done.")); - - SyncingBubble.AddAction ("", _("Dismiss"), - delegate { - SyncingBubble.Close (); - }); - - SyncingBubble.Show (); Process Process = new Process (); Process.EnableRaisingEvents = true; @@ -154,23 +136,13 @@ namespace SparkleShare { if (Process.ExitCode != 0) { - SparkleBubble ErrorBubble; - ErrorBubble = new SparkleBubble (String.Format(_("Something went wrong while syncing ‘{0}’"), RepoName), - "Please double check the address and\n" + - "network connection."); + // error try { Directory.Delete (SparkleHelpers.CombineMore (SparklePaths.SparkleTmpPath, RepoName)); } catch (System.IO.DirectoryNotFoundException) { SparkleHelpers.DebugInfo ("Config", "[" + RepoName + "] Temporary directory did not exist..."); } - - ErrorBubble.AddAction ("", _("Try Again…"), - delegate { - SparkleDialog SparkleDialog = new SparkleDialog (RepoRemoteUrl); - SparkleDialog.ShowAll (); - }); - ErrorBubble.Show (); } else { @@ -188,6 +160,8 @@ namespace SparkleShare { Writer.WriteLine (".DS_store"); // Ignore OSX's invisible directories Writer.Close (); + // TODO: Install username and email from global file + File.Create (SparkleHelpers.CombineMore (SparklePaths.SparklePath, RepoName, ".emblems")); diff --git a/SparkleShare/SparkleIntro.cs b/SparkleShare/SparkleIntro.cs index d9570d1e..9beca187 100644 --- a/SparkleShare/SparkleIntro.cs +++ b/SparkleShare/SparkleIntro.cs @@ -303,6 +303,8 @@ namespace SparkleShare { AddButton.Clicked += delegate { + ShowStepTwoAndAHalf (); + // TODO }; @@ -331,13 +333,106 @@ namespace SparkleShare { Add (layout_horizontal); - CheckStepOneFields (); + CheckStepTwoFields (); ShowAll (); } + private void ShowStepTwoAndAHalf () + { + + Title = _("Add Remote Folder"); + + Remove (Child); + + HBox layout_horizontal = new HBox (false, 6); + + Image side_splash = new Image (SparkleHelpers.CombineMore (Defines.PREFIX, "share", "pixmaps", + "side-splash.png")); + + VBox wrapper = new VBox (false, 0); + + VBox layout_vertical = new VBox (false, 0) { + BorderWidth = 30 + }; + + Label introduction = new Label ("" + + String.Format (_("Retrieving folder ‘{0}’…"), FolderEntry.Text) + + "") { + UseMarkup = true, + Xalign = 0 + }; + + Label information = new Label ("" + + _("This may take a while.\n") + + _("You sure it’s not coffee o-clock?" + + "")) { + UseMarkup = true, + Xalign = 0 + }; + + HButtonBox controls = new HButtonBox () { + BorderWidth = 12, + Layout = ButtonBoxStyle.End, + Spacing = 6 + }; + + Button button = new Button ("") { + Sensitive = false + }; + + if (StepTwoOnly) { + + button.Label = _("Finish"); + button.Clicked += delegate { + Destroy (); + }; + + } else { + + button.Label = _("Next"); + button.Clicked += delegate { + ShowStepThree (); + }; + + } + + controls.Add (button); + + SparkleSpinner spinner = new SparkleSpinner (22); + + Table table = new Table (2, 2, false) { + RowSpacing = 12, + ColumnSpacing = 9 + }; + + HBox box = new HBox (false, 0); + + table.Attach (spinner, 0, 1, 0, 1); + table.Attach (introduction, 1, 2, 0, 1); + table.Attach (information, 1, 2, 1, 2); + + box.PackStart (table, false, false, 0); + + layout_vertical.PackStart (box, false, false, 0); + + wrapper.PackStart (layout_vertical, true, true, 0); + wrapper.PackStart (controls, false, true, 0); + + layout_horizontal.PackStart (side_splash, false, false, 0); + layout_horizontal.PackStart (wrapper, true, true, 0); + + Add (layout_horizontal); + + CheckStepTwoFields (); + + ShowAll (); + + } + + private void ShowStepThree () { diff --git a/SparkleShare/SparkleRepo.cs b/SparkleShare/SparkleRepo.cs index a9fd266b..8c7e878f 100644 --- a/SparkleShare/SparkleRepo.cs +++ b/SparkleShare/SparkleRepo.cs @@ -66,6 +66,8 @@ namespace SparkleShare { public SparkleRepo (string path) { +// if (Directory.Exists) + LocalPath = path; Name = Path.GetFileName (LocalPath); @@ -130,6 +132,14 @@ namespace SparkleShare { } + public void Init () + { + + + + } + + private void CheckForChanges () { diff --git a/SparkleShare/SparkleSpinner.cs b/SparkleShare/SparkleSpinner.cs index de5ee338..b4ec4389 100644 --- a/SparkleShare/SparkleSpinner.cs +++ b/SparkleShare/SparkleSpinner.cs @@ -15,7 +15,6 @@ // along with this program. If not, see . using Gtk; -using System; using System.Timers; namespace SparkleShare { @@ -38,31 +37,42 @@ namespace SparkleShare { Size = size; - CycleDuration = 750; + CycleDuration = 600; CurrentStep = 0; Gdk.Pixbuf spinner_gallery = SparkleHelpers.GetIcon ("process-working", Size); - int frames_in_width = spinner_gallery.Width / Size; + int frames_in_width = spinner_gallery.Width / Size; int frames_in_height = spinner_gallery.Height / Size; + NumSteps = frames_in_width * frames_in_height; - Images = new Gdk.Pixbuf [NumSteps - 1]; + Images = new Gdk.Pixbuf [NumSteps - 1]; int i = 0; + for (int y = 0; y < frames_in_height; y++) { + for (int x = 0; x < frames_in_width; x++) { + if (!(y == 0 && x == 0)) { + Images [i] = new Gdk.Pixbuf (spinner_gallery, x * Size, y * Size, Size, Size); i++; + } + } + } - Timer = new Timer (); - Timer.Interval = CycleDuration / NumSteps; + Timer = new Timer () { + Interval = CycleDuration / NumSteps + }; + Timer.Elapsed += delegate { NextImage (); }; + Start (); } @@ -82,27 +92,32 @@ namespace SparkleShare { private void SetImage () { - Console.WriteLine (CurrentStep); Pixbuf = Images [CurrentStep]; } public bool IsActive () { + return Active; + } public void Start () { + CurrentStep = 0; Active = true; Timer.Start (); + } public void Stop () { + Active = false; Timer.Stop (); + } } diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 1f78d471..4907c766 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -4,6 +4,7 @@ hicolordir = $(DESTDIR)$(datadir)/icons/hicolor theme_icons = \ animations,process-syncing-sparkleshare-24.png \ + animations,process-working-22.png \ places,folder-16.png \ places,folder-22.png \ places,folder-24.png \ diff --git a/data/icons/process-working-22.png b/data/icons/process-working-22.png new file mode 100644 index 00000000..9005de75 Binary files /dev/null and b/data/icons/process-working-22.png differ