diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index 3d5f55da..afd19580 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -125,7 +125,7 @@ namespace SparkleLib { // Add everything that changed - // since SparkleShare was stopped TODO: Push if there are changes + // since SparkleShare was stopped AddCommitAndPush (); SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Idling..."); @@ -427,8 +427,18 @@ namespace SparkleLib { } + public void Stop () + { + + FetchTimer.Stop (); + BufferTimer.Stop (); + + } + + // Ignores repos, dotfiles, swap files and the like. - private bool ShouldIgnore (string file_name) { + private bool ShouldIgnore (string file_name) + { if (file_name [0].Equals (".") || file_name.Contains (".lock") || diff --git a/SparkleShare/SparkleIntro.cs b/SparkleShare/SparkleIntro.cs index 53668bd5..f5b72f0c 100644 --- a/SparkleShare/SparkleIntro.cs +++ b/SparkleShare/SparkleIntro.cs @@ -359,6 +359,7 @@ namespace SparkleShare { name += ".git"; string canonical_name = System.IO.Path.GetFileNameWithoutExtension (name); + FolderEntry.Text = canonical_name; string url = server + "/" + name; string tmp_folder = SparkleHelpers.CombineMore (SparklePaths.SparkleTmpPath, @@ -553,7 +554,7 @@ namespace SparkleShare { }; Label header = new Label ("" + - _("Folder successfully retrieved!") + + _("Folder synced successfully!") + "") { UseMarkup = true, Xalign = 0 @@ -619,7 +620,7 @@ namespace SparkleShare { }; Label header = new Label ("" + - String.Format (_("Retrieving folder ‘{0}’…"), FolderEntry.Text) + + String.Format (_("Syncing folder ‘{0}’…"), FolderEntry.Text) + "") { UseMarkup = true, Xalign = 0, diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index ec5e6b76..920a219a 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -69,7 +69,6 @@ namespace SparkleShare { // Watch the SparkleShare folder and update the repo list // when a deletion occurs. - FileSystemWatcher watcher = new FileSystemWatcher (SparklePaths.SparklePath) { IncludeSubdirectories = false, EnableRaisingEvents = true, @@ -77,7 +76,18 @@ namespace SparkleShare { }; watcher.Deleted += delegate { + + foreach (SparkleRepo repo in Repositories) + repo.Stop (); + Application.Invoke (delegate { UpdateRepositories (); } ); + + }; + + watcher.Created += delegate { + + Application.Invoke (delegate {UpdateRepositories (); } ); + };