From da0f3d53a5805752298a7c019eb9e2d44175ab33 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 14 Oct 2012 14:21:22 +0100 Subject: [PATCH 01/22] early working version of history recycle logic + mac Save As dialog --- SparkleLib/Git/SparkleRepoGit.cs | 23 ++-- SparkleLib/SparkleRepoBase.cs | 2 +- SparkleLib/SparkleWrappers.cs | 1 + SparkleShare/Common/HTML/event-log.html | 49 ++++++++- SparkleShare/Mac/SparkleEventLog.cs | 24 +++- SparkleShare/SparkleEventLogController.cs | 128 +++++++++++++++++++++- 6 files changed, 214 insertions(+), 13 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index b92e7e89..96caf38d 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -539,7 +539,7 @@ namespace SparkleLib.Git { } - public override void RevertFile (string path, string revision) + public override void RestoreFile (string path, string revision, string target_file_path) { if (path == null) throw new ArgumentNullException ("path"); @@ -614,7 +614,7 @@ namespace SparkleLib.Git { path = path.Replace ("\\", "/"); git = new SparkleGit (LocalPath, "log -" + count + " --raw --find-renames --date=iso " + - "--format=medium --no-color --no-merges -- " + path); + "--format=medium --no-color --no-merges -- \"" + path + "\""); } string output = git.StartAndReadStandardOutput (); @@ -681,13 +681,16 @@ namespace SparkleLib.Git { if (entry_line.StartsWith (":")) { string type_letter = entry_line [37].ToString (); string file_path = entry_line.Substring (39); - - if (file_path.EndsWith (".empty")) - file_path = file_path.Substring (0, file_path.Length - ".empty".Length); + bool change_is_folder = false; if (file_path.Equals (".sparkleshare")) continue; + if (file_path.EndsWith (".empty")) { + file_path = file_path.Substring (0, file_path.Length - ".empty".Length); + change_is_folder = true; + } + file_path = EnsureSpecialCharacters (file_path); file_path = file_path.Replace ("\\\"", "\""); @@ -702,15 +705,20 @@ namespace SparkleLib.Git { file_path = file_path.Replace ("\\\"", "\""); to_file_path = to_file_path.Replace ("\\\"", "\""); - if (file_path.EndsWith (".empty")) + if (file_path.EndsWith (".empty")) { file_path = file_path.Substring (0, file_path.Length - 6); + change_is_folder = true; + } - if (to_file_path.EndsWith (".empty")) + if (to_file_path.EndsWith (".empty")) { to_file_path = to_file_path.Substring (0, to_file_path.Length - 6); + change_is_folder = true; + } change_set.Changes.Add ( new SparkleChange () { Path = file_path, + IsFolder = change_is_folder, MovedToPath = to_file_path, Timestamp = change_set.Timestamp, Type = SparkleChangeType.Moved @@ -730,6 +738,7 @@ namespace SparkleLib.Git { change_set.Changes.Add ( new SparkleChange () { Path = file_path, + IsFolder = change_is_folder, Timestamp = change_set.Timestamp, Type = change_type } diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index f0b26be6..4c0e4ec3 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -56,7 +56,7 @@ namespace SparkleLib { public abstract bool SyncDown (); public abstract List GetChangeSets (int count); public abstract List GetChangeSets (string path, int count); - public abstract void RevertFile (string path, string revision); + public abstract void RestoreFile (string path, string revision, string target_file_path); public event SyncStatusChangedEventHandler SyncStatusChanged = delegate { }; public delegate void SyncStatusChangedEventHandler (SyncStatus new_status); diff --git a/SparkleLib/SparkleWrappers.cs b/SparkleLib/SparkleWrappers.cs index bf60ddcf..6e328ae5 100644 --- a/SparkleLib/SparkleWrappers.cs +++ b/SparkleLib/SparkleWrappers.cs @@ -47,6 +47,7 @@ namespace SparkleLib { public SparkleChangeType Type; public DateTime Timestamp; + public bool IsFolder = false; public string Path; public string MovedToPath; diff --git a/SparkleShare/Common/HTML/event-log.html b/SparkleShare/Common/HTML/event-log.html index 368d5722..0e5bd3ab 100755 --- a/SparkleShare/Common/HTML/event-log.html +++ b/SparkleShare/Common/HTML/event-log.html @@ -76,7 +76,7 @@ cursor: pointer; } - small { + small, small a { font-size: ; color: ; } @@ -152,7 +152,52 @@ .moved { background-image: url(''); - } + } + + table { + padding: 18px 32px; + width: 100%; + } + + td { + padding: 0; + margin: 0; + } + + td.name { + width: 45%; + } + + td.time { + font-size: ; + color: ; + padding-right: 9px; + width: 20px; + padding-top: 2px; + } + + td.date { + font-size: ; + color: ; + text-align: right; + padding-right: 6px; + padding-top: 2px; + } + + td.restore { + text-align: right; + } + + td.avatar { + width: 32px; + } + + td.avatar img { + margin-top: 2px; + border-radius: 3px; + width: 24px; + height: 24px; + } diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index 34cd8b8e..cdf4fe48 100755 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -228,7 +228,7 @@ namespace SparkleShare { }); } }; - + Controller.UpdateSizeInfoEvent += delegate (string size, string history_size) { using (var a = new NSAutoreleasePool ()) { @@ -238,6 +238,27 @@ namespace SparkleShare { }); } }; + + Controller.ShowSaveDialogEvent += delegate (string file_name, string target_folder_path) { + using (var a = new NSAutoreleasePool ()) + { + InvokeOnMainThread (() => { + // TODO: Make this a sheet + NSSavePanel panel = new NSSavePanel () { + DirectoryUrl = new NSUrl (target_folder_path, true), + NameFieldStringValue = file_name, + ParentWindow = this, + Title = "Restore from History", + PreventsApplicationTerminationWhenModal = false + }; + + if ((NSPanelButtonType) panel.RunModal ()== NSPanelButtonType.Ok) + Controller.SaveDialogCompleted ("f"); + else + Controller.SaveDialogCancelled (); + }); + } + }; } @@ -346,6 +367,7 @@ namespace SparkleShare { html = html.Replace ("", "13.4px"); html = html.Replace ("", "#bbb"); html = html.Replace ("", "#ddd"); + html = html.Replace ("", "10px"); html = html.Replace ("", "#f5f5f5"); html = html.Replace ("", "#0085cf"); html = html.Replace ("", "#009ff8"); diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index e6b7d5e7..67540d09 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Text.RegularExpressions; using System.Threading; using SparkleLib; @@ -36,12 +37,16 @@ namespace SparkleShare { public event UpdateChooserEventHandler UpdateChooserEvent = delegate { }; public delegate void UpdateChooserEventHandler (string [] folders); - + public event UpdateSizeInfoEventHandler UpdateSizeInfoEvent = delegate { }; public delegate void UpdateSizeInfoEventHandler (string size, string history_size); + + public event ShowSaveDialogEventHandler ShowSaveDialogEvent = delegate { }; + public delegate void ShowSaveDialogEventHandler (string file_name, string target_folder_path); private string selected_folder; + private RevisionInfo restore_revision_info; public bool WindowIsOpen { get; private set; } @@ -220,10 +225,113 @@ namespace SparkleShare { } else if (url.StartsWith ("http")) { Program.Controller.OpenWebsite (url); + + + } else if (url.StartsWith ("restore://") && this.restore_revision_info == null) { + Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)", RegexOptions.Compiled); + Match match = regex.Match (url); + + if (match.Success) { + this.restore_revision_info = new RevisionInfo () { + Folder = new SparkleFolder (match.Groups [1].Value), + Revision = match.Groups [2].Value, + FilePath = match.Groups [3].Value + }; + + string file_name = Path.GetFileNameWithoutExtension (this.restore_revision_info.FilePath) + + " (restored)" + Path.GetExtension (this.restore_revision_info.FilePath); + + string target_folder_path = Path.Combine (this.restore_revision_info.Folder.FullPath, + Path.GetDirectoryName (this.restore_revision_info.FilePath)); + + ShowSaveDialogEvent (file_name, target_folder_path); + + } else { + // TODO: remove + Program.UI.Bubbles.Controller.ShowBubble ("no match", url, ""); + } + + + } else if (url.StartsWith ("history://")) { + string html = ""; + string folder = url.Replace ("history://", "").Split ("/".ToCharArray ()) [0]; + string path = url.Replace ("history://" + folder + "/", ""); + + // TODO: put html into page + + foreach (SparkleRepoBase repo in Program.Controller.Repositories) { + if (repo.Name.Equals (folder)) { + List change_sets = repo.GetChangeSets (path, 30); + + html += "
Revisions for “" + + Path.GetFileName (path) + "”
"; + + + html += ""; + + int count = 0; + foreach (SparkleChangeSet change_set in change_sets) { + count++; + if (count == 1) + continue; + + foreach (SparkleChange change in change_set.Changes) { + if (change.Type == SparkleChangeType.Deleted && change.Path.Equals (path)) + continue; // TODO: in repo? + } + + string change_set_avatar = Program.Controller.GetAvatar (change_set.User.Email, 24); + + if (change_set_avatar != null) + change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); + else + change_set_avatar = "file:///user-icon-default.png"; + + html += "" + + "" + + "" + + "" + + "" + + "" + + ""; + + count++; + } + + + html += "
" + change_set.User.Name + "" + change_set.Timestamp.ToString ("d MMM yyyy") + "" + change_set.Timestamp.ToString ("HH:mm") + "Restore...
"; + + break; + } + } + + + UpdateContentEvent (Program.Controller.EventLogHTML.Replace ("", html)); } } + public void SaveDialogCompleted (string target_file_path) + { + foreach (SparkleRepoBase repo in Program.Controller.Repositories) { + if (repo.Name.Equals (this.restore_revision_info.Folder.Name)) { + repo.RestoreFile (this.restore_revision_info.FilePath, + this.restore_revision_info.Revision, target_file_path); + + break; + } + } + + this.restore_revision_info = null; + } + + + public void SaveDialogCancelled () + { + this.restore_revision_info = null; + } + + private List GetLog () { List list = new List (); @@ -307,7 +415,16 @@ namespace SparkleShare { foreach (SparkleChange change in change_set.Changes) { if (change.Type != SparkleChangeType.Moved) { event_entry += "
"; - event_entry += "" + change.Timestamp.ToString ("HH:mm") +"  "; + + if (!change.IsFolder) { + event_entry += "" + change.Timestamp.ToString ("HH:mm") + + "  "; + + } else { + event_entry += "" + change.Timestamp.ToString ("HH:mm") + "  "; + } + event_entry += FormatBreadCrumbs (change_set.Folder.FullPath, change.Path); event_entry += "
"; @@ -444,5 +561,12 @@ namespace SparkleShare { Date = new DateTime (date_time.Year, date_time.Month, date_time.Day); } } + + + private class RevisionInfo { + public SparkleFolder Folder; + public string FilePath; + public string Revision; + } } } From ef44b2ccfb78b09111436fe8f80ffdca2954cb70 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 14 Oct 2012 19:57:13 +0100 Subject: [PATCH 02/22] make restoring of files work --- SparkleLib/Git/SparkleRepoGit.cs | 51 ++++++++++++++++++++--- SparkleLib/SparkleRepoBase.cs | 8 ++-- SparkleShare/Mac/SparkleEventLog.cs | 9 ++-- SparkleShare/SparkleEventLogController.cs | 4 +- 4 files changed, 59 insertions(+), 13 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 96caf38d..4af6e93f 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.IO; using System.Text; using System.Text.RegularExpressions; +using System.Threading; using SparkleLib; @@ -29,6 +30,7 @@ namespace SparkleLib.Git { private bool user_is_set; private bool use_git_bin; + private bool is_encrypted; public SparkleRepo (string path, SparkleConfig config) : base (path, config) @@ -50,6 +52,11 @@ namespace SparkleLib.Git { git = new SparkleGit (LocalPath, "rebase --abort"); git.StartAndWaitForExit (); } + + string password_file_path = Path.Combine (LocalPath, ".git", "password"); + + if (File.Exists (password_file_path)) + this.is_encrypted = true; } @@ -548,14 +555,46 @@ namespace SparkleLib.Git { throw new ArgumentNullException ("revision"); path = path.Replace ("\\", "/"); + SparkleLogger.LogInfo ("Git", Name + " | Restoring \"" + path + "\" (revision " + revision + ")"); - SparkleGit git = new SparkleGit (LocalPath, "checkout " + revision + " \"" + path + "\""); - git.StartAndWaitForExit (); + // FIXME: git-show doesn't decrypt objects, so we can't use it to retrieve + // files from the index. This is a suboptimal workaround but it does the job + if (this.is_encrypted) { + // Restore the older file... + SparkleGit git = new SparkleGit (LocalPath, "checkout " + revision + " \"" + path + "\""); + git.StartAndWaitForExit (); - if (git.ExitCode == 0) - SparkleLogger.LogInfo ("Git", Name + " | Checked out \"" + path + "\" (" + revision + ")"); - else - SparkleLogger.LogInfo ("Git", Name + " | Failed to check out \"" + path + "\" (" + revision + ")"); + string local_file_path = Path.Combine (LocalPath, path); + + // ...move it... + try { + File.Move (local_file_path, target_file_path); + + } catch { + SparkleLogger.LogInfo ("Git", + Name + " | Could not move \"" + local_file_path + "\" to \"" + target_file_path + "\""); + } + + // ...and restore the most recent revision + git = new SparkleGit (LocalPath, "checkout " + CurrentRevision + " \"" + path + "\""); + git.StartAndWaitForExit (); + + // The correct way + } else { + path = path.Replace (" ", "\\ "); + + SparkleGit git = new SparkleGit (LocalPath, "show " + revision + ":" + path + ""); + git.Start (); + + FileStream stream = File.OpenWrite (target_file_path); + git.StandardOutput.BaseStream.CopyTo (stream); + stream.Close (); + + git.WaitForExit (); + } + + if (target_file_path.StartsWith (LocalPath)) + new Thread (() => OnFileActivity (null)).Start (); } diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 4c0e4ec3..4ccf85fe 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -218,9 +218,11 @@ namespace SparkleLib { if (IsBuffering) return; - foreach (string exclude_path in ExcludePaths) { - if (args.FullPath.Contains (exclude_path)) - return; + if (args != null) { + foreach (string exclude_path in ExcludePaths) { + if (args.FullPath.Contains (exclude_path)) + return; + } } lock (this.buffer_lock) { diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index cdf4fe48..92f36b7f 100755 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -252,10 +252,13 @@ namespace SparkleShare { PreventsApplicationTerminationWhenModal = false }; - if ((NSPanelButtonType) panel.RunModal ()== NSPanelButtonType.Ok) - Controller.SaveDialogCompleted ("f"); - else + if ((NSPanelButtonType) panel.RunModal ()== NSPanelButtonType.Ok) { + string target_file_path = Path.Combine (panel.DirectoryUrl.RelativePath, panel.NameFieldStringValue); + Controller.SaveDialogCompleted (target_file_path); + + } else { Controller.SaveDialogCancelled (); + } }); } }; diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 67540d09..f5ae2563 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -253,6 +253,8 @@ namespace SparkleShare { } else if (url.StartsWith ("history://")) { + UpdateSizeInfoEvent ("…", "…"); + string html = ""; string folder = url.Replace ("history://", "").Split ("/".ToCharArray ()) [0]; string path = url.Replace ("history://" + folder + "/", ""); @@ -305,7 +307,6 @@ namespace SparkleShare { } } - UpdateContentEvent (Program.Controller.EventLogHTML.Replace ("", html)); } } @@ -323,6 +324,7 @@ namespace SparkleShare { } this.restore_revision_info = null; + Program.Controller.OpenFolder (Path.GetDirectoryName (target_file_path)); } From 6f22466eac4b7f9115320ea18ad96ce654b41f3c Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 14 Oct 2012 23:22:55 +0100 Subject: [PATCH 03/22] history: fix some edge cases and general improvements --- SparkleLib/Git/SparkleRepoGit.cs | 7 +- SparkleLib/SparkleFetcherBase.cs | 5 +- SparkleShare/Common/HTML/event-log.html | 1 + SparkleShare/SparkleEventLogController.cs | 113 ++++++++++++++-------- 4 files changed, 77 insertions(+), 49 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 4af6e93f..b24e0e1e 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -553,8 +553,9 @@ namespace SparkleLib.Git { if (revision == null) throw new ArgumentNullException ("revision"); - + path = path.Replace ("\\", "/"); + SparkleLogger.LogInfo ("Git", Name + " | Restoring \"" + path + "\" (revision " + revision + ")"); // FIXME: git-show doesn't decrypt objects, so we can't use it to retrieve @@ -581,9 +582,7 @@ namespace SparkleLib.Git { // The correct way } else { - path = path.Replace (" ", "\\ "); - - SparkleGit git = new SparkleGit (LocalPath, "show " + revision + ":" + path + ""); + SparkleGit git = new SparkleGit (LocalPath, "show " + revision + ":\"" + path + "\""); git.Start (); FileStream stream = File.OpenWrite (target_file_path); diff --git a/SparkleLib/SparkleFetcherBase.cs b/SparkleLib/SparkleFetcherBase.cs index 9a9433d9..70f77cea 100755 --- a/SparkleLib/SparkleFetcherBase.cs +++ b/SparkleLib/SparkleFetcherBase.cs @@ -220,9 +220,8 @@ namespace SparkleLib { "Any files you add or change in this folder will be automatically synced to " + n + uri_builder.ToString () + " and everyone connected to it." + n + n + - "SparkleShare is an Open Source software program that helps people " + n + - "collaborate and share files. If you like what we do, please consider a small " + n + - "donation to support the project: http://www.sparkleshare.org/" + n + + "SparkleShare is an Open Source software program that helps people collaborate and " + n + + "share files. If you like what we do, consider buying us a beer: http://www.sparkleshare.org/" + n + n + "Have fun! :)" + n; } diff --git a/SparkleShare/Common/HTML/event-log.html b/SparkleShare/Common/HTML/event-log.html index 0e5bd3ab..cef0f3b2 100755 --- a/SparkleShare/Common/HTML/event-log.html +++ b/SparkleShare/Common/HTML/event-log.html @@ -166,6 +166,7 @@ td.name { width: 45%; + font-weight: bold; } td.time { diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index f5ae2563..b427bbfb 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -47,6 +47,7 @@ namespace SparkleShare { private string selected_folder; private RevisionInfo restore_revision_info; + private bool history_view_active; public bool WindowIsOpen { get; private set; } @@ -62,10 +63,10 @@ namespace SparkleShare { ContentLoadingEvent (); UpdateSizeInfoEvent ("…", "…"); - Stopwatch watch = new Stopwatch (); - watch.Start (); - new Thread (() => { + Stopwatch watch = new Stopwatch (); + watch.Start (); + string html = HTML; watch.Stop (); @@ -85,6 +86,8 @@ namespace SparkleShare { public string HTML { get { + this.history_view_active = false; + List change_sets = GetLog (this.selected_folder); string html = GetHTMLLog (change_sets); @@ -178,6 +181,9 @@ namespace SparkleShare { }; Program.Controller.OnIdle += delegate { + if (this.history_view_active) + return; + ContentLoadingEvent (); UpdateSizeInfoEvent ("…", "…"); @@ -228,18 +234,21 @@ namespace SparkleShare { } else if (url.StartsWith ("restore://") && this.restore_revision_info == null) { - Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)", RegexOptions.Compiled); + Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)/(.{3} [0-9]+ [0-9]+h[0-9]+)/(.+)", RegexOptions.Compiled); Match match = regex.Match (url); if (match.Success) { + string author_name = match.Groups [3].Value; + string timestamp = match.Groups [4].Value; + this.restore_revision_info = new RevisionInfo () { Folder = new SparkleFolder (match.Groups [1].Value), Revision = match.Groups [2].Value, - FilePath = match.Groups [3].Value + FilePath = match.Groups [5].Value }; string file_name = Path.GetFileNameWithoutExtension (this.restore_revision_info.FilePath) + - " (restored)" + Path.GetExtension (this.restore_revision_info.FilePath); + " (" + author_name + " " + timestamp + ")" + Path.GetExtension (this.restore_revision_info.FilePath); string target_folder_path = Path.Combine (this.restore_revision_info.Folder.FullPath, Path.GetDirectoryName (this.restore_revision_info.FilePath)); @@ -253,6 +262,9 @@ namespace SparkleShare { } else if (url.StartsWith ("history://")) { + this.history_view_active = true; + + ContentLoadingEvent (); UpdateSizeInfoEvent ("…", "…"); string html = ""; @@ -263,51 +275,68 @@ namespace SparkleShare { foreach (SparkleRepoBase repo in Program.Controller.Repositories) { if (repo.Name.Equals (folder)) { - List change_sets = repo.GetChangeSets (path, 30); - - html += "
Revisions for “" - + Path.GetFileName (path) + "”
"; - - - html += ""; - int count = 0; - foreach (SparkleChangeSet change_set in change_sets) { - count++; - if (count == 1) - continue; - - foreach (SparkleChange change in change_set.Changes) { - if (change.Type == SparkleChangeType.Deleted && change.Path.Equals (path)) - continue; // TODO: in repo? + new Thread (() => { + Stopwatch watch = new Stopwatch (); + + watch.Start (); + + List change_sets = repo.GetChangeSets (path, 30); + + if (change_sets.Count > 1) { + html += "
Revisions for “"; + html += Path.GetFileName (path) + "”
"; + + } else { + html += "
No revisions yet for “"; + html += Path.GetFileName (path) + "”
"; } - string change_set_avatar = Program.Controller.GetAvatar (change_set.User.Email, 24); + html += "« Back"; + html += "
"; + + int count = 0; + foreach (SparkleChangeSet change_set in change_sets) { + count++; + if (count == 1) + continue; + + string change_set_avatar = Program.Controller.GetAvatar (change_set.User.Email, 24); + + if (change_set_avatar != null) + change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); + else + change_set_avatar = "file:///user-icon-default.png"; + + html += "" + + "" + + "" + + "" + + "" + + "" + + ""; + + count++; + } + + html += "
" + change_set.User.Name + "" + change_set.Timestamp.ToString ("d MMM yyyy") + "" + change_set.Timestamp.ToString ("HH:mm") + "" + + "Restore…
"; + watch.Stop (); - if (change_set_avatar != null) - change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); - else - change_set_avatar = "file:///user-icon-default.png"; + int delay = 500; + + if (watch.ElapsedMilliseconds < delay) + Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); - html += "" + - "" + - "" + change_set.User.Name + "" + - "" + change_set.Timestamp.ToString ("d MMM yyyy") + "" + - "" + change_set.Timestamp.ToString ("HH:mm") + "" + - "Restore..." + - ""; - - count++; - } - - - html += ""; + UpdateContentEvent (Program.Controller.EventLogHTML.Replace ("", html)); + }).Start (); break; } } - - UpdateContentEvent (Program.Controller.EventLogHTML.Replace ("", html)); } } From a20d377192c57c4a0216d143aa2d898aa91cd2f7 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 15 Oct 2012 21:26:27 +0100 Subject: [PATCH 04/22] history: implement back button --- SparkleLib/Git/SparkleRepoGit.cs | 5 ++-- SparkleShare/Common/HTML/event-log.html | 10 ++++++- SparkleShare/Mac/SparkleEventLog.cs | 3 ++- SparkleShare/SparkleEventLogController.cs | 32 ++++++++++------------- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index b24e0e1e..26d76760 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -475,6 +475,7 @@ namespace SparkleLib.Git { foreach (string line in lines) { string conflicting_path = line.Substring (3); conflicting_path = EnsureSpecialCharacters (conflicting_path); + conflicting_path = conflicting_path.Replace ("\"", "\\\""); SparkleLogger.LogInfo ("Git", Name + " | Conflict type: " + line); @@ -553,8 +554,6 @@ namespace SparkleLib.Git { if (revision == null) throw new ArgumentNullException ("revision"); - - path = path.Replace ("\\", "/"); SparkleLogger.LogInfo ("Git", Name + " | Restoring \"" + path + "\" (revision " + revision + ")"); @@ -582,6 +581,8 @@ namespace SparkleLib.Git { // The correct way } else { + path = path.Replace ("\"", "\\\""); + SparkleGit git = new SparkleGit (LocalPath, "show " + revision + ":\"" + path + "\""); git.Start (); diff --git a/SparkleShare/Common/HTML/event-log.html b/SparkleShare/Common/HTML/event-log.html index cef0f3b2..6d250211 100755 --- a/SparkleShare/Common/HTML/event-log.html +++ b/SparkleShare/Common/HTML/event-log.html @@ -76,7 +76,7 @@ cursor: pointer; } - small, small a { + small, small a, small a:hover { font-size: ; color: ; } @@ -107,6 +107,14 @@ font-weight: bold; } + .history-header { + color: #aaa; + padding-top: 22px; + font-weight: bold; + float: left; + margin-left: 32px; + } + .event-entry { padding: 24px 14px 14px 64px; margin: 0 32px 0 32px; diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index 92f36b7f..b65801b6 100755 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -80,6 +80,7 @@ namespace SparkleShare { new SizeF (ContentView.Frame.Width, ContentView.Frame.Height - 39)) }; + this.hidden_close_button = new NSButton () { KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask, KeyEquivalent = "w" @@ -397,7 +398,7 @@ namespace SparkleShare { this.web_view.MainFrame.LoadHtmlString (html, new NSUrl ("")); - web_view.PolicyDelegate = new SparkleWebPolicyDelegate (); + this.web_view.PolicyDelegate = new SparkleWebPolicyDelegate (); ContentView.AddSubview (this.web_view); (this.web_view.PolicyDelegate as SparkleWebPolicyDelegate).LinkClicked += diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index b427bbfb..ffba7da5 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -86,8 +86,6 @@ namespace SparkleShare { public string HTML { get { - this.history_view_active = false; - List change_sets = GetLog (this.selected_folder); string html = GetHTMLLog (change_sets); @@ -255,12 +253,12 @@ namespace SparkleShare { ShowSaveDialogEvent (file_name, target_folder_path); - } else { - // TODO: remove - Program.UI.Bubbles.Controller.ShowBubble ("no match", url, ""); } - - + + } else if (url.StartsWith ("back://")) { + this.history_view_active = false; + SelectedFolder = this.selected_folder; // TODO: Return to the same position on the page + } else if (url.StartsWith ("history://")) { this.history_view_active = true; @@ -281,19 +279,17 @@ namespace SparkleShare { watch.Start (); - List change_sets = repo.GetChangeSets (path, 30); + List change_sets = repo.GetChangeSets (path, 30); - if (change_sets.Count > 1) { - html += "
Revisions for “"; - html += Path.GetFileName (path) + "”
"; - - } else { - html += "
No revisions yet for “"; - html += Path.GetFileName (path) + "”
"; - } + html += "
« Back  |  "; - html += "« Back"; - html += ""; + if (change_sets.Count > 1) + html += "Revisions for “"; + else + html += "No revisions for “"; + + html += Path.GetFileName (path) + "”"; + html += "
"; int count = 0; foreach (SparkleChangeSet change_set in change_sets) { From f9d867aa58b9afb854b683e84a0285ec8cb86f9c Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 15 Oct 2012 21:29:58 +0100 Subject: [PATCH 05/22] bump development version --- SparkleLib/Defines.cs | 2 +- SparkleShare/Windows/SparkleShare.wxs | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SparkleLib/Defines.cs b/SparkleLib/Defines.cs index c224c8a3..05dda0f6 100644 --- a/SparkleLib/Defines.cs +++ b/SparkleLib/Defines.cs @@ -19,7 +19,7 @@ using System; using System.Reflection; [assembly:AssemblyTitle ("SparkleLib")] -[assembly:AssemblyVersion ("0.9.3")] +[assembly:AssemblyVersion ("0.9.4")] [assembly:AssemblyCopyright ("Copyright (c) 2010 Hylke Bons and others")] [assembly:AssemblyTrademark ("SparkleShare is a trademark of SparkleShare Ltd.")] diff --git a/SparkleShare/Windows/SparkleShare.wxs b/SparkleShare/Windows/SparkleShare.wxs index f9c6ce22..5c67bf12 100644 --- a/SparkleShare/Windows/SparkleShare.wxs +++ b/SparkleShare/Windows/SparkleShare.wxs @@ -2,7 +2,7 @@ + Language='1033' Codepage='1252' Version='0.9.4' Manufacturer='SparkleShare'> diff --git a/configure.ac b/configure.ac index 6ddea778..4c6b3f69 100755 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -m4_define([sparkleshare_version], [0.9.3]) +m4_define([sparkleshare_version], [0.9.4]) AC_PREREQ([2.54]) AC_INIT([SparkleShare], sparkleshare_version) From 1da8082d14e283083e7e4ecaa76936d3baa23f60 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 15 Oct 2012 22:02:13 +0100 Subject: [PATCH 06/22] history: disable chooser when in history view --- SparkleShare/Mac/SparkleEventLog.cs | 11 +- SparkleShare/SparkleEventLogController.cs | 144 ++++++++++++---------- 2 files changed, 89 insertions(+), 66 deletions(-) diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index b65801b6..b8d59df5 100755 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -198,7 +198,7 @@ namespace SparkleShare { }); } }; - + Controller.UpdateChooserEvent += delegate (string [] folders) { using (var a = new NSAutoreleasePool ()) { @@ -208,6 +208,15 @@ namespace SparkleShare { } }; + Controller.UpdateChooserEnablementEvent += delegate (bool enabled) { + using (var a = new NSAutoreleasePool ()) + { + InvokeOnMainThread (delegate { + this.popup_button.Enabled = enabled; + }); + } + }; + Controller.UpdateContentEvent += delegate (string html) { using (var a = new NSAutoreleasePool ()) { diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index ffba7da5..68426464 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -34,10 +34,13 @@ namespace SparkleShare { public event UpdateContentEventEventHandler UpdateContentEvent = delegate { }; public delegate void UpdateContentEventEventHandler (string html); - + public event UpdateChooserEventHandler UpdateChooserEvent = delegate { }; public delegate void UpdateChooserEventHandler (string [] folders); + public event UpdateChooserEnablementEventHandler UpdateChooserEnablementEvent = delegate { }; + public delegate void UpdateChooserEnablementEventHandler (bool enabled); + public event UpdateSizeInfoEventHandler UpdateSizeInfoEvent = delegate { }; public delegate void UpdateSizeInfoEventHandler (string size, string history_size); @@ -258,81 +261,44 @@ namespace SparkleShare { } else if (url.StartsWith ("back://")) { this.history_view_active = false; SelectedFolder = this.selected_folder; // TODO: Return to the same position on the page - + + UpdateChooserEnablementEvent (true); + } else if (url.StartsWith ("history://")) { this.history_view_active = true; ContentLoadingEvent (); UpdateSizeInfoEvent ("…", "…"); + UpdateChooserEnablementEvent (false); - string html = ""; - string folder = url.Replace ("history://", "").Split ("/".ToCharArray ()) [0]; - string path = url.Replace ("history://" + folder + "/", ""); + string folder = url.Replace ("history://", "").Split ("/".ToCharArray ()) [0]; + string file_path = url.Replace ("history://" + folder + "/", ""); - // TODO: put html into page - - foreach (SparkleRepoBase repo in Program.Controller.Repositories) { - if (repo.Name.Equals (folder)) { - - new Thread (() => { - Stopwatch watch = new Stopwatch (); - - watch.Start (); - - List change_sets = repo.GetChangeSets (path, 30); - - html += "
« Back  |  "; - - if (change_sets.Count > 1) - html += "Revisions for “"; - else - html += "No revisions for “"; - - html += Path.GetFileName (path) + "”"; - html += "
"; - - int count = 0; - foreach (SparkleChangeSet change_set in change_sets) { - count++; - if (count == 1) - continue; - - string change_set_avatar = Program.Controller.GetAvatar (change_set.User.Email, 24); - - if (change_set_avatar != null) - change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); - else - change_set_avatar = "file:///user-icon-default.png"; - - html += "" + - "" + - "" + - "" + - "" + - "" + - ""; - - count++; - } - - html += "
" + change_set.User.Name + "" + change_set.Timestamp.ToString ("d MMM yyyy") + "" + change_set.Timestamp.ToString ("HH:mm") + "" + - "Restore…
"; - watch.Stop (); - - int delay = 500; - - if (watch.ElapsedMilliseconds < delay) - Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); - - UpdateContentEvent (Program.Controller.EventLogHTML.Replace ("", html)); - }).Start (); + SparkleRepoBase repo; + foreach (SparkleRepoBase test_repo in Program.Controller.Repositories) { + if (test_repo.Name.Equals (folder)) { + repo = test_repo; break; } } + + new Thread (() => { + Stopwatch watch = new Stopwatch (); + watch.Start (); + + List change_sets = repo.GetChangeSets (file_path, 30); + string html = GetHistoryHTMLLog (change_sets, file_path); + + watch.Stop (); + int delay = 500; + + if (watch.ElapsedMilliseconds < delay) + Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); + + UpdateContentEvent (html); + + }).Start (); } } @@ -396,6 +362,54 @@ namespace SparkleShare { } + public string GetHistoryHTMLLog (List change_sets, string file_path) + { + string html = "
« Back  |  "; + + if (change_sets.Count > 1) + html += "Revisions for “"; + else + html += "No revisions for “"; + + html += Path.GetFileName (file_path) + "”"; + html += "
"; + + int count = 0; + foreach (SparkleChangeSet change_set in change_sets) { + count++; + + if (count == 1) + continue; + + string change_set_avatar = Program.Controller.GetAvatar (change_set.User.Email, 24); + + if (change_set_avatar != null) + change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); + else + change_set_avatar = "file:///user-icon-default.png"; + + html += "" + + "" + + "" + + "" + + "" + + "" + + ""; + + count++; + } + + html += "
" + change_set.User.Name + "" + change_set.Timestamp.ToString ("d MMM yyyy") + "" + change_set.Timestamp.ToString ("HH:mm") + "" + + "Restore…" + + "
"; + + return Program.Controller.EventLogHTML.Replace ("", html); + } + + public string GetHTMLLog (List change_sets) { if (change_sets.Count == 0) From 687f3255203fe543d048c972d162e99478e28e0d Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 15 Oct 2012 22:16:18 +0100 Subject: [PATCH 07/22] eventlog: fix some chooser logic --- SparkleShare/Common/HTML/event-log.html | 1 - SparkleShare/SparkleEventLogController.cs | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SparkleShare/Common/HTML/event-log.html b/SparkleShare/Common/HTML/event-log.html index 6d250211..d3f4e14b 100755 --- a/SparkleShare/Common/HTML/event-log.html +++ b/SparkleShare/Common/HTML/event-log.html @@ -67,7 +67,6 @@ a.show { font-size: 80%; - margin-bottom: 9px; } a:hover { diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 68426464..53dca419 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -170,6 +170,7 @@ namespace SparkleShare { Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); UpdateChooserEvent (Folders); + UpdateChooserEnablementEvent (true); UpdateContentEvent (html); UpdateSizeInfoEvent (Size, HistorySize); @@ -471,6 +472,7 @@ namespace SparkleShare { } else { event_entry += "
"; + event_entry += "" + change.Timestamp.ToString ("HH:mm") +"  "; event_entry += FormatBreadCrumbs (change_set.Folder.FullPath, change.Path); event_entry += "
"; event_entry += "" + change.Timestamp.ToString ("HH:mm") +"  "; From efc7d0d237f13bc03d3f2bc3b137b32c1f089bbd Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 15 Oct 2012 23:30:35 +0100 Subject: [PATCH 08/22] history: implement GTK Save As dialog --- SparkleShare/Linux/SparkleEventLog.cs | 28 +++++++++++++++++++++-- SparkleShare/SparkleEventLogController.cs | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/SparkleShare/Linux/SparkleEventLog.cs b/SparkleShare/Linux/SparkleEventLog.cs index 8f28fc09..2eb722c7 100755 --- a/SparkleShare/Linux/SparkleEventLog.cs +++ b/SparkleShare/Linux/SparkleEventLog.cs @@ -131,12 +131,35 @@ namespace SparkleShare { Present (); }); }; + + Controller.ShowSaveDialogEvent += delegate (string file_name, string target_folder_path) { + Application.Invoke (delegate { + FileChooserDialog dialog = new FileChooserDialog ("Restore from History", + this, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Save", ResponseType.Ok); + + dialog.CurrentName = file_name; + dialog.SetCurrentFolder (target_folder_path); + + if (dialog.Run () == (int) ResponseType.Ok) + Controller.SaveDialogCompleted (dialog.Filename); + else + Controller.SaveDialogCancelled (); + + dialog.Destroy (); + }); + }; Controller.UpdateChooserEvent += delegate (string [] folders) { Application.Invoke (delegate { UpdateChooser (folders); }); }; + + Controller.UpdateChooserEnablementEvent += delegate (bool enabled) { + Application.Invoke (delegate { + this.combo_box.Sensitive = enabled; + }); + }; Controller.UpdateContentEvent += delegate (string html) { Application.Invoke (delegate { @@ -168,7 +191,7 @@ namespace SparkleShare { private void WebViewNavigationRequested (object o, WebKit.NavigationRequestedArgs args) { - Controller.LinkClicked (args.Request.Uri.Substring (7)); + Controller.LinkClicked (args.Request.Uri); // Don't follow HREFs (as this would cause a page refresh) if (!args.Request.Uri.Equals ("file:")) @@ -260,7 +283,8 @@ namespace SparkleShare { html = html.Replace ("", SparkleUIHelpers.GdkColorToHex (Style.Background (StateType.Normal))); html = html.Replace ("", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive))); html = html.Replace ("", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive))); - + html = html.Replace ("", "85%"); + html = html.Replace ("", pixmaps_path); html = html.Replace ("", diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 53dca419..aa5a383b 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -226,7 +226,7 @@ namespace SparkleShare { { url = url.Replace ("%20", " "); - if (url.StartsWith (Path.VolumeSeparatorChar.ToString ()) || + if (url.StartsWith ("file://") || url.Substring (1, 1).Equals (":")) { Program.Controller.OpenFile (url); From 423717bd1d507d0d8a0c4d54b6e0455e531701d6 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 15 Oct 2012 23:45:03 +0100 Subject: [PATCH 09/22] eventlog: change default size --- SparkleLib/Git/SparkleRepoGit.cs | 11 ++++++++--- SparkleLib/SparkleRepoBase.cs | 6 +----- SparkleShare/SparkleEventLogController.cs | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 26d76760..63cb459e 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -603,13 +603,19 @@ namespace SparkleLib.Git { return GetChangeSetsInternal (path, count); } - + public override List GetChangeSets (int count) { return GetChangeSetsInternal (null, count); } + public override List GetChangeSets () + { + return GetChangeSetsInternal (null, 150); + } + + private bool FindError (string line) { Error = ErrorStatus.None; @@ -629,6 +635,7 @@ namespace SparkleLib.Git { if (Error != ErrorStatus.None) { SparkleLogger.LogInfo ("Git", Name + " | Error status changed to " + Error); return true; + } else { return false; } @@ -640,9 +647,7 @@ namespace SparkleLib.Git { if (count < 1) throw new ArgumentOutOfRangeException ("count"); - count = 150; List change_sets = new List (); - SparkleGit git; if (path == null) { diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 4ccf85fe..951c62bf 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -54,6 +54,7 @@ namespace SparkleLib { public abstract bool HasRemoteChanges { get; } public abstract bool SyncUp (); public abstract bool SyncDown (); + public abstract List GetChangeSets (); public abstract List GetChangeSets (int count); public abstract List GetChangeSets (string path, int count); public abstract void RestoreFile (string path, string revision, string target_file_path); @@ -206,11 +207,6 @@ namespace SparkleLib { } - public List GetChangeSets () { - return GetChangeSets (30); - } - - private Object buffer_lock = new Object (); public void OnFileActivity (FileSystemEventArgs args) diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index aa5a383b..8f7dfacc 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -288,7 +288,7 @@ namespace SparkleShare { Stopwatch watch = new Stopwatch (); watch.Start (); - List change_sets = repo.GetChangeSets (file_path, 30); + List change_sets = repo.GetChangeSets (file_path, 100); string html = GetHistoryHTMLLog (change_sets, file_path); watch.Stop (); From 2c94a9938d652648dba7b36d6e39a9c009cc6c44 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 11:03:20 +0100 Subject: [PATCH 10/22] event log: show the last month worth of changes --- SparkleLib/Git/SparkleRepoGit.cs | 21 ++++++--------------- SparkleLib/SparkleRepoBase.cs | 3 +-- SparkleShare/SparkleEventLogController.cs | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 63cb459e..d938887a 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -598,21 +598,15 @@ namespace SparkleLib.Git { } - public override List GetChangeSets (string path, int count) + public override List GetChangeSets (string path) { - return GetChangeSetsInternal (path, count); + return GetChangeSetsInternal (path); } - - public override List GetChangeSets (int count) - { - return GetChangeSetsInternal (null, count); - } - public override List GetChangeSets () { - return GetChangeSetsInternal (null, 150); + return GetChangeSetsInternal (null); } @@ -642,22 +636,19 @@ namespace SparkleLib.Git { } - private List GetChangeSetsInternal (string path, int count) + private List GetChangeSetsInternal (string path) { - if (count < 1) - throw new ArgumentOutOfRangeException ("count"); - List change_sets = new List (); SparkleGit git; if (path == null) { - git = new SparkleGit (LocalPath, "log -" + count + " --raw --find-renames --date=iso " + + git = new SparkleGit (LocalPath, "log --since=1.month --raw --find-renames --date=iso " + "--format=medium --no-color --no-merges"); } else { path = path.Replace ("\\", "/"); - git = new SparkleGit (LocalPath, "log -" + count + " --raw --find-renames --date=iso " + + git = new SparkleGit (LocalPath, "log --raw --find-renames --date=iso " + "--format=medium --no-color --no-merges -- \"" + path + "\""); } diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 951c62bf..a739688e 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -55,8 +55,7 @@ namespace SparkleLib { public abstract bool SyncUp (); public abstract bool SyncDown (); public abstract List GetChangeSets (); - public abstract List GetChangeSets (int count); - public abstract List GetChangeSets (string path, int count); + public abstract List GetChangeSets (string path); public abstract void RestoreFile (string path, string revision, string target_file_path); public event SyncStatusChangedEventHandler SyncStatusChanged = delegate { }; diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 8f7dfacc..1c90753d 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -288,7 +288,7 @@ namespace SparkleShare { Stopwatch watch = new Stopwatch (); watch.Start (); - List change_sets = repo.GetChangeSets (file_path, 100); + List change_sets = repo.GetChangeSets (file_path); string html = GetHistoryHTMLLog (change_sets, file_path); watch.Stop (); From 8c7108e83f0efec85a611d168cd612fa406715d6 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 12:21:44 +0100 Subject: [PATCH 11/22] don't block the event log on initial startup syncs --- SparkleLib/SparkleRepoBase.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index a739688e..02202ada 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -195,14 +195,17 @@ namespace SparkleLib { // Sync up everything that changed // since we've been offline - if (!this.is_syncing && (HasLocalChanges || HasUnsyncedChanges)) { - SyncUpBase (); - - while (HasLocalChanges) + new Thread (() => { + if (!this.is_syncing && (HasLocalChanges || HasUnsyncedChanges)) { SyncUpBase (); - } - this.remote_timer.Start (); + while (HasLocalChanges && !this.is_syncing) + SyncUpBase (); + } + + this.remote_timer.Start (); + + }).Start (); } From 69cc66e572b5def1ac27bd06f87e8d13910747ec Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 12:22:19 +0100 Subject: [PATCH 12/22] history: ellipsize long file names --- SparkleShare/Common/HTML/event-log.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SparkleShare/Common/HTML/event-log.html b/SparkleShare/Common/HTML/event-log.html index d3f4e14b..9df3428d 100755 --- a/SparkleShare/Common/HTML/event-log.html +++ b/SparkleShare/Common/HTML/event-log.html @@ -90,13 +90,12 @@ display: none; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; width: 90%; padding: 0 0 1px 20px; margin: 0 0 4px 0; background-repeat: no-repeat; background-position: center left; - text-overflow: ellipsis; - white-space: nowrap; } .day-entry-header { @@ -111,7 +110,12 @@ padding-top: 22px; font-weight: bold; float: left; + width: 90%; margin-left: 32px; + margin-right: 32px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .event-entry { From 75fe370077093961b5da59980b55f4a1975729cd Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 21:50:58 +0100 Subject: [PATCH 13/22] fetcher: hide the .sparkleshare file when done --- SparkleLib/SparkleFetcherBase.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SparkleLib/SparkleFetcherBase.cs b/SparkleLib/SparkleFetcherBase.cs index 70f77cea..79c95761 100755 --- a/SparkleLib/SparkleFetcherBase.cs +++ b/SparkleLib/SparkleFetcherBase.cs @@ -184,6 +184,7 @@ namespace SparkleLib { if (File.Exists (identifier_path)) { Identifier = File.ReadAllText (identifier_path).Trim (); + File.SetAttributes (identifier_path, FileAttributes.Hidden); } else { Identifier = CreateIdentifier (); From 0bacff9c583ddf54b37b3015e244806e677e7e74 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 21:51:26 +0100 Subject: [PATCH 14/22] about: fix debug log link position --- SparkleShare/Windows/SparkleAbout.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SparkleShare/Windows/SparkleAbout.cs b/SparkleShare/Windows/SparkleAbout.cs index 3a239d4a..6f36956a 100644 --- a/SparkleShare/Windows/SparkleAbout.cs +++ b/SparkleShare/Windows/SparkleAbout.cs @@ -120,7 +120,7 @@ namespace SparkleShare { SparkleLink website_link = new SparkleLink ("Website", Controller.WebsiteLinkAddress); SparkleLink credits_link = new SparkleLink ("Credits", Controller.CreditsLinkAddress); SparkleLink report_problem_link = new SparkleLink ("Report a problem", Controller.ReportProblemLinkAddress); - SparkleLink debug_log_link = new SparkleLink ("Debig log", Controller.DebugLogLinkAddress); + SparkleLink debug_log_link = new SparkleLink ("Debug log", Controller.DebugLogLinkAddress); Canvas canvas = new Canvas (); @@ -154,7 +154,7 @@ namespace SparkleShare { canvas.Children.Add (debug_log_link); Canvas.SetLeft (debug_log_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + - report_problem_link.ActualWidth + 180); + report_problem_link.ActualWidth + 220); Canvas.SetTop (debug_log_link, 222); Content = canvas; From 34a9ece93900334a0a189da84da532f404164d6a Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 21:51:53 +0100 Subject: [PATCH 15/22] history: implement windows save dialog --- SparkleShare/Common/HTML/event-log.html | 18 ++++--- SparkleShare/SparkleEventLogController.cs | 58 +++++++++++------------ SparkleShare/Windows/SparkleEventLog.cs | 54 +++++++++++++++++---- 3 files changed, 82 insertions(+), 48 deletions(-) diff --git a/SparkleShare/Common/HTML/event-log.html b/SparkleShare/Common/HTML/event-log.html index 9df3428d..302dec08 100755 --- a/SparkleShare/Common/HTML/event-log.html +++ b/SparkleShare/Common/HTML/event-log.html @@ -10,8 +10,9 @@ $('dl dd:nth-child(-n+10)').css('display', 'block'); $('.day-entry-content .event-entry:last-child').css('border', 'none'); - $('dd a.windows').click(function () { + $('a').click(function (event) { window.external.LinkClicked($(this).attr("href")); + event.preventDefault(); }); // Update the Today and Yesterday labels after midnight @@ -26,7 +27,7 @@ } }, 60 * 1000); - // Hide the 'Show all' link when there are less than 10 events + // Hide the 'Show all' link when there are fewer than 10 events $('.show').each (function () { var entry_count = $(this).parent ().find ('dl').children ().length; @@ -124,7 +125,6 @@ border-bottom: 1px #ddd solid; background-repeat: no-repeat; background-position: 36px 24px; - min-height: 100px; } .event-user-name { @@ -166,34 +166,32 @@ } table { - padding: 18px 32px; width: 100%; } + .table-wrapper { + padding: 64px 32px; + } + td { padding: 0; margin: 0; } td.name { - width: 45%; font-weight: bold; + width: 45%; } td.time { - font-size: ; color: ; padding-right: 9px; - width: 20px; - padding-top: 2px; } td.date { - font-size: ; color: ; text-align: right; padding-right: 6px; - padding-top: 2px; } td.restore { diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 1c90753d..7784c638 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -224,6 +224,8 @@ namespace SparkleShare { public void LinkClicked (string url) { + + url = url.Replace ("%20", " "); if (url.StartsWith ("file://") || @@ -256,7 +258,6 @@ namespace SparkleShare { Path.GetDirectoryName (this.restore_revision_info.FilePath)); ShowSaveDialogEvent (file_name, target_folder_path); - } } else if (url.StartsWith ("back://")) { @@ -275,31 +276,29 @@ namespace SparkleShare { string folder = url.Replace ("history://", "").Split ("/".ToCharArray ()) [0]; string file_path = url.Replace ("history://" + folder + "/", ""); - SparkleRepoBase repo; + foreach (SparkleRepoBase repo in Program.Controller.Repositories) { + if (!repo.Name.Equals (folder)) + continue; - foreach (SparkleRepoBase test_repo in Program.Controller.Repositories) { - if (test_repo.Name.Equals (folder)) { - repo = test_repo; - break; - } + new Thread (() => { + Stopwatch watch = new Stopwatch (); + watch.Start (); + + List change_sets = repo.GetChangeSets (file_path); + string html = GetHistoryHTMLLog (change_sets, file_path); + + watch.Stop (); + int delay = 500; + + if (watch.ElapsedMilliseconds < delay) + Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); + + UpdateContentEvent (html); + + }).Start (); + + break; } - - new Thread (() => { - Stopwatch watch = new Stopwatch (); - watch.Start (); - - List change_sets = repo.GetChangeSets (file_path); - string html = GetHistoryHTMLLog (change_sets, file_path); - - watch.Stop (); - int delay = 500; - - if (watch.ElapsedMilliseconds < delay) - Thread.Sleep (delay - (int) watch.ElapsedMilliseconds); - - UpdateContentEvent (html); - - }).Start (); } } @@ -365,7 +364,7 @@ namespace SparkleShare { public string GetHistoryHTMLLog (List change_sets, string file_path) { - string html = "
« Back  |  "; + string html = "
« Back  |  "; if (change_sets.Count > 1) html += "Revisions for “"; @@ -373,7 +372,7 @@ namespace SparkleShare { html += "No revisions for “"; html += Path.GetFileName (file_path) + "”"; - html += "
"; + html += "
"; int count = 0; foreach (SparkleChangeSet change_set in change_sets) { @@ -405,9 +404,10 @@ namespace SparkleShare { count++; } - html += "
"; - - return Program.Controller.EventLogHTML.Replace ("", html); + html += "
"; + html = Program.Controller.EventLogHTML.Replace ("", html); + + return html.Replace ("", "1000000000000000000"); } diff --git a/SparkleShare/Windows/SparkleEventLog.cs b/SparkleShare/Windows/SparkleEventLog.cs index 5cb4268a..53cb2518 100644 --- a/SparkleShare/Windows/SparkleEventLog.cs +++ b/SparkleShare/Windows/SparkleEventLog.cs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see (http://www.gnu.org/licenses/). - using System; using System.ComponentModel; using System.IO; @@ -26,6 +25,7 @@ using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Imaging; +using Microsoft.Win32; using Shapes = System.Windows.Shapes; namespace SparkleShare { @@ -50,7 +50,7 @@ namespace SparkleShare { ResizeMode = ResizeMode.NoResize; // TODO Background = new SolidColorBrush (Color.FromRgb (240, 240, 240)); AllowsTransparency = false; - Icon = SparkleUIHelpers.GetImageSource("sparkleshare-app", "ico"); + Icon = SparkleUIHelpers.GetImageSource ("sparkleshare-app", "ico"); int x = (int) (SystemParameters.PrimaryScreenWidth * 0.61); int y = (int) (SystemParameters.PrimaryScreenHeight * 0.5 - (Height * 0.5)); @@ -104,6 +104,8 @@ namespace SparkleShare { this.web_browser.ObjectForScripting = new SparkleScriptingObject (); + + spinner = new SparkleSpinner (22); // Disable annoying IE clicking sound @@ -177,6 +179,12 @@ namespace SparkleShare { }); }; + Controller.UpdateChooserEnablementEvent += delegate (bool enabled) { + Dispatcher.BeginInvoke ((Action) delegate { + this.combo_box.IsEnabled = enabled; + }); + }; + Controller.UpdateContentEvent += delegate (string html) { Dispatcher.BeginInvoke ((Action) delegate { UpdateContent (html); @@ -191,6 +199,25 @@ namespace SparkleShare { this.canvas.Children.Remove (this.web_browser); }); }; + + Controller.ShowSaveDialogEvent += delegate (string file_name, string target_folder_path) { + Dispatcher.BeginInvoke ((Action) delegate { + SaveFileDialog dialog = new SaveFileDialog () { + FileName = file_name, + InitialDirectory = target_folder_path, + Title = "Restore from History", + DefaultExt = "." + Path.GetExtension (file_name), + Filter = "All Files|*.*" + }; + + Nullable result = dialog.ShowDialog (this); + + if (result == true) + Controller.SaveDialogCompleted (dialog.FileName); + else + Controller.SaveDialogCancelled (); + }); + }; } @@ -262,6 +289,7 @@ namespace SparkleShare { html = html.Replace ("", "12px"); html = html.Replace ("", "#bbb"); html = html.Replace ("", "#ddd"); + html = html.Replace ("", "90%"); html = html.Replace ("", "#f5f5f5"); html = html.Replace ("", "#0085cf"); html = html.Replace ("", "#009ff8"); @@ -282,9 +310,17 @@ namespace SparkleShare { Dispatcher.BeginInvoke ((Action) delegate { this.spinner.Stop (); - - this.web_browser.NavigateToString (html); - + this.web_browser.ObjectForScripting = new SparkleScriptingObject (); + //if (html != null) { + this.web_browser.NavigateToString (html); + SparkleLib.SparkleLogger.LogInfo ("FFF", ""+html); + //} + /* this.web_browser.Navigating += delegate(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { + Program.UI.EventLog.Controller.LinkClicked (e.Uri.ToString()); + if (e.Uri.ToString().StartsWith ("back://")) + e.Cancel = true; + + };*/ if (!this.canvas.Children.Contains (this.web_browser)) { this.canvas.Children.Add (this.web_browser); Canvas.SetLeft (this.web_browser, 0); @@ -322,8 +358,8 @@ namespace SparkleShare { string [] actions = new string [] {"added", "deleted", "edited", "moved"}; foreach (string action in actions) { - BitmapSource image = SparkleUIHelpers.GetImageSource ("document-" + action + "-12"); - string file_path = Path.Combine (pixmaps_path, "document-" + action + "-12.png"); + image = SparkleUIHelpers.GetImageSource ("document-" + action + "-12"); + file_path = Path.Combine (pixmaps_path, "document-" + action + "-12.png"); using (FileStream stream = new FileStream (file_path, FileMode.Create)) { @@ -345,8 +381,8 @@ namespace SparkleShare { [DllImport ("urlmon.dll")] [PreserveSig] [return:MarshalAs (UnmanagedType.Error)] - static extern int CoInternetSetFeatureEnabled ( - int feature, [MarshalAs (UnmanagedType.U4)] int flags, bool enable); + static extern int CoInternetSetFeatureEnabled (int feature, + [MarshalAs (UnmanagedType.U4)] int flags, bool enable); } From 3a8d7bec4fe9c97e3750ff622281e80cb39b18ab Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 22:00:01 +0100 Subject: [PATCH 16/22] controller: small fix for status icon text not updating sometimes --- SparkleLib/Git/SparkleRepoGit.cs | 5 ++--- SparkleShare/SparkleControllerBase.cs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index d938887a..53782fe5 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -245,9 +245,8 @@ namespace SparkleLib.Git { if (line.Contains ("|")) { speed = line.Substring (line.IndexOf ("|") + 1).Trim (); speed = speed.Replace (", done.", "").Trim (); - speed = speed.Replace ("i", ""); - speed = speed.Replace ("KB/s", "ᴋʙ/s"); - speed = speed.Replace ("MB/s", "ᴍʙ/s"); + speed = speed.Replace ("KiB/s", "ᴋʙ/s"); + speed = speed.Replace ("MiB/s", "ᴍʙ/s"); } } diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index e25c0f6c..64278ac2 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -260,6 +260,7 @@ namespace SparkleShare { CheckRepositories (); RepositoriesLoaded = true; FolderListChanged (); + UpdateState (); }).Start (); } From 2ea299380b2ad19fd8c5ce9e5021160e97970e2f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 22:14:51 +0100 Subject: [PATCH 17/22] history: small style change --- SparkleShare/Common/HTML/event-log.html | 4 +++- SparkleShare/SparkleEventLogController.cs | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/SparkleShare/Common/HTML/event-log.html b/SparkleShare/Common/HTML/event-log.html index 302dec08..06a3d95e 100755 --- a/SparkleShare/Common/HTML/event-log.html +++ b/SparkleShare/Common/HTML/event-log.html @@ -109,7 +109,6 @@ .history-header { color: #aaa; padding-top: 22px; - font-weight: bold; float: left; width: 90%; margin-left: 32px; @@ -186,16 +185,19 @@ td.time { color: ; padding-right: 9px; + font-size: ; } td.date { color: ; text-align: right; padding-right: 6px; + font-size: ; } td.restore { text-align: right; + font-size: ; } td.avatar { diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 7784c638..d81001f7 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -364,14 +364,15 @@ namespace SparkleShare { public string GetHistoryHTMLLog (List change_sets, string file_path) { - string html = "
« Back  |  "; + string html = "
" + + "« Back  |  "; if (change_sets.Count > 1) - html += "Revisions for “"; + html += "Revisions for “"; else - html += "No revisions for “"; + html += "No revisions for “"; - html += Path.GetFileName (file_path) + "”"; + html += Path.GetFileName (file_path) + "”"; html += "
"; int count = 0; From a7187d8dfe46017139b8cb337292fa77a5716f28 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 16 Oct 2012 22:17:25 +0100 Subject: [PATCH 18/22] windows: remove some debug cruft --- SparkleShare/Windows/SparkleEventLog.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/SparkleShare/Windows/SparkleEventLog.cs b/SparkleShare/Windows/SparkleEventLog.cs index 53cb2518..c4722c76 100644 --- a/SparkleShare/Windows/SparkleEventLog.cs +++ b/SparkleShare/Windows/SparkleEventLog.cs @@ -310,17 +310,10 @@ namespace SparkleShare { Dispatcher.BeginInvoke ((Action) delegate { this.spinner.Stop (); - this.web_browser.ObjectForScripting = new SparkleScriptingObject (); - //if (html != null) { - this.web_browser.NavigateToString (html); - SparkleLib.SparkleLogger.LogInfo ("FFF", ""+html); - //} - /* this.web_browser.Navigating += delegate(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { - Program.UI.EventLog.Controller.LinkClicked (e.Uri.ToString()); - if (e.Uri.ToString().StartsWith ("back://")) - e.Cancel = true; - - };*/ + + this.web_browser.ObjectForScripting = new SparkleScriptingObject (); + this.web_browser.NavigateToString (html); + if (!this.canvas.Children.Contains (this.web_browser)) { this.canvas.Children.Add (this.web_browser); Canvas.SetLeft (this.web_browser, 0); From a348ff2d353a8e9b31f81c9199376101ba69a281 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 19 Oct 2012 21:45:10 +0100 Subject: [PATCH 19/22] eventlog: fix opening of files on mac --- SparkleShare/SparkleEventLogController.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index d81001f7..611cd84b 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -224,19 +224,11 @@ namespace SparkleShare { public void LinkClicked (string url) { - - url = url.Replace ("%20", " "); - - if (url.StartsWith ("file://") || - url.Substring (1, 1).Equals (":")) { - - Program.Controller.OpenFile (url); - } else if (url.StartsWith ("http")) { + if (url.StartsWith ("http")) { Program.Controller.OpenWebsite (url); - } else if (url.StartsWith ("restore://") && this.restore_revision_info == null) { Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)/(.{3} [0-9]+ [0-9]+h[0-9]+)/(.+)", RegexOptions.Compiled); Match match = regex.Match (url); @@ -299,7 +291,10 @@ namespace SparkleShare { break; } - } + + } else { + Program.Controller.OpenFile (url); + } } @@ -408,7 +403,7 @@ namespace SparkleShare { html += "
"; html = Program.Controller.EventLogHTML.Replace ("", html); - return html.Replace ("", "1000000000000000000"); + return html.Replace ("", "100000000"); } From a6d88d451bd22eff8694420327ae2bd770aed458 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 19 Oct 2012 21:45:27 +0100 Subject: [PATCH 20/22] update news --- News.txt | 13 ++++++++++++- SparkleShare/Mac/SparkleStatusIcon.cs | 4 ++-- SparkleShare/Windows/SparkleEventLog.cs | 1 - 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/News.txt b/News.txt index fd50cf45..3bff5374 100755 --- a/News.txt +++ b/News.txt @@ -1,4 +1,15 @@ -0.9.3 for Linux, Mac and Windows (??? 2012) +0.9.4 for Linux, Mac and Windows (Fri Oct 19 2012) + + Hylke: + - Remove Nautilus extension + - Restore previous revisions of files from the event log + - Fix Mac file system watcher not always triggering + - Add symbolic icon for GNOME 3 (by Lapo) + - New Bitbucket and default user icon + - For encrypted projects, use a different salt for each project + + +0.9.3 for Linux, Mac and Windows (Mon Oct 1 2012) Hylke: - Fix endless loop when adding empty folders diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 126e8df2..b8da56a3 100755 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -76,13 +76,13 @@ namespace SparkleShare { this.syncing_idle_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-idle.png")); this.syncing_up_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-up.png")); this.syncing_down_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-down.png")); - this.syncing_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing.png")); + this.syncing_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing.png")); this.syncing_error_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-error.png")); this.syncing_idle_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-idle-active.png")); this.syncing_up_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-up-active.png")); this.syncing_down_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-down-active.png")); - this.syncing_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-active.png")); + this.syncing_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-active.png")); this.syncing_error_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-error-active.png")); this.status_item.Image = this.syncing_idle_image; diff --git a/SparkleShare/Windows/SparkleEventLog.cs b/SparkleShare/Windows/SparkleEventLog.cs index c4722c76..9f6aa473 100644 --- a/SparkleShare/Windows/SparkleEventLog.cs +++ b/SparkleShare/Windows/SparkleEventLog.cs @@ -105,7 +105,6 @@ namespace SparkleShare { this.web_browser.ObjectForScripting = new SparkleScriptingObject (); - spinner = new SparkleSpinner (22); // Disable annoying IE clicking sound From 00cfe9aa8f11ab25bc1d6e9d9ae2c9128776b07d Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 19 Oct 2012 21:55:09 +0100 Subject: [PATCH 21/22] fix typo --- SparkleShare/Mac/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleShare/Mac/README.md b/SparkleShare/Mac/README.md index 464b71a0..aa6b0406 100644 --- a/SparkleShare/Mac/README.md +++ b/SparkleShare/Mac/README.md @@ -83,5 +83,5 @@ SparkleShare/Windows/SparkleShare.wxs ### Uninstalling -Simple remove the SparkleShare bundle. +Simply remove the SparkleShare bundle. From d80abc3070c90e06b73dc3b9a68c3ac1135936bd Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 19 Oct 2012 23:42:27 +0100 Subject: [PATCH 22/22] fetcher git: fix crypto salt lookup --- SparkleLib/Git/SparkleFetcherGit.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 914ab654..58735308 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -40,6 +40,8 @@ namespace SparkleLib.Git { // Check if the repo's salt is stored in a branch... SparkleGit git = new SparkleGit (TargetFolder, "branch -a"); + git.StartAndWaitForExit (); + string [] branches = git.StartAndReadStandardOutput ().Split (Environment.NewLine.ToCharArray ()); // TODO double check env.newline ^