diff --git a/SparkleShare/Mac/SparkleController.cs b/SparkleShare/Mac/SparkleController.cs index f2be6dcf..d0fb3cb2 100755 --- a/SparkleShare/Mac/SparkleController.cs +++ b/SparkleShare/Mac/SparkleController.cs @@ -44,8 +44,8 @@ namespace SparkleShare { string content_path = Directory.GetParent (System.AppDomain.CurrentDomain.BaseDirectory).ToString (); - string app_path = Directory.GetParent (content_path).ToString (); - string growl_path = Path.Combine (app_path, "Frameworks", "Growl.framework", "Growl"); + string app_path = Directory.GetParent (content_path).ToString (); + string growl_path = Path.Combine (app_path, "Frameworks", "Growl.framework", "Growl"); // Needed for Growl diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index c46f53fd..a12d2c52 100755 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -134,7 +134,8 @@ namespace SparkleShare { this.progress_indicator = new NSProgressIndicator () { Style = NSProgressIndicatorStyle.Spinning, - Frame = new RectangleF (this.web_view.Frame.Width / 2 - 10, this.web_view.Frame.Height / 2 + 10, 20, 20) + Frame = new RectangleF (this.web_view.Frame.Width / 2 - 10, + this.web_view.Frame.Height / 2 + 10, 20, 20) }; this.progress_indicator.StartAnimation (this); @@ -226,15 +227,24 @@ namespace SparkleShare { html = html.Replace ("", "#0085cf"); html = html.Replace ("", "#009ff8"); html = html.Replace ("", - "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "avatar-default.png")); + "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, + "Pixmaps","avatar-default.png")); + html = html.Replace ("", - "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-added-12.png")); + "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, + "Pixmaps", "document-added-12.png")); + html = html.Replace ("", - "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-deleted-12.png")); + "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, + "Pixmaps", "document-deleted-12.png")); + html = html.Replace ("", - "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-edited-12.png")); + "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, + "Pixmaps", "document-edited-12.png")); + html = html.Replace ("", - "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "document-moved-12.png")); + "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, + "Pixmaps", "document-moved-12.png")); InvokeOnMainThread (delegate { if (this.progress_indicator.Superview == ContentView) diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index 84dd435a..f0bd3e05 100755 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -297,8 +297,8 @@ namespace SparkleShare { if (DateTime.Compare (existing_set.Timestamp, change_set.Timestamp) < 1) { existing_set.FirstTimestamp = existing_set.Timestamp; - existing_set.Timestamp = change_set.Timestamp; - existing_set.Revision = change_set.Revision; + existing_set.Timestamp = change_set.Timestamp; + existing_set.Revision = change_set.Revision; } else { existing_set.FirstTimestamp = change_set.Timestamp; @@ -345,37 +345,40 @@ namespace SparkleShare { } else { if (change_set.Edited.Count > 0) { foreach (string file_path in change_set.Edited) { - string absolute_file_path = new string [] {SparkleConfig.DefaultConfig.FoldersPath, - change_set.Folder, file_path}.Combine (); - - if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; - else - event_entry += "
" + file_path + "
"; + event_entry += "
"; + + event_entry += FormatBreadCrumbs ( + Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder), + file_path + ); + + event_entry += "
"; } } if (change_set.Added.Count > 0) { foreach (string file_path in change_set.Added) { - string absolute_file_path = new string [] {SparkleConfig.DefaultConfig.FoldersPath, - change_set.Folder, file_path}.Combine (); - - if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; - else - event_entry += "
" + file_path + "
"; + event_entry += "
"; + + event_entry += FormatBreadCrumbs ( + Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder), + file_path + ); + + event_entry += "
"; } } if (change_set.Deleted.Count > 0) { foreach (string file_path in change_set.Deleted) { - string absolute_file_path = new string [] {SparkleConfig.DefaultConfig.FoldersPath, - change_set.Folder, file_path}.Combine (); - - if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; - else - event_entry += "
" + file_path + "
"; + event_entry += "
"; + + event_entry += FormatBreadCrumbs ( + Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder), + file_path + ); + + event_entry += "
"; } } @@ -384,21 +387,19 @@ namespace SparkleShare { foreach (string file_path in change_set.MovedFrom) { string to_file_path = change_set.MovedTo [i]; - string absolute_file_path = new string [] {SparkleConfig.DefaultConfig.FoldersPath, - change_set.Folder, file_path}.Combine (); + event_entry += "
"; + event_entry += FormatBreadCrumbs ( + Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder), + file_path + ); - string absolute_to_file_path = new string [] {SparkleConfig.DefaultConfig.FoldersPath, - change_set.Folder, to_file_path}.Combine (); + event_entry += "
"; + event_entry += FormatBreadCrumbs ( + Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder), + to_file_path + ); - if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; - else - event_entry += "
" + file_path + "
"; - - if (File.Exists (absolute_to_file_path)) - event_entry += "" + to_file_path + "
"; - else - event_entry += to_file_path + ""; + event_entry += ""; i++; } @@ -1146,6 +1147,45 @@ namespace SparkleShare { Byte[] encoded_bytes = md5.ComputeHash (bytes); return BitConverter.ToString (encoded_bytes).ToLower ().Replace ("-", ""); } + + + private string FormatBreadCrumbs (string path_root, string path) + { + string link = ""; + string [] crumbs = path.Split (Path.DirectorySeparatorChar); + + int i = 0; + string new_path_root = path_root; + bool previous_was_folder = false; + foreach (string crumb in crumbs) { + + if (string.IsNullOrEmpty (crumb)) + continue; + + string crumb_path = Path.Combine (new_path_root, crumb); + + if (Directory.Exists (crumb_path)) { + link += "" + crumb + Path.DirectorySeparatorChar + ""; + previous_was_folder = true; + + } else if (File.Exists (crumb_path)) { + link += "" + crumb + ""; + previous_was_folder = false; + + } else { + if (i > 0 && !previous_was_folder) + link += Path.DirectorySeparatorChar; + + link += crumb; + previous_was_folder = false; + } + + new_path_root = Path.Combine (new_path_root, crumb); + i++; + } + + return link; + } } diff --git a/data/html/event-log.html b/data/html/event-log.html index 50f0cdc9..484cc240 100755 --- a/data/html/event-log.html +++ b/data/html/event-log.html @@ -139,6 +139,7 @@ a:hover { color: ; + text-decoration: underline; } .event-timestamp {