diff --git a/SparkleShare/SparkleDialog.cs b/SparkleShare/SparkleDialog.cs index 651ad64b..8d7de4df 100644 --- a/SparkleShare/SparkleDialog.cs +++ b/SparkleShare/SparkleDialog.cs @@ -119,6 +119,7 @@ namespace SparkleShare { else RepoName = RepoRemoteUrl.Substring (ColumnPos + 1); + SparkleBubble SyncingBubble = new SparkleBubble (_("Syncing folder ‘") + RepoName + "’", _("SparkleShare will notify you ") + @@ -179,12 +180,20 @@ namespace SparkleShare { } else { - Directory.Move ( + string OldPath = SparkleHelpers.CombineMore (SparklePaths.SparkleTmpPath, - RepoName), + RepoName); + + string NewPath = SparkleHelpers.CombineMore (SparklePaths.SparklePath, - RepoName) - ); + RepoName); + + if (Directory.Exists (NewPath)) + NewPath += " (2)"; + + // Move the cloned repository from the temporary + // folder to the SparkleShare folder + Directory.Move (OldPath, NewPath); Console.WriteLine ("[Git][" + RepoName + "] Repository cloned"); @@ -201,8 +210,8 @@ namespace SparkleShare { SparkleHelpers.CombineMore ( SparklePaths.SparklePath, RepoName); Process.Start (); - } - ); + } ); + FinishedBubble.Show (); // Destroy the Add dialog diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 6df38b6d..f70d5f40 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -140,7 +140,6 @@ namespace SparkleShare { QuitItem.Activated += delegate { Environment.Exit (0); }; Menu.Add (QuitItem); Menu.ShowAll (); - // TODO: Make sure the menu never overlaps the status icon Menu.Popup (null, null, SetPosition, 0, 0); } @@ -200,10 +199,11 @@ namespace SparkleShare { } // TODO: menu should not dissappear on mouse up - public void SetPosition (Menu menu, - out int x, out int y, - out bool push_in) { + public void SetPosition + (Menu menu, out int x, out int y, out bool push_in) { + PositionMenu (menu, out x, out y, out push_in, Handle); + } // Quits the program