diff --git a/SparkleShare/SparklePaths.cs b/SparkleShare/SparklePaths.cs index 1c3c59a2..b8d78474 100644 --- a/SparkleShare/SparklePaths.cs +++ b/SparkleShare/SparklePaths.cs @@ -21,8 +21,10 @@ using System.IO; namespace SparkleShare { public static class SparklePaths { + private static UnixUserInfo UnixUserInfo = new UnixUserInfo (UnixEnvironment.UserName); + public static string HomePath = UnixUserInfo.HomeDirectory; public static string SparklePath = Path.Combine (HomePath ,"SparkleShare"); diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 7ce78041..84d16b96 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -145,13 +145,15 @@ namespace SparkleShare { } } - - // TODO: When a repo folder is deleted, don't sync and update the UI - + + + // TODO: This crashes +/* + // Watch the SparkleShare folder and pop up the // Add dialog when a new folder is created - // TODO: This crashes -/* FileSystemWatcher Watcher = new FileSystemWatcher (SparklePaths.SparklePath); + + FileSystemWatcher Watcher = new FileSystemWatcher (SparklePaths.SparklePath); Watcher.IncludeSubdirectories = false; Watcher.EnableRaisingEvents = true; Watcher.Created += delegate (object o, FileSystemEventArgs args) { @@ -162,6 +164,16 @@ namespace SparkleShare { SparkleDialog SparkleDialog = new SparkleDialog (); SparkleDialog.ShowAll (); }; + + // When a repo folder is deleted, don't sync and update the UI + Watcher.Deleted += delegate (object o, FileSystemEventArgs args) { + WatcherChangeTypes wct = args.ChangeType; + SparkleHelpers.DebugInfo ("Event", + wct.ToString () + + " '" + args.Name + "'"); + SparkleUI SparkleUI = new SparkleUI (); + SparkleUI.ShowAll (); + }; */ // Create place to store configuration user's home folder