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);
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 ();
};

View file

@ -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;
}
}