rename if a cloned folder already exists

This commit is contained in:
Hylke Bons 2010-06-01 21:33:09 +02:00
parent aa3523c1aa
commit c787940c3c
2 changed files with 19 additions and 10 deletions

View file

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

View file

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