rename if a cloned folder already exists
This commit is contained in:
parent
aa3523c1aa
commit
c787940c3c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue