From 920029e627df66ed72d2b554d2178d7997ccb010 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 27 May 2010 10:51:10 +0200 Subject: [PATCH] Fix crash where SparkeDialog is destroyed too early. --- SparkleShare/SparkleDialog.cs | 23 ++++++++++++----------- SparkleShare/SparkleHelpers.cs | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/SparkleShare/SparkleDialog.cs b/SparkleShare/SparkleDialog.cs index d5693713..2d22495d 100644 --- a/SparkleShare/SparkleDialog.cs +++ b/SparkleShare/SparkleDialog.cs @@ -47,7 +47,6 @@ namespace SparkleShare { VBox VBox = new VBox (false, 0); - Label RemoteUrlLabel = new Label (_("Address: ")); RemoteUrlCombo = new ComboBoxEntry (); @@ -55,9 +54,6 @@ namespace SparkleShare { ListStore Defaults = new ListStore (typeof (string), typeof (Gdk.Pixbuf)); - - - RemoteUrlCombo.Entry.Completion = new EntryCompletion (); CellRendererPixbuf CellRendererPixbuf = new CellRendererPixbuf (); @@ -123,8 +119,6 @@ namespace SparkleShare { public void CloneRepo (object o, EventArgs args) { - Destroy (); - string RepoRemoteUrl = RemoteUrlCombo.Entry.Text; string RepoName = RepoRemoteUrl.Substring (RepoRemoteUrl.LastIndexOf ("/") + 1); @@ -140,11 +134,16 @@ namespace SparkleShare { Process.StartInfo.Arguments += SparkleHelpers.CombineMore (RepoRemoteUrl, RepoName).Substring (2); + SparkleBubble SparkleBubble = + new SparkleBubble (_("Syncing ‘") + RepoName + "’", + _("SparkleShare will notify you when this is done.")); + + SparkleBubble.IconName = "folder-sparkleshare"; + + Hide (); + Process.Start (); - SparkleBubble SparkleBubble = - new SparkleBubble ("Downloading ‘" + RepoName + "’", - "You will be notified when this is done"); // Move the folder to the SparkleShare folder when done cloning Process.Exited += delegate { @@ -154,7 +153,7 @@ namespace SparkleShare { SparkleHelpers.CombineMore (SparklePaths.SparklePath, RepoName) ); - + SparkleBubble = new SparkleBubble ("Successfully added the folder" + " ‘" + RepoName + "’", @@ -163,11 +162,13 @@ namespace SparkleShare { SparkleBubble.AddAction ("", "Open Folder", delegate { Process.StartInfo.FileName = "xdg-open"; - Process.StartInfo.Arguments = + Process.StartInfo.Arguments = SparkleHelpers.CombineMore ( SparklePaths.SparklePath, RepoName); Process.Start(); } ); + + Destroy (); }; diff --git a/SparkleShare/SparkleHelpers.cs b/SparkleShare/SparkleHelpers.cs index 47b580e9..f15b92aa 100644 --- a/SparkleShare/SparkleHelpers.cs +++ b/SparkleShare/SparkleHelpers.cs @@ -100,7 +100,7 @@ namespace SparkleShare { } public static bool IsGitUrl (string Url) { - return Regex.Match (Url, @"[a-z]+://(.)+").Success; + return Regex.Match (Url, @"[a-z]+://(.)+/(.)+").Success; } }