From 17cc6230275dbefa24c3d8df3c8a4c899dfd126f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 17 Feb 2012 01:26:27 +0100 Subject: [PATCH] invites: fix some potential edge cases --- SparkleShare/Mac/SparkleSetupWindow.cs | 3 +++ SparkleShare/Mac/SparkleUI.cs | 5 ++--- SparkleShare/SparkleSetupController.cs | 15 ++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/SparkleShare/Mac/SparkleSetupWindow.cs b/SparkleShare/Mac/SparkleSetupWindow.cs index 7bdb249a..dbd194a2 100755 --- a/SparkleShare/Mac/SparkleSetupWindow.cs +++ b/SparkleShare/Mac/SparkleSetupWindow.cs @@ -137,6 +137,9 @@ namespace SparkleShare { NSApplication.SharedApplication.AddWindowsItem (this, "SparkleShare Setup", false); NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); MakeKeyAndOrderFront (this); + + if (Program.UI != null) + Program.UI.UpdateDockIconVisibility (); base.OrderFrontRegardless (); } diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index 0c268f2f..54b4d194 100755 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -68,10 +68,9 @@ namespace SparkleShare { Setup = new SparkleSetup (); // About = new SparkleAbout (); - if (Program.Controller.FirstRun) { + if (Program.Controller.FirstRun) Program.Controller.ShowSetupWindow (PageType.Setup); - UpdateDockIconVisibility (); - } + } } diff --git a/SparkleShare/SparkleSetupController.cs b/SparkleShare/SparkleSetupController.cs index 446a7c51..17249986 100755 --- a/SparkleShare/SparkleSetupController.cs +++ b/SparkleShare/SparkleSetupController.cs @@ -76,6 +76,7 @@ namespace SparkleShare { public string PreviousAddress { get; private set; } public string PreviousPath { get; private set; } public string SyncingFolder { get; private set; } + public SparkleInvite PendingInvite; public int SelectedPluginIndex { @@ -140,6 +141,13 @@ namespace SparkleShare { Program.Controller.ShowSetupWindowEvent += delegate (PageType page_type) { + if (PendingInvite != null) { + if (ShowWindowEvent != null) + ShowWindowEvent (); + + return; + } + if (ChangePageEvent != null) ChangePageEvent (page_type, null); @@ -154,7 +162,7 @@ namespace SparkleShare { public void PageCancelled () { - // PendingInvite = null; + PendingInvite = null; if (HideWindowEvent != null) HideWindowEvent (); @@ -299,14 +307,11 @@ namespace SparkleShare { } - // TODO: trailing slash should work - public SparkleInvite PendingInvite = new SparkleInvite ("ssh://git@github.com/", - "/hbons/Stuff", "http://www.sparkleshare.org/"); - public void InvitePageCompleted () { SyncingFolder = Path.GetFileNameWithoutExtension (PendingInvite.RemotePath); PreviousAddress = PendingInvite.Address; + // TODO: trailing slash should work PreviousPath = PendingInvite.RemotePath; if (ChangePageEvent != null)