Fix crash where SparkeDialog is destroyed too early.

This commit is contained in:
Hylke Bons 2010-05-27 10:51:10 +02:00
parent 8a8a537af6
commit 920029e627
2 changed files with 13 additions and 12 deletions

View file

@ -47,7 +47,6 @@ namespace SparkleShare {
VBox VBox = new VBox (false, 0); VBox VBox = new VBox (false, 0);
Label RemoteUrlLabel = new Label (_("Address: ")); Label RemoteUrlLabel = new Label (_("Address: "));
RemoteUrlCombo = new ComboBoxEntry (); RemoteUrlCombo = new ComboBoxEntry ();
@ -55,9 +54,6 @@ namespace SparkleShare {
ListStore Defaults = new ListStore (typeof (string), ListStore Defaults = new ListStore (typeof (string),
typeof (Gdk.Pixbuf)); typeof (Gdk.Pixbuf));
RemoteUrlCombo.Entry.Completion = new EntryCompletion (); RemoteUrlCombo.Entry.Completion = new EntryCompletion ();
CellRendererPixbuf CellRendererPixbuf = new CellRendererPixbuf (); CellRendererPixbuf CellRendererPixbuf = new CellRendererPixbuf ();
@ -123,8 +119,6 @@ namespace SparkleShare {
public void CloneRepo (object o, EventArgs args) { public void CloneRepo (object o, EventArgs args) {
Destroy ();
string RepoRemoteUrl = RemoteUrlCombo.Entry.Text; string RepoRemoteUrl = RemoteUrlCombo.Entry.Text;
string RepoName = string RepoName =
RepoRemoteUrl.Substring (RepoRemoteUrl.LastIndexOf ("/") + 1); RepoRemoteUrl.Substring (RepoRemoteUrl.LastIndexOf ("/") + 1);
@ -140,11 +134,16 @@ namespace SparkleShare {
Process.StartInfo.Arguments += Process.StartInfo.Arguments +=
SparkleHelpers.CombineMore (RepoRemoteUrl, RepoName).Substring (2); 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 (); 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 // Move the folder to the SparkleShare folder when done cloning
Process.Exited += delegate { Process.Exited += delegate {
@ -154,7 +153,7 @@ namespace SparkleShare {
SparkleHelpers.CombineMore (SparklePaths.SparklePath, SparkleHelpers.CombineMore (SparklePaths.SparklePath,
RepoName) RepoName)
); );
SparkleBubble = SparkleBubble =
new SparkleBubble ("Successfully added the folder" + new SparkleBubble ("Successfully added the folder" +
" " + RepoName + "", " " + RepoName + "",
@ -163,11 +162,13 @@ namespace SparkleShare {
SparkleBubble.AddAction ("", "Open Folder", SparkleBubble.AddAction ("", "Open Folder",
delegate { delegate {
Process.StartInfo.FileName = "xdg-open"; Process.StartInfo.FileName = "xdg-open";
Process.StartInfo.Arguments = Process.StartInfo.Arguments =
SparkleHelpers.CombineMore ( SparkleHelpers.CombineMore (
SparklePaths.SparklePath, RepoName); SparklePaths.SparklePath, RepoName);
Process.Start(); Process.Start();
} ); } );
Destroy ();
}; };

View file

@ -100,7 +100,7 @@ namespace SparkleShare {
} }
public static bool IsGitUrl (string Url) { public static bool IsGitUrl (string Url) {
return Regex.Match (Url, @"[a-z]+://(.)+").Success; return Regex.Match (Url, @"[a-z]+://(.)+/(.)+").Success;
} }
} }