From b54ac8b25995ab10032405ef96da827fceb9f5bc Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Tue, 7 Jun 2011 14:39:35 -0600 Subject: [PATCH 01/43] fixing upstream issue 200 --- SparkleLib/SparkleConfig.cs | 6 +++++- po/ja.po | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index 614d1fb9..0bbbdab4 100644 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -62,7 +62,11 @@ namespace SparkleLib { SparkleBackend.Platform == PlatformID.MacOSX) { user_name = new UnixUserInfo (UnixEnvironment.UserName).RealName; - user_name = user_name.TrimEnd (",".ToCharArray()); + if (string.IsNullOrEmpty (user_name)) { + user_name = UnixEnvironment.UserName; + } else { + user_name = user_name.TrimEnd (",".ToCharArray()); + } } else { user_name = Environment.UserName; diff --git a/po/ja.po b/po/ja.po index 9ec158ec..74784962 100644 --- a/po/ja.po +++ b/po/ja.po @@ -289,7 +289,7 @@ msgstr "フォルダ'{0}'の同期中..." #: ../SparkleShare/SparkleIntro.cs:568 msgid "This may take a while.\n" -msgstr "しばらくお待ちください。" +msgstr "しばらくお待ちください。\n" #: ../SparkleShare/SparkleIntro.cs:569 msgid "Are you sure it’s not coffee o'clock?" From 267987763cb235c5187643936ec802827d3723ea Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Thu, 9 Jun 2011 10:21:55 -0600 Subject: [PATCH 02/43] removing is_polling completely --- SparkleLib/SparkleRepoBase.cs | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index cf9d5ac6..883e0338 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -46,7 +46,6 @@ namespace SparkleLib { protected SyncStatus status; protected bool is_buffering = false; - protected bool is_polling = true; protected bool server_online = true; public readonly SparkleBackend Backend; @@ -96,7 +95,7 @@ namespace SparkleLib { }; this.remote_timer.Elapsed += delegate { - if (this.is_polling) { + if (!this.listener.IsConnected) { if (CheckForRemoteChanges ()) SyncDownBase (); } @@ -192,13 +191,6 @@ namespace SparkleLib { } - public bool IsPolling { - get { - return this.is_polling; - } - } - - // Disposes all resourses of this object public void Dispose () { @@ -230,8 +222,6 @@ namespace SparkleLib { // Stop polling when the connection to the irc channel is succesful this.listener.Connected += delegate { - this.is_polling = false; - // Check for changes manually one more time if (CheckForRemoteChanges ()) SyncDownBase (); @@ -244,7 +234,6 @@ namespace SparkleLib { // Start polling when the connection to the irc channel is lost this.listener.Disconnected += delegate { SparkleHelpers.DebugInfo (Name, "Falling back to polling"); - this.is_polling = true; }; // Fetch changes when there is a message in the irc channel @@ -262,12 +251,11 @@ namespace SparkleLib { } } }; - + // Start listening - if (!this.listener.IsConnected && !this.listener.IsConnecting) + if (!this.listener.IsConnected && !this.listener.IsConnecting) { this.listener.Connect (); - else - this.is_polling = false; + } } From 5b9455b73ebd857a4ae50e0752fb79a703f183aa Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 9 Jun 2011 18:53:36 +0100 Subject: [PATCH 03/43] repo base: add some properties to be used for the manual polling --- SparkleLib/SparkleConfig.cs | 5 ++--- SparkleLib/SparkleRepoBase.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index 0bbbdab4..88f99835 100644 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -62,11 +62,10 @@ namespace SparkleLib { SparkleBackend.Platform == PlatformID.MacOSX) { user_name = new UnixUserInfo (UnixEnvironment.UserName).RealName; - if (string.IsNullOrEmpty (user_name)) { + if (string.IsNullOrEmpty (user_name)) user_name = UnixEnvironment.UserName; - } else { + else user_name = user_name.TrimEnd (",".ToCharArray()); - } } else { user_name = Environment.UserName; diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 883e0338..96a70ac2 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -34,15 +34,15 @@ namespace SparkleLib { public abstract class SparkleRepoBase { - - - private Timer local_timer = new Timer () { Interval = 250 }; - private Timer remote_timer = new Timer () { Interval = 60000 }; private FileSystemWatcher watcher; private SparkleListenerBase listener; + private Timer local_timer = new Timer () { Interval = 250 }; + private Timer remote_timer = new Timer () { Interval = 60000 }; + private DateTime last_poll = DateTime.Now; + private TimeSpan poll_interval = new TimeSpan (0, 0, 10, 0); private List sizebuffer = new List (); - private bool has_changed = false; - private Object change_lock = new Object (); + private bool has_changed = false; + private Object change_lock = new Object (); protected SyncStatus status; protected bool is_buffering = false; From 18ec890574cfa83646e1a521a00302bc526738e6 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 9 Jun 2011 21:20:57 +0100 Subject: [PATCH 04/43] repo base: poll continously even when connected (but not as frequent) --- SparkleLib/SparkleRepoBase.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 96a70ac2..a390aaed 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -36,8 +36,8 @@ namespace SparkleLib { private FileSystemWatcher watcher; private SparkleListenerBase listener; - private Timer local_timer = new Timer () { Interval = 250 }; - private Timer remote_timer = new Timer () { Interval = 60000 }; + private Timer local_timer = new Timer () { Interval = 0.25 * 1000 }; + private Timer remote_timer = new Timer () { Interval = 10 * 1000 }; private DateTime last_poll = DateTime.Now; private TimeSpan poll_interval = new TimeSpan (0, 0, 10, 0); private List sizebuffer = new List (); @@ -95,7 +95,12 @@ namespace SparkleLib { }; this.remote_timer.Elapsed += delegate { - if (!this.listener.IsConnected) { + bool time_to_poll = (DateTime.Compare (this.last_poll, + DateTime.Now.Subtract (this.poll_interval)) < 0); + + if (!this.listener.IsConnected || time_to_poll) { + this.last_poll = DateTime.Now; + if (CheckForRemoteChanges ()) SyncDownBase (); } @@ -222,6 +227,9 @@ namespace SparkleLib { // Stop polling when the connection to the irc channel is succesful this.listener.Connected += delegate { + this.poll_interval = new TimeSpan (0, 0, 10, 0); + this.last_poll = DateTime.Now; + // Check for changes manually one more time if (CheckForRemoteChanges ()) SyncDownBase (); @@ -233,6 +241,7 @@ namespace SparkleLib { // Start polling when the connection to the irc channel is lost this.listener.Disconnected += delegate { + this.poll_interval = new TimeSpan (0, 0, 3, 0); SparkleHelpers.DebugInfo (Name, "Falling back to polling"); }; From 911a1f941a0257ef114705a7aa2b7fef834e0149 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 9 Jun 2011 21:25:36 +0100 Subject: [PATCH 05/43] changeset: Add a Folder property --- SparkleLib/Git/SparkleRepoGit.cs | 3 +-- SparkleLib/SparkleChangeSet.cs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 3a611caa..0df0877c 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -405,18 +405,17 @@ namespace SparkleLib { if (match.Success) { SparkleChangeSet change_set = new SparkleChangeSet (); + change_set.Folder = Name; change_set.Revision = match.Groups [1].Value; change_set.UserName = match.Groups [2].Value; change_set.UserEmail = match.Groups [3].Value; change_set.IsMerge = is_merge_commit; - change_set.Timestamp = new DateTime (int.Parse (match.Groups [4].Value), int.Parse (match.Groups [5].Value), int.Parse (match.Groups [6].Value), int.Parse (match.Groups [7].Value), int.Parse (match.Groups [8].Value), int.Parse (match.Groups [9].Value)); - string time_zone = match.Groups [10].Value; int our_offset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now).Hours; int their_offset = int.Parse (time_zone.Substring (1, 2)); diff --git a/SparkleLib/SparkleChangeSet.cs b/SparkleLib/SparkleChangeSet.cs index 70baabb1..9bcd66b9 100644 --- a/SparkleLib/SparkleChangeSet.cs +++ b/SparkleLib/SparkleChangeSet.cs @@ -24,6 +24,7 @@ namespace SparkleLib { public string UserName; public string UserEmail; + public string Folder; public string Revision; public DateTime Timestamp; public bool IsMerge = false; From a07e0a6b8d196823761669296d965243d9cbd98f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 9 Jun 2011 23:59:56 +0100 Subject: [PATCH 06/43] repo: don't poll every 10sec when disconnected --- SparkleLib/SparkleRepoBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index a390aaed..878db41d 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -98,7 +98,7 @@ namespace SparkleLib { bool time_to_poll = (DateTime.Compare (this.last_poll, DateTime.Now.Subtract (this.poll_interval)) < 0); - if (!this.listener.IsConnected || time_to_poll) { + if (time_to_poll) { this.last_poll = DateTime.Now; if (CheckForRemoteChanges ()) From c16b2cb420d2e0050b46924780d53e5880eff102 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 00:01:45 +0100 Subject: [PATCH 07/43] Save work --- SparkleLib/Git/SparkleRepoGit.cs | 3 +++ SparkleShare/Mac/SparkleUI.cs | 1 + SparkleShare/SparkleController.cs | 19 +++++++++++++++++-- SparkleShare/SparkleUI.cs | 5 ++++- data/html/event-entry.html | 5 ++--- data/html/event-log.html | 2 +- 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 0df0877c..94b464c7 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -444,10 +444,13 @@ namespace SparkleLib { if (change_type.Equals ("A")) { change_set.Added.Add (file_path); + } else if (change_type.Equals ("M")) { change_set.Edited.Add (file_path); + } else if (change_type.Equals ("D")) { change_set.Deleted.Add (file_path); + } else if (change_type.Equals ("R")) { int tab_pos = entry_line.LastIndexOf ("\t"); file_path = entry_line.Substring (42, tab_pos - 42); diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index a923bce2..0a57636b 100644 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -63,6 +63,7 @@ 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"); diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index e6be1fc5..e5874bca 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Net; using System.Security.Cryptography; using System.Text; @@ -240,8 +241,22 @@ namespace SparkleShare { } } - - public List GetLog (string name) + + public List GetLog () + {Console.WriteLine ("PPPPPPPPPPP"); + List list = new List (); + + foreach (SparkleRepoBase repo in Repositories) { + list.AddRange (repo.GetChangeSets (10)); + Console.WriteLine (">>>" + repo.Name); + } + + list.Sort ((x, y) => (x.Timestamp.CompareTo (y.Timestamp))); + return list; + } + + + public List GetLog (string name) { string path = Path.Combine (SparklePaths.SparklePath, name); int log_size = 30; diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index abc506f7..8eeaafc4 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -47,8 +47,11 @@ namespace SparkleShare { public SparkleUI () { // Initialize the application - Application.Init (); + Application.Init ();Console.WriteLine ("OOOOOOOOO"); + foreach (SparkleChangeSet change_set in SparkleShare.Controller.GetLog ()) { + Console.WriteLine (change_set.Timestamp.ToString ()); + } // Create the statusicon StatusIcon = new SparkleStatusIcon (); diff --git a/data/html/event-entry.html b/data/html/event-entry.html index fbeed413..4abcd5ff 100644 --- a/data/html/event-entry.html +++ b/data/html/event-entry.html @@ -1,6 +1,6 @@
-
+
@@ -11,10 +11,9 @@
-
+
gnome-design •
-
diff --git a/data/html/event-log.html b/data/html/event-log.html index a595ea83..70f4529c 100644 --- a/data/html/event-log.html +++ b/data/html/event-log.html @@ -61,7 +61,7 @@ margin-right: auto; margin-bottom: 9px; padding: 18px; - -webkit-border-radius: 6px; + -webkit-border-radius: 6px 6px 0 0; border: #ddd 1px solid; } From 06a7e2645491584db9e8336665341a74ad00086b Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 01:01:45 +0100 Subject: [PATCH 08/43] Assign colors to folders --- SparkleShare/Mac/SparkleLog.cs | 4 +-- SparkleShare/SparkleController.cs | 41 ++++++++++++++++++++++--------- data/html/event-entry.html | 4 +-- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/SparkleShare/Mac/SparkleLog.cs b/SparkleShare/Mac/SparkleLog.cs index 5bab464a..248ce428 100644 --- a/SparkleShare/Mac/SparkleLog.cs +++ b/SparkleShare/Mac/SparkleLog.cs @@ -105,7 +105,7 @@ namespace SparkleShare { string name = Path.GetFileName (LocalPath); - Title = String.Format ("Events in ‘{0}’", name); + Title = "Recent Events"; Separator = new NSBox (new RectangleF (0, 58, 480, 1)) { BorderColor = NSColor.LightGray, @@ -152,7 +152,7 @@ namespace SparkleShare { private void GenerateHTML () { string folder_name = Path.GetFileName (LocalPath); - HTML = SparkleShare.Controller.GetHTMLLog (folder_name); + HTML = SparkleShare.Controller.GetHTMLLog (); HTML = HTML.Replace ("", "Lucida Grande"); HTML = HTML.Replace ("", "13.6px"); diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index e5874bca..11c84539 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -243,15 +243,15 @@ namespace SparkleShare { public List GetLog () - {Console.WriteLine ("PPPPPPPPPPP"); + { List list = new List (); - foreach (SparkleRepoBase repo in Repositories) { + foreach (SparkleRepoBase repo in Repositories) list.AddRange (repo.GetChangeSets (10)); - Console.WriteLine (">>>" + repo.Name); - } list.Sort ((x, y) => (x.Timestamp.CompareTo (y.Timestamp))); + list.Reverse (); + return list; } @@ -275,9 +275,9 @@ namespace SparkleShare { public abstract string EventEntryHTML { get; } - public string GetHTMLLog (string name) + public string GetHTMLLog () { - List change_sets = GetLog (name); + List change_sets = GetLog (); List activity_days = new List (); if (change_sets.Count == 0) @@ -325,7 +325,7 @@ namespace SparkleShare { foreach (string file_path in change_set.Edited) { string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, - name, file_path); + change_set.Folder, file_path); if (File.Exists (absolute_file_path)) event_entry += "
" + file_path + "
"; @@ -339,7 +339,7 @@ namespace SparkleShare { foreach (string file_path in change_set.Added) { string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, - name, file_path); + change_set.Folder, file_path); if (File.Exists (absolute_file_path)) event_entry += "
" + file_path + "
"; @@ -353,7 +353,7 @@ namespace SparkleShare { foreach (string file_path in change_set.Deleted) { string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, - name, file_path); + change_set.Folder, file_path); if (File.Exists (absolute_file_path)) event_entry += "
" + file_path + "
"; @@ -369,9 +369,9 @@ namespace SparkleShare { foreach (string file_path in change_set.MovedFrom) { string to_file_path = change_set.MovedTo [i]; string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, - name, file_path); + change_set.Folder, file_path); string absolute_to_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, - name, to_file_path); + change_set.Folder, to_file_path); if (File.Exists (absolute_file_path)) event_entry += "
" + file_path + "
" + @@ -394,7 +394,9 @@ namespace SparkleShare { event_entries += event_entry_html.Replace ("", event_entry) .Replace ("", change_set.UserName) .Replace ("", "file://" + GetAvatar (change_set.UserEmail, 36) ) - .Replace ("", change_set.Timestamp.ToString ("H:mm")); + .Replace ("", change_set.Timestamp.ToString ("H:mm")) + .Replace ("", change_set.Folder) + .Replace ("", AssignColor (change_set.Folder)); } string day_entry = ""; @@ -1030,6 +1032,21 @@ namespace SparkleShare { web_client.DownloadStringAsync (uri); } + + + private string [] tango_palette = new string [] {"#fce94f", "#edd400", + "#c4a000", "#8ae234", "#73d216", "#4e9a06", "#fcaf3e", "#f57900", + "#ce5c00", "#e9b96e", "#c17d11", "#8f5902", "#729fcf", "#3465a4", + "#204a87", "#ad7fa8", "#75507b", "#5c3566", "#888a85", "#555753", + "#2e3436", "#ef2929", "#cc0000", "#a40000"}; + + private string AssignColor (string s) + { + string hash = GetMD5 (s).Substring (0, 6); + string numbers = Regex.Replace (hash, "[a-z]", ""); + int number = int.Parse (numbers); + return this.tango_palette [number % this.tango_palette.Length]; + } } diff --git a/data/html/event-entry.html b/data/html/event-entry.html index 4abcd5ff..38aad61c 100644 --- a/data/html/event-entry.html +++ b/data/html/event-entry.html @@ -1,6 +1,6 @@
-
+
@@ -11,7 +11,7 @@
-
gnome-design •
+
From d657edf783da2ed4294639d60d236d34a392f5d9 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 02:32:36 +0100 Subject: [PATCH 09/43] add popupbutton and show most recent --- SparkleShare/Mac/SparkleLog.cs | 50 +++++++++++-------------------- SparkleShare/SparkleController.cs | 7 +++-- 2 files changed, 22 insertions(+), 35 deletions(-) diff --git a/SparkleShare/Mac/SparkleLog.cs b/SparkleShare/Mac/SparkleLog.cs index 248ce428..03970d53 100644 --- a/SparkleShare/Mac/SparkleLog.cs +++ b/SparkleShare/Mac/SparkleLog.cs @@ -16,6 +16,7 @@ using System; +using System.Collections.Generic; using System.Drawing; using System.IO; using System.Threading; @@ -24,6 +25,7 @@ using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.ObjCRuntime; using MonoMac.WebKit; +using SparkleLib; // Only used for SparkleChangeSet namespace SparkleShare { @@ -32,12 +34,11 @@ namespace SparkleShare { public readonly string LocalPath; private WebView WebView; - private NSButton CloseButton; - private NSButton OpenFolderButton; private NSBox Separator; private string HTML; + private NSPopUpButton popup_button; private NSProgressIndicator ProgressIndicator; - + private List change_sets = SparkleShare.Controller.GetLog (); public SparkleLog (IntPtr handle) : base (handle) { } @@ -76,44 +77,27 @@ namespace SparkleShare { private void CreateEventLog () { - OpenFolderButton = new NSButton (new RectangleF (16, 12, 120, 32)) { - Title = "Open Folder", - BezelStyle = NSBezelStyle.Rounded , - Font = SparkleUI.Font - }; - - OpenFolderButton.Activated += delegate { - SparkleShare.Controller.OpenSparkleShareFolder (LocalPath); - }; - - ContentView.AddSubview (OpenFolderButton); - - - CloseButton = new NSButton (new RectangleF (480 - 120 - 16, 12, 120, 32)) { - Title = "Close", - BezelStyle = NSBezelStyle.Rounded, - Font = SparkleUI.Font - }; - - CloseButton.Activated += delegate { - InvokeOnMainThread (delegate { - PerformClose (this); - }); - }; - - ContentView.AddSubview (CloseButton); - - string name = Path.GetFileName (LocalPath); Title = "Recent Events"; - Separator = new NSBox (new RectangleF (0, 58, 480, 1)) { + Separator = new NSBox (new RectangleF (0, 559, 480, 1)) { BorderColor = NSColor.LightGray, BoxType = NSBoxType.NSBoxCustom }; ContentView.AddSubview (Separator); + this.popup_button = new NSPopUpButton (new RectangleF (100, 570, 200, 26), false); + this.popup_button.AddItem ("All Folders"); + this.popup_button.Menu.AddItem (NSMenuItem.SeparatorItem); + this.popup_button.AddItems (SparkleShare.Controller.Folders.ToArray ()); + + + this.popup_button.Activated += delegate { + Console.WriteLine (this.popup_button.SelectedItem.Title); + }; + + ContentView.AddSubview (this.popup_button); ProgressIndicator = new NSProgressIndicator () { Style = NSProgressIndicatorStyle.Spinning, @@ -122,7 +106,7 @@ namespace SparkleShare { ProgressIndicator.StartAnimation (this); - WebView = new WebView (new RectangleF (0, 59, 480, 559), "", ""){ + WebView = new WebView (new RectangleF (0, 0, 480, 559), "", ""){ PolicyDelegate = new SparkleWebPolicyDelegate () }; diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 11c84539..f6b1e303 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -247,12 +247,15 @@ namespace SparkleShare { List list = new List (); foreach (SparkleRepoBase repo in Repositories) - list.AddRange (repo.GetChangeSets (10)); + list.AddRange (repo.GetChangeSets (30)); list.Sort ((x, y) => (x.Timestamp.CompareTo (y.Timestamp))); list.Reverse (); - return list; + if (list.Count > 50) + return list.GetRange (0, 50); + else + return list.GetRange (0, list.Count); } From 30dd767260c0b68119a834ad8f04c048caf0a0b1 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 02:50:41 +0100 Subject: [PATCH 10/43] Adjust status menu --- SparkleShare/Mac/SparkleStatusIcon.cs | 52 ++++++++++++++++----------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 357c3f40..8ba9c4fd 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -43,6 +43,7 @@ namespace SparkleShare { private NSMenuItem SyncMenuItem; private NSMenuItem AboutMenuItem; private NSMenuItem NotificationsMenuItem; + private NSMenuItem RecentEventsMenuItem; private delegate void Task (); private EventHandler [] Tasks; @@ -152,6 +153,33 @@ namespace SparkleShare { Menu.AddItem (StateMenuItem); Menu.AddItem (NSMenuItem.SeparatorItem); + RecentEventsMenuItem = new NSMenuItem () { + Title = "Show Recent Events" + }; + + RecentEventsMenuItem.Activated +=delegate { + InvokeOnMainThread (delegate { + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + string path = "test"; + SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { + return l.LocalPath.Equals (path); + }); + + // Check whether the log is already open, create a new one if + // that's not the case or present it to the user if it is + if (log == null) { + SparkleUI.OpenLogs.Add (new SparkleLog (path)); + SparkleUI.OpenLogs [SparkleUI.OpenLogs.Count - 1].MakeKeyAndOrderFront (this); + } else { + log.OrderFrontRegardless (); + log.MakeKeyAndOrderFront (this); + } + }); + }; + + Menu.AddItem (RecentEventsMenuItem); + Menu.AddItem (NSMenuItem.SeparatorItem); + FolderMenuItem = new NSMenuItem () { Title = "SparkleShare" }; @@ -176,7 +204,7 @@ namespace SparkleShare { foreach (string folder_name in SparkleShare.Controller.Folders) { NSMenuItem item = new NSMenuItem (); - item.Title = folder_name; + item.Title = folder_name; if (SparkleShare.Controller.UnsyncedFolders.Contains (folder_name)) item.Image = NSImage.ImageNamed ("NSCaution"); @@ -184,7 +212,7 @@ namespace SparkleShare { item.Image = NSImage.ImageNamed ("NSFolder"); item.Image.Size = new SizeF (16, 16); - Tasks [i] = OpenEventLogDelegate (folder_name); + Tasks [i] = OpenFolderDelegate (folder_name); FolderMenuItems [i] = item; FolderMenuItems [i].Activated += Tasks [i]; @@ -284,26 +312,10 @@ namespace SparkleShare { // A method reference that makes sure that opening the // event log for each repository works correctly - private EventHandler OpenEventLogDelegate (string path) + private EventHandler OpenFolderDelegate (string name) { return delegate { - InvokeOnMainThread (delegate { - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - - SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { - return l.LocalPath.Equals (path); - }); - - // Check whether the log is already open, create a new one if - // that's not the case or present it to the user if it is - if (log == null) { - SparkleUI.OpenLogs.Add (new SparkleLog (path)); - SparkleUI.OpenLogs [SparkleUI.OpenLogs.Count - 1].MakeKeyAndOrderFront (this); - } else { - log.OrderFrontRegardless (); - log.MakeKeyAndOrderFront (this); - } - }); + SparkleShare.Controller.OpenSparkleShareFolder (name); }; } From 944a9c4a46746e2d4256567f8bfa087442779a2d Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 11:08:03 -0700 Subject: [PATCH 11/43] default disconnected polling interval is 3min --- SparkleLib/SparkleRepoBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 878db41d..bac49759 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -39,7 +39,7 @@ namespace SparkleLib { private Timer local_timer = new Timer () { Interval = 0.25 * 1000 }; private Timer remote_timer = new Timer () { Interval = 10 * 1000 }; private DateTime last_poll = DateTime.Now; - private TimeSpan poll_interval = new TimeSpan (0, 0, 10, 0); + private TimeSpan poll_interval = new TimeSpan (0, 0, 3, 0); private List sizebuffer = new List (); private bool has_changed = false; private Object change_lock = new Object (); From 3920d42e283db30b64f0d59fac7a906934898635 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 21:26:26 +0100 Subject: [PATCH 12/43] update log style --- SparkleShare/Mac/SparkleLog.cs | 11 +++-- SparkleShare/Mac/SparkleStatusIcon.cs | 2 +- SparkleShare/SparkleController.cs | 37 ++++++--------- data/html/event-entry.html | 20 ++++----- data/html/event-log.html | 65 ++++++++++++++------------- 5 files changed, 65 insertions(+), 70 deletions(-) diff --git a/SparkleShare/Mac/SparkleLog.cs b/SparkleShare/Mac/SparkleLog.cs index 03970d53..1717d7bc 100644 --- a/SparkleShare/Mac/SparkleLog.cs +++ b/SparkleShare/Mac/SparkleLog.cs @@ -77,17 +77,17 @@ namespace SparkleShare { private void CreateEventLog () { - string name = Path.GetFileName (LocalPath); Title = "Recent Events"; - Separator = new NSBox (new RectangleF (0, 559, 480, 1)) { + Separator = new NSBox (new RectangleF (0, 573, 480, 1)) { BorderColor = NSColor.LightGray, BoxType = NSBoxType.NSBoxCustom }; ContentView.AddSubview (Separator); - this.popup_button = new NSPopUpButton (new RectangleF (100, 570, 200, 26), false); + this.popup_button = new NSPopUpButton (new RectangleF (480 - 156 - 8, 640 - 31 - 26, 156, 26), false); + //this.popup_button. this.popup_button.AddItem ("All Folders"); this.popup_button.Menu.AddItem (NSMenuItem.SeparatorItem); this.popup_button.AddItems (SparkleShare.Controller.Folders.ToArray ()); @@ -106,7 +106,7 @@ namespace SparkleShare { ProgressIndicator.StartAnimation (this); - WebView = new WebView (new RectangleF (0, 0, 480, 559), "", ""){ + WebView = new WebView (new RectangleF (0, 0, 480, 573 ), "", ""){ PolicyDelegate = new SparkleWebPolicyDelegate () }; @@ -135,8 +135,7 @@ namespace SparkleShare { private void GenerateHTML () { - string folder_name = Path.GetFileName (LocalPath); - HTML = SparkleShare.Controller.GetHTMLLog (); + HTML = SparkleShare.Controller.GetHTMLLog (); HTML = HTML.Replace ("", "Lucida Grande"); HTML = HTML.Replace ("", "13.6px"); diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 8ba9c4fd..81bd547d 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -154,7 +154,7 @@ namespace SparkleShare { Menu.AddItem (NSMenuItem.SeparatorItem); RecentEventsMenuItem = new NSMenuItem () { - Title = "Show Recent Events" + Title = "Recent Events" }; RecentEventsMenuItem.Activated +=delegate { diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index f6b1e303..8eb4edcc 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -320,54 +320,46 @@ namespace SparkleShare { string event_entry = "
"; if (change_set.IsMerge) { - event_entry += "
Merged a branch
"; + event_entry += "
Merged a branch
"; } else { if (change_set.Edited.Count > 0) { - event_entry += "
Edited
"; - foreach (string file_path in change_set.Edited) { string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, change_set.Folder, file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; else - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; } } if (change_set.Added.Count > 0) { - event_entry += "
Added
"; - foreach (string file_path in change_set.Added) { string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, change_set.Folder, file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; else - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; } } if (change_set.Deleted.Count > 0) { - event_entry += "
Deleted
"; - foreach (string file_path in change_set.Deleted) { string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, change_set.Folder, file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; else - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; } } if (change_set.MovedFrom.Count > 0) { - event_entry += "
Moved
"; - int i = 0; foreach (string file_path in change_set.MovedFrom) { string to_file_path = change_set.MovedTo [i]; @@ -377,10 +369,10 @@ namespace SparkleShare { change_set.Folder, to_file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
" + + event_entry += "
" + file_path + "
" + " "; else - event_entry += "
" + file_path + "
" + + event_entry += "
" + file_path + "
" + " "; if (File.Exists (absolute_to_file_path)) @@ -1037,15 +1029,14 @@ namespace SparkleShare { } - private string [] tango_palette = new string [] {"#fce94f", "#edd400", - "#c4a000", "#8ae234", "#73d216", "#4e9a06", "#fcaf3e", "#f57900", - "#ce5c00", "#e9b96e", "#c17d11", "#8f5902", "#729fcf", "#3465a4", - "#204a87", "#ad7fa8", "#75507b", "#5c3566", "#888a85", "#555753", - "#2e3436", "#ef2929", "#cc0000", "#a40000"}; + private string [] tango_palette = new string [] {"#eaab00", "#e37222", + "#3892ab", "#33c2cb", "#19b271", "#9eab05", "#8599a8", "#9ca696", + "#b88454", "#cc0033", "#8f6678", "#8c6cd0", "#796cbf", "#4060af", + "#aa9c8f", "#818a8f"}; private string AssignColor (string s) { - string hash = GetMD5 (s).Substring (0, 6); + string hash = GetMD5 (s).Substring (0, 8); string numbers = Regex.Replace (hash, "[a-z]", ""); int number = int.Parse (numbers); return this.tango_palette [number % this.tango_palette.Length]; diff --git a/data/html/event-entry.html b/data/html/event-entry.html index 38aad61c..f689b376 100644 --- a/data/html/event-entry.html +++ b/data/html/event-entry.html @@ -1,19 +1,19 @@
-
+
-
-
+ +
+
+
+
+
+ +
+
- -
- -
- -
-
diff --git a/data/html/event-log.html b/data/html/event-log.html index 70f4529c..b4f45ad3 100644 --- a/data/html/event-log.html +++ b/data/html/event-log.html @@ -4,7 +4,7 @@ SparkleShare Event Log From f3aca9da0ae84c4861b8b2af954c9c17ff21d942 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 21:40:13 +0100 Subject: [PATCH 13/43] repo git: strip quotes from git commit message --- SparkleLib/Git/SparkleRepoGit.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 0df0877c..382f6f21 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -198,7 +198,7 @@ namespace SparkleLib { if (!AnyDifferences) return; - SparkleGit git = new SparkleGit (LocalPath, "commit -m '" + message + "'"); + SparkleGit git = new SparkleGit (LocalPath, "commit -m \"" + message + "\""); git.Start (); git.WaitForExit (); @@ -530,6 +530,7 @@ namespace SparkleLib { return message + "..." + n; } + message = message.Replace ("\"", ""); return message.TrimEnd (); } From 4fdee4bf073d96280381bc32581260107e5f4d4e Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 11:08:03 -0700 Subject: [PATCH 14/43] default disconnected polling interval is 3min --- SparkleLib/SparkleRepoBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 878db41d..bac49759 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -39,7 +39,7 @@ namespace SparkleLib { private Timer local_timer = new Timer () { Interval = 0.25 * 1000 }; private Timer remote_timer = new Timer () { Interval = 10 * 1000 }; private DateTime last_poll = DateTime.Now; - private TimeSpan poll_interval = new TimeSpan (0, 0, 10, 0); + private TimeSpan poll_interval = new TimeSpan (0, 0, 3, 0); private List sizebuffer = new List (); private bool has_changed = false; private Object change_lock = new Object (); From 72f4052526f3d68489fbc3e0212bdf2950c3afa5 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 10 Jun 2011 21:40:13 +0100 Subject: [PATCH 15/43] repo git: strip quotes from git commit message --- SparkleLib/Git/SparkleRepoGit.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 94b464c7..d6d1e578 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -198,7 +198,7 @@ namespace SparkleLib { if (!AnyDifferences) return; - SparkleGit git = new SparkleGit (LocalPath, "commit -m '" + message + "'"); + SparkleGit git = new SparkleGit (LocalPath, "commit -m \"" + message + "\""); git.Start (); git.WaitForExit (); @@ -533,6 +533,7 @@ namespace SparkleLib { return message + "..." + n; } + message = message.Replace ("\"", ""); return message.TrimEnd (); } From f46a7969b02c4c8d8e1c8d744ba335c726374687 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 11 Jun 2011 02:51:04 +0100 Subject: [PATCH 16/43] log: revamp html+css and icons --- SparkleShare/Mac/SparkleLog.cs | 9 +- SparkleShare/Mac/SparkleShare.csproj | 20 +- SparkleShare/Mac/SparkleStatusIcon.cs | 2 +- SparkleShare/SparkleController.cs | 24 +- data/actions.svg | 1960 +++++++++++++++++++++++++ data/html/event-entry.html | 13 +- data/html/event-log.html | 39 +- data/icons/Makefile.am | 8 +- data/icons/document-added-12.png | Bin 0 -> 459 bytes data/icons/document-added-16.png | Bin 487 -> 0 bytes data/icons/document-deleted-12.png | Bin 0 -> 333 bytes data/icons/document-edited-12.png | Bin 0 -> 618 bytes data/icons/document-edited-16.png | Bin 610 -> 0 bytes data/icons/document-moved-12.png | Bin 0 -> 3182 bytes data/icons/document-moved-16.png | Bin 589 -> 0 bytes data/icons/document-removed-16.png | Bin 318 -> 0 bytes 16 files changed, 2036 insertions(+), 39 deletions(-) create mode 100644 data/actions.svg create mode 100644 data/icons/document-added-12.png delete mode 100644 data/icons/document-added-16.png create mode 100644 data/icons/document-deleted-12.png create mode 100644 data/icons/document-edited-12.png delete mode 100644 data/icons/document-edited-16.png create mode 100644 data/icons/document-moved-12.png delete mode 100644 data/icons/document-moved-16.png delete mode 100644 data/icons/document-removed-16.png diff --git a/SparkleShare/Mac/SparkleLog.cs b/SparkleShare/Mac/SparkleLog.cs index 1717d7bc..a8ca567f 100644 --- a/SparkleShare/Mac/SparkleLog.cs +++ b/SparkleShare/Mac/SparkleLog.cs @@ -117,7 +117,6 @@ namespace SparkleShare { public void UpdateEventLog () { InvokeOnMainThread (delegate { - if (HTML == null) ContentView.AddSubview (ProgressIndicator); }); @@ -147,6 +146,14 @@ namespace SparkleShare { HTML = HTML.Replace ("", "#009ff8"); HTML = HTML.Replace ("", "file://" + Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "avatar-default.png")); + HTML = HTML.Replace ("", + "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")); + HTML = HTML.Replace ("", + "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")); } diff --git a/SparkleShare/Mac/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare.csproj index 89c1e10f..31bc86d1 100644 --- a/SparkleShare/Mac/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare.csproj @@ -55,10 +55,6 @@ False - - False - ..\..\bin\SparkleLib.dll - False @@ -66,6 +62,10 @@ False ..\..\bin\Meebey.SmartIrc4net.dll + + False + ..\..\bin\SparkleLib.dll + @@ -158,6 +158,18 @@ Pixmaps\error-active.png + + Pixmaps\document-added-12.png + + + Pixmaps\document-edited-12.png + + + Pixmaps\document-deleted-12.png + + + Pixmaps\document-moved-12.png + diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 81bd547d..8c62892d 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -154,7 +154,7 @@ namespace SparkleShare { Menu.AddItem (NSMenuItem.SeparatorItem); RecentEventsMenuItem = new NSMenuItem () { - Title = "Recent Events" + Title = "Show Events" }; RecentEventsMenuItem.Activated +=delegate { diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 8eb4edcc..429def79 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -320,7 +320,7 @@ namespace SparkleShare { string event_entry = "
"; if (change_set.IsMerge) { - event_entry += "
Merged a branch
"; + event_entry += "
Did something magical
"; } else { if (change_set.Edited.Count > 0) { @@ -329,9 +329,9 @@ namespace SparkleShare { change_set.Folder, file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; else - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; } } @@ -341,9 +341,9 @@ namespace SparkleShare { change_set.Folder, file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; else - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; } } @@ -353,9 +353,9 @@ namespace SparkleShare { change_set.Folder, file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; else - event_entry += "
" + file_path + "
"; + event_entry += "
" + file_path + "
"; } } @@ -369,11 +369,9 @@ namespace SparkleShare { change_set.Folder, to_file_path); if (File.Exists (absolute_file_path)) - event_entry += "
" + file_path + "
" + - " "; + event_entry += "
" + file_path + "
"; else - event_entry += "
" + file_path + "
" + - " "; + event_entry += "
" + file_path + "
"; if (File.Exists (absolute_to_file_path)) event_entry += "" + to_file_path + "
"; @@ -388,7 +386,7 @@ namespace SparkleShare { event_entry += "
"; event_entries += event_entry_html.Replace ("", event_entry) .Replace ("", change_set.UserName) - .Replace ("", "file://" + GetAvatar (change_set.UserEmail, 36) ) + .Replace ("", "file://" + GetAvatar (change_set.UserEmail, 36)) .Replace ("", change_set.Timestamp.ToString ("H:mm")) .Replace ("", change_set.Folder) .Replace ("", AssignColor (change_set.Folder)); @@ -1038,7 +1036,7 @@ namespace SparkleShare { { string hash = GetMD5 (s).Substring (0, 8); string numbers = Regex.Replace (hash, "[a-z]", ""); - int number = int.Parse (numbers); + int number = 1 + int.Parse (numbers); return this.tango_palette [number % this.tango_palette.Length]; } } diff --git a/data/actions.svg b/data/actions.svg new file mode 100644 index 00000000..c349857c --- /dev/null +++ b/data/actions.svg @@ -0,0 +1,1960 @@ + + + + + Text Editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + Text Editor + + + text + editor + gedit + + + + + + + + + + + + + + + + + + + + + Lapo Calamandrei + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/html/event-entry.html b/data/html/event-entry.html index f689b376..f8643fac 100644 --- a/data/html/event-entry.html +++ b/data/html/event-entry.html @@ -3,12 +3,13 @@
-
-
-
-
-
- +
+
+
+
+
+
+
diff --git a/data/html/event-log.html b/data/html/event-log.html index b4f45ad3..f16f3573 100644 --- a/data/html/event-log.html +++ b/data/html/event-log.html @@ -27,7 +27,7 @@ font-size: ; color: #444; margin-bottom: 9px; - margin-left: 40px; + margin-left: 30px; } .day-entry-content { @@ -60,6 +60,7 @@ margin-right: auto; margin-bottom: 12px; padding: 0px; + padding-bottom: 6px; border: #ccc 1px solid; -webkit-border-radius: 0 0 3px 3px; } @@ -72,19 +73,37 @@ dd { width: 90%; overflow: hidden; - margin-left: 24px; text-overflow: ellipsis; - padding: 4px 0px; - border-bottom: 1px solid #ddd; - } - - dd:first-child { - padding-top: 12px; + padding: 0; + padding-top: 2px; + padding-bottom: 4px; + padding-left: 22px; + margin: 0; + margin-bottom: 2px; + margin-left: 12px; + border-bottom: 1px solid #ddd; + background-repeat: no-repeat; + background-position: center left; } dd:last-child { border: none; - padding-bottom: 12px; + } + + .document-added { + background-image: url(''); + } + + .document-deleted { + background-image: url(''); + } + + .document-edited { + background-image: url(''); + } + + .document-moved { + background-image: url(''); } .no-buddy-icon { @@ -105,10 +124,10 @@ .event-info { float: left; padding: 15px; + margin-bottom: 6px; width: 410px; background-color: #fff; border-bottom: 1px #ccc solid; - position: relative; } diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index fd621831..f23af747 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -25,10 +25,10 @@ app_theme_icons = \ status,avatar-default-24.png \ status,avatar-default-32.png \ status,avatar-default-48.png \ - status,document-added-16.png \ - status,document-edited-16.png \ - status,document-moved-16.png \ - status,document-removed-16.png \ + status,document-added-12.png \ + status,document-edited-12.png \ + status,document-deleted-12.png \ + status,document-moved-12.png \ status,dialog-error-16.png \ status,dialog-error-24.png diff --git a/data/icons/document-added-12.png b/data/icons/document-added-12.png new file mode 100644 index 0000000000000000000000000000000000000000..409867db248dcd372e41668dc0d0143add70b69e GIT binary patch literal 459 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kmSQK*5Dp-y;YjHK@;M7UB8!3Q zuY)k7lg8`{prB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt+NeMIo6b zIjIaGsTCy(t|^%%`9-!xiXi(%K$4E7B^mie3|@)ZrAZ3GC8?QtsYTCzf7b`fD?)52 zElN&h$S5f(u+rDh%FNA8OxDXSEzV5NNX*I6ORmaHdmIN;e9zOxF+^kH(n*GW%?1Ll z|M{l9Z7SaJKrCAEru%|hlb1f?SXa#K#g)Y+USeWqv{*!XamyN)jr*luzCLeL|8sS2 z^qy6jv*gp>F*J1iDwN4zZ}(6o?cJQ>sm1HG4z6}sy7ky5orGtvj0#i(XPn-)Yn^%8 zG=>FJZuJ;`e_mat^vX5yT9mlT&UM-h2cooF1sED6lArEVqDdCo^a5`+xP4dqc-J3FV@53XA@} k>9%Lu`~BY!sr3Jhamv|K?p8Wp0s54|)78&qol`;+0JJ`{?f?J) literal 0 HcmV?d00001 diff --git a/data/icons/document-added-16.png b/data/icons/document-added-16.png deleted file mode 100644 index 14fa8a363be1a929e0be7b6b90273e10cb395d51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 487 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igS{ z2`?{ZN`sF800C!7L_t(I%f(YYO9Md=eY>~093hI0y@FVXn8wyds|cxV1O*9p`Um6? zLYnJrZ2SXaWvOW67a}4eK~Rt+C@DnzN;EN=yW8Edh$%!4Ia4?=FfcRBn|W^-5uqL9 zXwyVcVtOl)^|faMK!lslYVtf23W29wdv<71%nU9FPq}tz1f(H+<>R_~0n)*Bfe45Q zHSY!G_XoIA{(ghWje)GIl&wh#(tssmjhb7rDj$!4VvXcl4}CEv0XW-Jr3?VD7LBR( zK7X_~B}^j~}U&Kt+NeMIo6b zIjIaGsTCy(t|^%%`9-!xiXi(%K$4E7B^mie3|@)ZrAZ3GC8?QtsYTCzf7b`fD?)52 zElN&h$S5f(u+rDh%FNA8OxDXSEzV5NNX*I6ORmaHdmIN;oZ#u=7@{#Txum>2U4hkL z;*wc~}U&Kt+NeMIo6b zIjIaGsTCy(t|^%%`9-!xiXi(%K$4E7B^mie3|@)ZrAZ3GC8?QtsYTCzf7b`fD?)52 zElN&h$S5f(u+rDh%FNA8OxDXSEzV5NNX*I6ORmaHdmP8Wz*y_);uxYav9{0NgDFv> zy?*}v~6p9pf$Z-6-nZv=tFWa?xp>0NP$FvO_*_N*;Td6urHgDz8i*I=XcTC|> zED6jM6t&go-y*Et=<-+s77 zU{ln}5WjySDUtj5SeOhwCtb)ene(*Bli@>rYlv3qG0T3YhQ}5&&ZZqP;JLl+ZS;A6 z3%UOH!Cu!dy)+SIVcfOu@cZx0LB9-U`n=m$+i^6heUZkyl+BUvD{R=F%k&t|SoU+p z>tC7-JDijzS_ruoYEM2{;l5aK*=5aFUw_Rhu8UtAw%*Q?so_b{&c^{7TNF=kDz}i? zwIOrX^tEBD|7>j%?LNwU>_(Z2(89lU_gi@n@6Zt8l44ksuV$a{XR+z85F1HgtTA}H`njxgN@xNAr)c_A literal 0 HcmV?d00001 diff --git a/data/icons/document-edited-16.png b/data/icons/document-edited-16.png deleted file mode 100644 index e0a9f97885c5f19ecb1318d980c0d847aaefba8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 610 zcmV-o0-gPdP)|6%;k@aG=`!-pR~86LcT&hU-r%VGuw0%33=jyYSG zUpP3>MVj%-liv(`E_`AT;^$-d_xj!y>0|dZ@w(tbJaZPSfJm20Kq%MWkIxvS89y^H zGchx8eSUBr zF=F9D9Ahe*fY?N3zhKV4pPn*&{l>}g^5lWD>%Av{{8fX;p=xUn9c2mi~l#{ z3M;q^xKuT2g!IBVnErlZ`1EoM!^@M0e*Av_vfFS8Zp{n~&{&vV=b`=OKc^zQyfx!5 zHerT$cW?as{r-86;gbLL_%y>^u*i{_%+r>`z^sNesG7>zJMbY{W@0H_|y&;I;sb^rhX07*qoM6N<$g4abVga7~l diff --git a/data/icons/document-moved-12.png b/data/icons/document-moved-12.png new file mode 100644 index 0000000000000000000000000000000000000000..dfe29d1d923a76d561e0d9df40d286d22bda4207 GIT binary patch literal 3182 zcmV-!43YDRP)EX>4Tx0C?J+Q+HUC_ZB|i_hk=OLfG)Jmu!ImA|tE_$Pihg5Rw34gb)%y#f69p zRumNxoJdu~g4GI0orvO~D7a@qiilc^Ra`jkAKa(4eR}Wh?fcjJyyu+f{LXpL4}cL8 zCXwc%Y5+M>g*-agACFH+#L2yY0u@N$1RxOR%fe>`#Q*^C19^CUbg)1C0k3ZW0swH; zE+i7i;s1lWP$pLZAdvvzA`<5d0gzGv$SzdK6adH=0I*ZDWC{S3003-xd_p1ssto|_ z^hrJi0NAOM+!p}Yq8zCR0F40vnJ7mj0zkU}U{!%qECRs70HCZuA}$2Lt^t5qwlYTo zfV~9(c8*w(4?ti5fSE!p%m5%b0suoE6U_r4Oaq`W(!b!TUvP!ENC5!A%azTSOVTqG zxRuZvck=My;vwR~Y_URN7by^C3FIQ2mzyIKNaq7g&I|wm8u`(|{y0C7=jP<$=4R(? z@ASo@{%i1WB0eGU-~POe0t5gMPS5Y!U*+Z218~Oyuywy{sapWrRsd+<`CT*H37}dE z(0cicc{uz)9-g64$UGe!3JVMEC1RnyFyo6p|1;rl;ER6t{6HT5+j{T-ahgDxt-zy$ z{c&M#cCJ#6=gR~_F>d$gBmT#QfBlXr(c(0*Tr3re@mPttP$EsodAU-NL?OwQ;u7h9 zGVvdl{RxwI4FIf$Pry#L2er#=z<%xl0*ek<(slqqe)BDi8VivC5N9+pdG`PSlfU_o zKq~;2Moa!tiTSO!5zH77Xo1hL_iEAz&sE_ z2IPPo3ZWR5K^auQI@koYumc*P5t`u;w81er4d>tzT!HIw7Y1M$p28Tsh6w~g$Osc* zAv%Z=Vvg7%&IlKojszlMNHmgwq#)^t6j36@$a16tsX}UzT}UJHEpik&ja)$bklV;0 zGK&0)yhkyVfwEBp)B<%txu_o+ipHRG(R4HqU4WLNYtb6C9zB4zqNmYI=yh}eeTt4_ zfYC7yW{lZkT#ScBV2M~7CdU?I?5=ix(HVZgM=}{CnA%mPqZa^68Xe5gFH?u96Et<2 zCC!@_L(8Nsqt(!wX=iEoXfNq>x(VHb9z~bXm(pwK2kGbOgYq4YG!XMxcgB zqf}$J#u<$v7REAV@mNCEa#jQDENhreVq3EL>`ZnA`x|yIdrVV9bE;;nW|3x{=5fsd z4#u(I@HyF>O3oq94bFQl11&!-vDRv>X03j$H`;pIzS?5#a_tuF>)P*iaGgM%ES>c_ zZ94aL3A#4AQM!e?+jYlFJ5+DSzi0S9#6BJCZ5(XZOGfi zTj0IRdtf>~J!SgN=>tB-J_4V5pNGDtz9Qc}z9W9tewls;{GR(e`pf-~_`l(K@)q$< z1z-We0p$U`ff|9c18V~x1epY-2Q>wa1-k|>3_cY?3<(WcA99m#z!&lx`C~KOXDpi0 z70L*m6G6C?@k ziR8rC#65}Qa{}jVnlqf_npBo_W3J`gqPZ95>CVfZcRX1&S&)1jiOPpx423?lIEROmG(H@JAFg?XogQlb;dIZPf{y+kr|S? zBlAsGMAqJ{&)IR=Ejg5&l$@hd4QZCNE7vf$D7Q~$D=U)?Nn}(WA6du22pZOfRS_cv~1-c(_QtNLti0-)8>m`6CO07JR*suu!$(^sg%jf zZm#rNxnmV!m1I@#YM0epR(~oNm0zrItf;Q|utvD%;#W>z)qM4NZQ9!2O1H}G>qzUQ z>u#*~S--DJy=p<#(1!30tsC);y-IHSJr>wyfLop*ExT zdYyk=%U1oZtGB+{Cfe4&-FJKQ4uc&PJKpb5^_C@dOYIJXG+^@gCvI%WcHjN%gI&kHifN$EH?V5MBa9S!3!a?Q1 zC*P)gd*e{(q0YnH!_D8Bf4B7r>qvPk(mKC&tSzH$pgp0z@92!9ogH2sN4~fJe(y2k zV|B+hk5`_cohUu=`Q(C=R&z?UQbnZ;IU-!xL z-sg{9@Vs#JBKKn3CAUkhJ+3`ResKNaNUvLO>t*-L?N>ambo5Q@JJIjcfBI^`)pOVQ z*DhV3dA;w(>>IakCfyvkCA#(acJ}QTcM9%I++BK)c(44v+WqPW`VZ=VwEnSWz-{38 zV8CF{!&wjS4he^z{*?dIhvCvk%tzHDMk9@nogW_?4H~`jWX_Y}r?RIL&&qyQ|9R_k ztLNYS;`>X_Sp3-V3;B!BzpiW0Go&&06c_Y_|vki9S*?%gm2^V zcqW(2A)QWxbB-_!K}6W^_heZX4hjszI7=iFnM$RC#bSZ!bPC`1K|}xm-}mtr9KeMv z%WxbAp6A^MLGWcf9zVT4Gz{YtfGYssUDv(wJTCwM&N$Sg+TL zD2k_=rv0F1v#F(0sjszK4YqA#KA&T^J2*NNMM0y{z;HN(<2Xaob)AyQ%>V#i0Bh!x UZg&POfB*mh07*qoM6N<$f=H_kXaE2J literal 0 HcmV?d00001 diff --git a/data/icons/document-moved-16.png b/data/icons/document-moved-16.png deleted file mode 100644 index 834f6a724048c8455d5eb9180a8ad7b4c854b127..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 589 zcmV-T0Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igS{ z2{0XF$J~(s00GTOL_t(I%f*vTNEC4x#()2D@(?NpvF%~43A2x-E%8zmwSvJ^$YK$M z&}Bi0tz(iX(bA#7sKZ9lWnmzqpgb8U36Z!%lvL#Qg<&cYN)YT4)9yOW&fB3ngl!}q zdd~0jm)ioc-*9R?2IHWe`yJHPF*_^ZRpq$?xnaltb!vw3LUU|e)1L)Ft*<2YkBD#$ExenlIZNgqJb*|(oyXt*ZYf%En`Oum4UW20dMHVcJ}45YqPEZ9%T z1Z#{)&DIub*EON(x-BBMQp*0iFrUepjTHg9h=@{ZJDq)|^JzBWh~NI(O2ik;{>l~q b?`!-H`D?eJYYwl500000NkvXXu0mjfWr`6P diff --git a/data/icons/document-removed-16.png b/data/icons/document-removed-16.png deleted file mode 100644 index 4695e878bd8aabada6934489a9387fab3c4ce086..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=f!eQwFr$;k>h z5@oYx(`J}@-f2ECcLs|>@9BRpAByferYPF@-GQ~Waa|%4- Date: Sat, 11 Jun 2011 18:51:13 +0100 Subject: [PATCH 17/43] ui: hook up event log and finish work --- .../Mac/{SparkleLog.cs => SparkleEventLog.cs} | 142 ++++++++++-------- SparkleShare/Mac/SparkleShare.csproj | 2 +- SparkleShare/Mac/SparkleStatusIcon.cs | 21 +-- SparkleShare/Mac/SparkleUI.cs | 39 ++--- SparkleShare/SparkleController.cs | 18 ++- data/html/event-entry.html | 10 +- data/html/event-log.html | 8 +- data/icons/document-moved-12.png | Bin 3182 -> 3173 bytes 8 files changed, 129 insertions(+), 111 deletions(-) rename SparkleShare/Mac/{SparkleLog.cs => SparkleEventLog.cs} (66%) diff --git a/SparkleShare/Mac/SparkleLog.cs b/SparkleShare/Mac/SparkleEventLog.cs similarity index 66% rename from SparkleShare/Mac/SparkleLog.cs rename to SparkleShare/Mac/SparkleEventLog.cs index a8ca567f..c5564257 100644 --- a/SparkleShare/Mac/SparkleLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.IO; using System.Threading; @@ -29,56 +30,46 @@ using SparkleLib; // Only used for SparkleChangeSet namespace SparkleShare { - public class SparkleLog : NSWindow { + public class SparkleEventLog : NSWindow { - public readonly string LocalPath; private WebView WebView; private NSBox Separator; private string HTML; private NSPopUpButton popup_button; private NSProgressIndicator ProgressIndicator; - private List change_sets = SparkleShare.Controller.GetLog (); + private List change_sets; + private string selected_log = null; - public SparkleLog (IntPtr handle) : base (handle) { } - - public SparkleLog (string path) : base () + public SparkleEventLog (IntPtr handle) : base (handle) { } + + public SparkleEventLog () : base () { - LocalPath = path; - - Delegate = new SparkleLogDelegate (); + Title = "Recent Events"; + Delegate = new SparkleEventsDelegate (); SetFrame (new RectangleF (0, 0, 480, 640), true); Center (); - - // Open slightly off center for each consecutive window - if (SparkleUI.OpenLogs.Count > 0) { - RectangleF offset = new RectangleF (Frame.X + (SparkleUI.OpenLogs.Count * 20), - Frame.Y - (SparkleUI.OpenLogs.Count * 20), Frame.Width, Frame.Height); - SetFrame (offset, true); - } - StyleMask = (NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Titled); MaxSize = new SizeF (480, 640); MinSize = new SizeF (480, 640); - HasShadow = true; + HasShadow = true; BackingType = NSBackingStore.Buffered; - CreateEventLog (); - UpdateEventLog (); - + CreateEvents (); + UpdateEvents (false); + UpdateChooser (); + OrderFrontRegardless (); } - private void CreateEventLog () + private void CreateEvents () { - Title = "Recent Events"; - Separator = new NSBox (new RectangleF (0, 573, 480, 1)) { BorderColor = NSColor.LightGray, BoxType = NSBoxType.NSBoxCustom @@ -86,44 +77,77 @@ namespace SparkleShare { ContentView.AddSubview (Separator); - this.popup_button = new NSPopUpButton (new RectangleF (480 - 156 - 8, 640 - 31 - 26, 156, 26), false); - //this.popup_button. - this.popup_button.AddItem ("All Folders"); - this.popup_button.Menu.AddItem (NSMenuItem.SeparatorItem); - this.popup_button.AddItems (SparkleShare.Controller.Folders.ToArray ()); - - - this.popup_button.Activated += delegate { - Console.WriteLine (this.popup_button.SelectedItem.Title); - }; - - ContentView.AddSubview (this.popup_button); - - ProgressIndicator = new NSProgressIndicator () { - Style = NSProgressIndicatorStyle.Spinning, - Frame = new RectangleF (Frame.Width / 2 - 10, Frame.Height / 2 + 10, 20, 20) - }; - - ProgressIndicator.StartAnimation (this); - WebView = new WebView (new RectangleF (0, 0, 480, 573 ), "", ""){ PolicyDelegate = new SparkleWebPolicyDelegate () }; + ProgressIndicator = new NSProgressIndicator () { + Style = NSProgressIndicatorStyle.Spinning, + Frame = new RectangleF (WebView.Frame.Width / 2 - 10, WebView.Frame.Height / 2 + 10, 20, 20) + }; + + ProgressIndicator.StartAnimation (this); Update (); } - public void UpdateEventLog () + public void UpdateChooser () { - InvokeOnMainThread (delegate { - if (HTML == null) - ContentView.AddSubview (ProgressIndicator); - }); + if (this.popup_button != null) + this.popup_button.RemoveFromSuperview (); + + this.popup_button = new NSPopUpButton () { + Frame = new RectangleF (480 - 156 - 8, 640 - 31 - 26, 156, 26), + PullsDown = false + }; + + this.popup_button.AddItem ("All Folders"); + this.popup_button.Menu.AddItem (NSMenuItem.SeparatorItem); + this.popup_button.AddItems (SparkleShare.Controller.Folders.ToArray ()); + + this.popup_button.Activated += delegate { + if (popup_button.IndexOfSelectedItem == 0) + this.selected_log = null; + else + this.selected_log = this.popup_button.SelectedItem.Title; + + UpdateEvents (false); + }; + + ContentView.AddSubview (this.popup_button); + } + + + public void UpdateEvents () + { + UpdateEvents (true); + } + + + public void UpdateEvents (bool silent) + { + if (!silent) { + InvokeOnMainThread (delegate { + if (WebView.Superview == ContentView) + WebView.RemoveFromSuperview (); + + ContentView.AddSubview (ProgressIndicator); + }); + } Thread thread = new Thread (new ThreadStart (delegate { using (NSAutoreleasePool pool = new NSAutoreleasePool ()) { + Stopwatch watch = new Stopwatch (); + watch.Start (); + this.change_sets = SparkleShare.Controller.GetLog (this.selected_log); GenerateHTML (); + watch.Stop (); + + // A short delay is less annoying than + // a flashing window + if (watch.ElapsedMilliseconds < 300 && !silent) + Thread.Sleep (300 - (int) watch.ElapsedMilliseconds); + AddHTML (); } })); @@ -134,7 +158,7 @@ namespace SparkleShare { private void GenerateHTML () { - HTML = SparkleShare.Controller.GetHTMLLog (); + HTML = SparkleShare.Controller.GetHTMLLog (this.change_sets); HTML = HTML.Replace ("", "Lucida Grande"); HTML = HTML.Replace ("", "13.6px"); @@ -160,24 +184,22 @@ namespace SparkleShare { private void AddHTML () { InvokeOnMainThread (delegate { - if (ProgressIndicator.Superview == ContentView) - ProgressIndicator.RemoveFromSuperview (); - - WebView.MainFrame.LoadHtmlString (HTML, new NSUrl ("")); - - ContentView.AddSubview (WebView); - Update (); + if (ProgressIndicator.Superview == ContentView) + ProgressIndicator.RemoveFromSuperview (); + WebView.MainFrame.LoadHtmlString (HTML, new NSUrl ("")); + ContentView.AddSubview (WebView); + Update (); }); } } - public class SparkleLogDelegate : NSWindowDelegate { + public class SparkleEventsDelegate : NSWindowDelegate { public override bool WindowShouldClose (NSObject sender) { - (sender as SparkleLog).OrderOut (this); + (sender as SparkleEventLog).OrderOut (this); return false; } } @@ -186,7 +208,7 @@ namespace SparkleShare { public class SparkleWebPolicyDelegate : WebPolicyDelegate { public override void DecidePolicyForNavigation (WebView web_view, NSDictionary action_info, - NSUrlRequest request, WebFrame frame, NSObject decision_token) + NSUrlRequest request, WebFrame frame, NSObject decision_token) { string file_path = request.Url.ToString (); file_path = file_path.Replace ("%20", " "); diff --git a/SparkleShare/Mac/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare.csproj index 31bc86d1..579e66b0 100644 --- a/SparkleShare/Mac/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare.csproj @@ -79,7 +79,6 @@ - @@ -90,6 +89,7 @@ + diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 8c62892d..16040dee 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -154,27 +154,16 @@ namespace SparkleShare { Menu.AddItem (NSMenuItem.SeparatorItem); RecentEventsMenuItem = new NSMenuItem () { - Title = "Show Events" + Title = "Show Recent Events" }; RecentEventsMenuItem.Activated +=delegate { InvokeOnMainThread (delegate { - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - string path = "test"; - SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { - return l.LocalPath.Equals (path); - }); + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - // Check whether the log is already open, create a new one if - // that's not the case or present it to the user if it is - if (log == null) { - SparkleUI.OpenLogs.Add (new SparkleLog (path)); - SparkleUI.OpenLogs [SparkleUI.OpenLogs.Count - 1].MakeKeyAndOrderFront (this); - } else { - log.OrderFrontRegardless (); - log.MakeKeyAndOrderFront (this); - } - }); + if (SparkleUI.EventLog == null) + SparkleUI.EventLog = new SparkleEventLog (); + }); }; Menu.AddItem (RecentEventsMenuItem); diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index 0a57636b..b888c43f 100644 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -51,7 +51,7 @@ namespace SparkleShare { public class SparkleUI : AppDelegate { public static SparkleStatusIcon StatusIcon; - public static List OpenLogs; + public static SparkleEventLog EventLog; public static SparkleIntro Intro; public static SparkleAbout About; public static NSFont Font; @@ -89,18 +89,15 @@ namespace SparkleShare { Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande", NSFontTraitMask.Condensed, 0, 13); - - OpenLogs = new List (); + StatusIcon = new SparkleStatusIcon (); } SparkleShare.Controller.NotificationRaised += delegate (string user_name, string user_email, string message, string repository_path) { InvokeOnMainThread (delegate { - foreach (SparkleLog log in OpenLogs) { - if (log.LocalPath.Equals (repository_path)) - log.UpdateEventLog (); - } + if (EventLog != null) + EventLog.UpdateEvents (); if (SparkleShare.Controller.NotificationsEnabled) { if (NSApplication.SharedApplication.DockTile.BadgeLabel == null) @@ -135,20 +132,28 @@ namespace SparkleShare { SparkleShare.Controller.AvatarFetched += delegate { InvokeOnMainThread (delegate { - foreach (SparkleLog log in SparkleUI.OpenLogs) - log.UpdateEventLog (); + if (EventLog != null) + EventLog.UpdateEvents (); }); }; - SparkleShare.Controller.OnIdle += delegate { - InvokeOnMainThread (delegate { - foreach (SparkleLog log in SparkleUI.OpenLogs) - log.UpdateEventLog (); - }); - }; - - + SparkleShare.Controller.OnIdle += delegate { + InvokeOnMainThread (delegate { + if (EventLog != null) + EventLog.UpdateEvents (); + }); + }; + + + SparkleShare.Controller.FolderListChanged += delegate { + InvokeOnMainThread (delegate { + if (EventLog != null) + EventLog.UpdateChooser (); + }); + }; + + if (SparkleShare.Controller.FirstRun) { Intro = new SparkleIntro (); Intro.ShowAccountForm (); diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 429def79..12c0e8ba 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -247,13 +247,13 @@ namespace SparkleShare { List list = new List (); foreach (SparkleRepoBase repo in Repositories) - list.AddRange (repo.GetChangeSets (30)); + list.AddRange (repo.GetChangeSets (50)); list.Sort ((x, y) => (x.Timestamp.CompareTo (y.Timestamp))); list.Reverse (); - if (list.Count > 50) - return list.GetRange (0, 50); + if (list.Count > 100) + return list.GetRange (0, 100); else return list.GetRange (0, list.Count); } @@ -261,8 +261,11 @@ namespace SparkleShare { public List GetLog (string name) { + if (name == null) + return GetLog (); + string path = Path.Combine (SparklePaths.SparklePath, name); - int log_size = 30; + int log_size = 50; foreach (SparkleRepoBase repo in Repositories) { if (repo.LocalPath.Equals (path)) @@ -278,10 +281,9 @@ namespace SparkleShare { public abstract string EventEntryHTML { get; } - public string GetHTMLLog () + public string GetHTMLLog (List change_sets) { - List change_sets = GetLog (); - List activity_days = new List (); + List activity_days = new List (); if (change_sets.Count == 0) return null; @@ -1036,7 +1038,7 @@ namespace SparkleShare { { string hash = GetMD5 (s).Substring (0, 8); string numbers = Regex.Replace (hash, "[a-z]", ""); - int number = 1 + int.Parse (numbers); + int number = 3 + int.Parse (numbers); return this.tango_palette [number % this.tango_palette.Length]; } } diff --git a/data/html/event-entry.html b/data/html/event-entry.html index f8643fac..1ede4727 100644 --- a/data/html/event-entry.html +++ b/data/html/event-entry.html @@ -1,20 +1,16 @@
-
- -
-
+

-
+
- - +
diff --git a/data/html/event-log.html b/data/html/event-log.html index f16f3573..fc3f6252 100644 --- a/data/html/event-log.html +++ b/data/html/event-log.html @@ -44,6 +44,7 @@ } .event-time { + opacity: 0.8; font-size: 80%; color: #fff; float: right; @@ -62,9 +63,12 @@ padding: 0px; padding-bottom: 6px; border: #ccc 1px solid; - -webkit-border-radius: 0 0 3px 3px; } - + + .wrapper { + float: left; + } + dl { padding : 0; margin: 0; diff --git a/data/icons/document-moved-12.png b/data/icons/document-moved-12.png index dfe29d1d923a76d561e0d9df40d286d22bda4207..50f4fb32bb8f458879fd6247b54c2cf2e2caa36d 100644 GIT binary patch delta 460 zcmV;-0W<#Y808qSqzZpE4KXg@(EtDeqe(XG=s&oleVcb7jZCCVy{GZ^KuA3At8hb;1+-dU`<3%0G_0j-+bTyjtlT#;rm=Jr-^F`Fma0vDs|EIiF3Z)93$g;#}Ca{d&LO-=))O1%MaFv1FA> z<(;akH;SU*a5#TtN~Ka9MbST{nWp(FlgX6Y?KXD1-CIRb-ZY!dfV$mowOA~EYPDJj zf&i=43diH|;?0I(pwsDKGMOL@!>{Bx4iyT8dtKKx+qPjC1{h;67MIOt!5G7EI0ONJ z<2aYsl=m%_DL4ZU6up66k?Ts{)6q~GsW0Go&&06c_Y_|vki9S*?%gl~W2@pvYe%ORakgL95B z3_(QL@AqU`77hvw!#GPM5}8V+g2iHi>2wO;_d!Ge0N?lV797BZEX!~l2cGBM2SM;< zJRU#2J~RyD6M!oK-(Am*6izkeVc3YW`ev|26n`+dx2vpd3(wA)SX&(&)6veW6H*Xv<2ncNZ4 zwQ#IJ5QOt$v53K7@HcFlX26aWluD&%+qN^S)#@8#?8Y?B003S9Yvz+~cLpqg00000 LNkvXXu0mjfySCUM From a728cbdcaf875856860b3d251856a5bb21810454 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 11 Jun 2011 19:13:45 +0100 Subject: [PATCH 18/43] events: fix window focus --- SparkleShare/Mac/SparkleEventLog.cs | 2 +- SparkleShare/Mac/SparkleStatusIcon.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index c5564257..62a5a5f9 100644 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -32,7 +32,6 @@ namespace SparkleShare { public class SparkleEventLog : NSWindow { - private WebView WebView; private NSBox Separator; private string HTML; @@ -41,6 +40,7 @@ namespace SparkleShare { private List change_sets; private string selected_log = null; + public SparkleEventLog (IntPtr handle) : base (handle) { } public SparkleEventLog () : base () diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 16040dee..7e987e7a 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -163,6 +163,9 @@ namespace SparkleShare { if (SparkleUI.EventLog == null) SparkleUI.EventLog = new SparkleEventLog (); + + SparkleUI.EventLog.OrderFrontRegardless (); + SparkleUI.EventLog.MakeKeyAndOrderFront (this); }); }; From ff3e9f76304494781a9dc628d86913e447100770 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 11 Jun 2011 20:40:29 +0100 Subject: [PATCH 19/43] statusicon: rearrange menu a bit so it looks less messy --- SparkleShare/Mac/SparkleStatusIcon.cs | 61 +++++++++++++-------------- SparkleShare/Mac/SparkleUI.cs | 2 +- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 7e987e7a..7e3935c0 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -44,6 +44,7 @@ namespace SparkleShare { private NSMenuItem AboutMenuItem; private NSMenuItem NotificationsMenuItem; private NSMenuItem RecentEventsMenuItem; + private NSMenuItem QuitMenuItem; private delegate void Task (); private EventHandler [] Tasks; @@ -150,26 +151,7 @@ namespace SparkleShare { Title = StateText }; - Menu.AddItem (StateMenuItem); - Menu.AddItem (NSMenuItem.SeparatorItem); - - RecentEventsMenuItem = new NSMenuItem () { - Title = "Show Recent Events" - }; - - RecentEventsMenuItem.Activated +=delegate { - InvokeOnMainThread (delegate { - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - - if (SparkleUI.EventLog == null) - SparkleUI.EventLog = new SparkleEventLog (); - - SparkleUI.EventLog.OrderFrontRegardless (); - SparkleUI.EventLog.MakeKeyAndOrderFront (this); - }); - }; - - Menu.AddItem (RecentEventsMenuItem); + Menu.AddItem (StateMenuItem); Menu.AddItem (NSMenuItem.SeparatorItem); FolderMenuItem = new NSMenuItem () { @@ -253,6 +235,23 @@ namespace SparkleShare { Menu.AddItem (SyncMenuItem); Menu.AddItem (NSMenuItem.SeparatorItem); + RecentEventsMenuItem = new NSMenuItem () { + Title = "Show Recent Events" + }; + + RecentEventsMenuItem.Activated +=delegate { + InvokeOnMainThread (delegate { + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + + if (SparkleUI.EventLog == null) + SparkleUI.EventLog = new SparkleEventLog (); + + SparkleUI.EventLog.OrderFrontRegardless (); + SparkleUI.EventLog.MakeKeyAndOrderFront (this); + }); + }; + + Menu.AddItem (RecentEventsMenuItem); NotificationsMenuItem = new NSMenuItem (); @@ -275,28 +274,28 @@ namespace SparkleShare { Menu.AddItem (NotificationsMenuItem); Menu.AddItem (NSMenuItem.SeparatorItem); - AboutMenuItem = new NSMenuItem () { Title = "About SparkleShare" }; - AboutMenuItem.Activated += delegate { - InvokeOnMainThread (delegate { - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + AboutMenuItem.Activated += delegate { + InvokeOnMainThread (delegate { + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - if (SparkleUI.About == null) - SparkleUI.About = new SparkleAbout (); + if (SparkleUI.About == null) + SparkleUI.About = new SparkleAbout (); - SparkleUI.About.OrderFrontRegardless (); - SparkleUI.About.MakeKeyAndOrderFront (this); - SparkleUI.About.CheckForNewVersion (); - }); - }; + SparkleUI.About.OrderFrontRegardless (); + SparkleUI.About.MakeKeyAndOrderFront (this); + SparkleUI.About.CheckForNewVersion (); + }); + }; Menu.AddItem (AboutMenuItem); + StatusItem.Menu = Menu; StatusItem.Menu.Update (); } diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index b888c43f..66ba5aa6 100644 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -185,5 +185,5 @@ namespace SparkleShare { string path = NSBundle.MainBundle.PathForResource ("Growl", "plist"); return NSDictionary.FromFile (path); } - } + } } From 19a3b797f0ced3fab3cb4f96419631cd9ab9c1d5 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 11 Jun 2011 20:44:12 +0100 Subject: [PATCH 20/43] mac: remove About entry in main menu --- SparkleShare/Mac/MainMenu.xib | 49 +---------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/SparkleShare/Mac/MainMenu.xib b/SparkleShare/Mac/MainMenu.xib index adc6dd89..cdc80211 100644 --- a/SparkleShare/Mac/MainMenu.xib +++ b/SparkleShare/Mac/MainMenu.xib @@ -56,25 +56,6 @@ SparkleShare YES - - - About SparkleShare - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - Services @@ -949,14 +930,6 @@ 534 - - - delegate - - - - 538 - @@ -1184,23 +1157,16 @@ YES - - - - 58 - - - 134 @@ -1221,11 +1187,6 @@ - - 236 - - - 131 @@ -1548,8 +1509,6 @@ 221.ImportedFromIB2 23.IBPluginDependency 23.ImportedFromIB2 - 236.IBPluginDependency - 236.ImportedFromIB2 239.IBPluginDependency 239.ImportedFromIB2 24.IBEditorWindowLastContentRect @@ -1600,8 +1559,6 @@ 57.IBPluginDependency 57.ImportedFromIB2 57.editorWindowContentRectSynchronizationRect - 58.IBPluginDependency - 58.ImportedFromIB2 92.IBPluginDependency 92.ImportedFromIB2 @@ -1693,8 +1650,6 @@ com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{514, 649}, {194, 73}} com.apple.InterfaceBuilder.CocoaPlugin @@ -1739,14 +1694,12 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{358, 569}, {223, 153}} + {{358, 599}, {213, 123}} com.apple.InterfaceBuilder.CocoaPlugin {{23, 794}, {245, 183}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - From d3bdd357e8fc5ee9c138fe6f052d143ff1549851 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 01:33:42 +0100 Subject: [PATCH 21/43] linux bring log UI in line with Mac --- SparkleShare/Mac/SparkleEventLog.cs | 4 +- SparkleShare/Makefile.am | 2 +- .../{SparkleLog.cs => SparkleEventLog.cs} | 159 +++++++++++------- SparkleShare/SparkleStatusIcon.cs | 32 +++- SparkleShare/SparkleUI.cs | 52 ++---- 5 files changed, 141 insertions(+), 108 deletions(-) rename SparkleShare/{SparkleLog.cs => SparkleEventLog.cs} (63%) diff --git a/SparkleShare/Mac/SparkleEventLog.cs b/SparkleShare/Mac/SparkleEventLog.cs index 62a5a5f9..3cc23774 100644 --- a/SparkleShare/Mac/SparkleEventLog.cs +++ b/SparkleShare/Mac/SparkleEventLog.cs @@ -145,8 +145,8 @@ namespace SparkleShare { // A short delay is less annoying than // a flashing window - if (watch.ElapsedMilliseconds < 300 && !silent) - Thread.Sleep (300 - (int) watch.ElapsedMilliseconds); + if (watch.ElapsedMilliseconds < 500 && !silent) + Thread.Sleep (500 - (int) watch.ElapsedMilliseconds); AddHTML (); } diff --git a/SparkleShare/Makefile.am b/SparkleShare/Makefile.am index fd3ba6e2..f39777ab 100644 --- a/SparkleShare/Makefile.am +++ b/SparkleShare/Makefile.am @@ -16,7 +16,7 @@ SOURCES = \ SparkleInfobar.cs \ SparkleIntro.cs \ SparkleLinController.cs \ - SparkleLog.cs \ + SparkleEventLog.cs \ SparkleShare.cs \ SparkleSpinner.cs \ SparkleStatusIcon.cs \ diff --git a/SparkleShare/SparkleLog.cs b/SparkleShare/SparkleEventLog.cs similarity index 63% rename from SparkleShare/SparkleLog.cs rename to SparkleShare/SparkleEventLog.cs index e920571c..fdb7faaa 100644 --- a/SparkleShare/SparkleLog.cs +++ b/SparkleShare/SparkleEventLog.cs @@ -28,9 +28,7 @@ using WebKit; namespace SparkleShare { - public class SparkleLog : Window { - - public readonly string LocalPath; + public class SparkleEventLog : Window { private ScrolledWindow ScrolledWindow; private MenuBar MenuBar; @@ -39,6 +37,10 @@ namespace SparkleShare { private SparkleSpinner Spinner; private string HTML; private EventBox LogContent; + private List change_sets; + private string selected_log = null; + private ComboBox combo_box; + private HBox layout_horizontal; // Short alias for the translations @@ -48,48 +50,35 @@ namespace SparkleShare { } - public SparkleLog (string path) : base ("") + public SparkleEventLog () : base ("") { - LocalPath = path; - - string name = System.IO.Path.GetFileName (LocalPath); SetSizeRequest (480, 640); - - Resizable = false; - - BorderWidth = 0; SetPosition (WindowPosition.Center); - // Open slightly off center for each consecutive window - if (SparkleUI.OpenLogs.Count > 0) { + Resizable = false; + BorderWidth = 0; - int x, y; - GetPosition (out x, out y); - Move (x + SparkleUI.OpenLogs.Count * 20, y + SparkleUI.OpenLogs.Count * 20); - - } - - // TRANSLATORS: {0} is a folder name, and {1} is a server address - Title = String.Format(_("Events in ‘{0}’"), name); + Title = _("Recent Events"); IconName = "folder-sparkleshare"; - DeleteEvent += Close; + DeleteEvent += Close; - CreateEventLog (); - UpdateEventLog (); + CreateEvents (); + UpdateEvents (false); + UpdateChooser (); } - private void CreateEventLog () + private void CreateEvents () { - LogContent = new EventBox (); VBox layout_vertical = new VBox (false, 0); + LogContent = new EventBox (); - ScrolledWindow = new ScrolledWindow (); + ScrolledWindow = new ScrolledWindow (); - WebView = new WebView () { - Editable = false - }; + WebView = new WebView () { + Editable = false + }; WebView.HoveringOverLink += delegate (object o, WebKit.HoveringOverLinkArgs args) { LinkStatus = args.Link; @@ -103,50 +92,77 @@ namespace SparkleShare { process.StartInfo.Arguments = args.Request.Uri.Replace (" ", "\\ "); // Escape space-characters process.Start (); - UpdateEventLog (); + UpdateEvents (); } }; - ScrolledWindow.Add (WebView); - LogContent.Add (ScrolledWindow); + ScrolledWindow.Add (WebView); + LogContent.Add (ScrolledWindow); + this.layout_horizontal = new HBox (true, 0); + this.layout_horizontal.PackStart (new Label (""), true, true, 0); + this.layout_horizontal.PackStart (new Label (""), true, true, 0); + + layout_vertical.PackStart (layout_horizontal, false, false, 0); layout_vertical.PackStart (LogContent, true, true, 0); - HButtonBox dialog_buttons = new HButtonBox { - Layout = ButtonBoxStyle.Edge, - BorderWidth = 12 - }; - - Button open_folder_button = new Button (_("_Open Folder")) { - UseUnderline = true - }; - - open_folder_button.Clicked += delegate (object o, EventArgs args) { - SparkleShare.Controller.OpenSparkleShareFolder (LocalPath); - }; - - Button close_button = new Button (Stock.Close); - - close_button.Clicked += delegate { - HideAll (); - }; - - dialog_buttons.Add (open_folder_button); - dialog_buttons.Add (close_button); - // We have to hide the menubar somewhere... layout_vertical.PackStart (CreateShortcutsBar (), false, false, 0); - layout_vertical.PackStart (dialog_buttons, false, false, 0); Add (layout_vertical); - ShowAll (); } - public void UpdateEventLog () + public void UpdateChooser () { - if (HTML == null) { // TODO: there may be a race condition here + if (this.combo_box != null && this.combo_box.Parent != null) + this.layout_horizontal.Remove (this.combo_box); + + this.combo_box = new ComboBox (); + this.layout_horizontal.BorderWidth = 9; + + CellRendererText cell = new CellRendererText(); + this.combo_box.PackStart (cell, false); + this.combo_box.AddAttribute (cell, "text", 0); + ListStore store = new ListStore (typeof (string)); + this.combo_box.Model = store; + + store.AppendValues (_("All Folders")); + + foreach (string folder_name in SparkleShare.Controller.Folders) + store.AppendValues (folder_name); + + this.combo_box.Active = 0; + + this.combo_box.Changed += delegate { + TreeIter iter; + this.combo_box.GetActiveIter (out iter); + + string selection = (string) this.combo_box.Model.GetValue (iter, 0); + + if (selection.Equals (_("All Folders"))) + this.selected_log = null; + else + this.selected_log = selection; + + UpdateEvents (false); + }; + + this.layout_horizontal.PackStart (this.combo_box, true, true, 0); + this.layout_horizontal.ShowAll (); + } + + + public void UpdateEvents () + { + UpdateEvents (true); + } + + + public void UpdateEvents (bool silent) + { + if (!silent) { LogContent.Remove (LogContent.Child); Spinner = new SparkleSpinner (22); LogContent.Add (Spinner); @@ -154,7 +170,17 @@ namespace SparkleShare { } Thread thread = new Thread (new ThreadStart (delegate { + Stopwatch watch = new Stopwatch (); + watch.Start (); + this.change_sets = SparkleShare.Controller.GetLog (this.selected_log); GenerateHTML (); + watch.Stop (); + + // A short delay is less annoying than + // a flashing window + if (watch.ElapsedMilliseconds < 500 && !silent) + Thread.Sleep (500 - (int) watch.ElapsedMilliseconds); + AddHTML (); })); @@ -164,7 +190,7 @@ namespace SparkleShare { private void GenerateHTML () { - HTML = SparkleShare.Controller.GetHTMLLog (System.IO.Path.GetFileName (LocalPath)); + HTML = SparkleShare.Controller.GetHTMLLog (this.change_sets); HTML = HTML.Replace ("", (double) (Style.FontDescription.Size / 1024 + 3) + "px"); HTML = HTML.Replace ("", (Style.FontDescription.Size / 1024 + 3) + "px"); @@ -179,6 +205,18 @@ namespace SparkleShare { HTML = HTML.Replace ("", "file://" + SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons", "hicolor", "32x32", "status", "avatar-default.png")); + HTML = HTML.Replace ("", "file://" + + SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons", + "hicolor", "12x12", "status", "document-added.png")); + HTML = HTML.Replace ("", "file://" + + SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons", + "hicolor", "12x12", "status", "document-edited.png")); + HTML = HTML.Replace ("", "file://" + + SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons", + "hicolor", "12x12", "status", "document-deleted.png")); + HTML = HTML.Replace ("", "file://" + + SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons", + "hicolor", "12x12", "status", "document-moved.png")); } @@ -248,3 +286,4 @@ namespace SparkleShare { } } } + diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 5707bb7e..58e567a1 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -156,20 +156,19 @@ namespace SparkleShare { if (SparkleShare.Controller.Folders.Count > 0) { // Creates a menu item for each repository with a link to their logs - foreach (string path in SparkleShare.Controller.Folders) { + foreach (string folder_name in SparkleShare.Controller.Folders) { Gdk.Pixbuf folder_icon = IconTheme.Default.LoadIcon ("folder", 16, IconLookupFlags.GenericFallback); - ImageMenuItem subfolder_item = new SparkleMenuItem (Path.GetFileName (path)) { + ImageMenuItem subfolder_item = new SparkleMenuItem (folder_name) { Image = new Image (folder_icon) }; -// if (repo.HasUnsyncedChanges) +// if (repo.HasUnsyncedChanges) TODO // folder_action.IconName = "dialog-error"; - subfolder_item.Activated += OpenEventLogDelegate (path); - + subfolder_item.Activated += OpenFolderDelegate (folder_name); Menu.Add (subfolder_item); } @@ -206,7 +205,24 @@ namespace SparkleShare { Menu.Add (sync_item); Menu.Add (new SeparatorMenuItem ()); - MenuItem notify_item; + MenuItem recent_events_item = new MenuItem (_("Show Recent Events")); + + if (SparkleShare.Controller.FirstRun) // TODO in mac version too + recent_events_item.Sensitive = false; + + recent_events_item.Activated += delegate { + Application.Invoke (delegate { + if (SparkleUI.EventLog == null) + SparkleUI.EventLog = new SparkleEventLog (); + + SparkleUI.EventLog.ShowAll (); + SparkleUI.EventLog.Present (); + }); + }; + + Menu.Add (recent_events_item); + + MenuItem notify_item; if (SparkleShare.Controller.NotificationsEnabled) notify_item = new MenuItem (_("Turn Notifications Off")); @@ -246,10 +262,10 @@ namespace SparkleShare { // A method reference that makes sure that opening the // event log for each repository works correctly - private EventHandler OpenEventLogDelegate (string path) + private EventHandler OpenFolderDelegate (string name) { return delegate { - SparkleShare.UI.AddEventLog (path); + SparkleShare.Controller.OpenSparkleShareFolder (name); }; } diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 8eeaafc4..317a5f9e 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -33,7 +33,7 @@ namespace SparkleShare { public class SparkleUI { public static SparkleStatusIcon StatusIcon; - public static List OpenLogs; + public static SparkleEventLog EventLog; public static SparkleIntro Intro; @@ -47,7 +47,7 @@ namespace SparkleShare { public SparkleUI () { // Initialize the application - Application.Init ();Console.WriteLine ("OOOOOOOOO"); + Application.Init (); foreach (SparkleChangeSet change_set in SparkleShare.Controller.GetLog ()) { Console.WriteLine (change_set.Timestamp.ToString ()); @@ -55,9 +55,6 @@ namespace SparkleShare { // Create the statusicon StatusIcon = new SparkleStatusIcon (); - // Keep track of which event logs are open - OpenLogs = new List (); - if (SparkleShare.Controller.FirstRun) { Intro = new SparkleIntro (); Intro.ShowAccountForm (); @@ -78,10 +75,8 @@ namespace SparkleShare { SparkleShare.Controller.NotificationRaised += delegate (string user_name, string user_email, string message, string repository_path) { Application.Invoke (delegate { - foreach (SparkleLog log in OpenLogs) { - if (log.LocalPath.Equals (repository_path)) - log.UpdateEventLog (); - } + if (EventLog != null) + EventLog.UpdateEvents (); if (!SparkleShare.Controller.NotificationsEnabled) return; @@ -94,10 +89,6 @@ namespace SparkleShare { else bubble.Icon = SparkleUIHelpers.GetIcon ("avatar-default", 32); - bubble.AddAction ("", "Show Events", delegate { - AddEventLog (repository_path); - }); - bubble.Show (); }); }; @@ -114,38 +105,25 @@ namespace SparkleShare { SparkleShare.Controller.AvatarFetched += delegate { Application.Invoke (delegate { - foreach (SparkleLog log in OpenLogs) - log.UpdateEventLog (); + if (EventLog != null) + EventLog.UpdateEvents (); }); }; SparkleShare.Controller.OnIdle += delegate { Application.Invoke (delegate { - foreach (SparkleLog log in OpenLogs) - log.UpdateEventLog (); + if (EventLog != null) + EventLog.UpdateEvents (); }); }; - } - - public void AddEventLog (string path) - { - SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { - return l.LocalPath.Equals (path); - }); - - // Check whether the log is already open, create a new one if - // that's not the case or present it to the user if it is - if (log == null) { - OpenLogs.Add (new SparkleLog (path)); - OpenLogs [OpenLogs.Count - 1].ShowAll (); - OpenLogs [OpenLogs.Count - 1].Present (); - } else { - log.ShowAll (); - log.Present (); - } - } - + SparkleShare.Controller.FolderListChanged += delegate { + Application.Invoke (delegate { + if (EventLog != null) + EventLog.UpdateChooser (); + }); + }; + } // Runs the application public void Run () From 6ae4b481f6c074015344ad1d4742197b0039028c Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 01:47:17 +0100 Subject: [PATCH 22/43] log: add separator after All Folders item --- SparkleShare/SparkleEventLog.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SparkleShare/SparkleEventLog.cs b/SparkleShare/SparkleEventLog.cs index fdb7faaa..2720c93b 100644 --- a/SparkleShare/SparkleEventLog.cs +++ b/SparkleShare/SparkleEventLog.cs @@ -129,12 +129,18 @@ namespace SparkleShare { this.combo_box.Model = store; store.AppendValues (_("All Folders")); + store.AppendValues ("---"); foreach (string folder_name in SparkleShare.Controller.Folders) store.AppendValues (folder_name); this.combo_box.Active = 0; + this.combo_box.RowSeparatorFunc = delegate (TreeModel model, TreeIter iter) { + string item = (string) this.combo_box.Model.GetValue (iter, 0); + return (item == "---"); + }; + this.combo_box.Changed += delegate { TreeIter iter; this.combo_box.GetActiveIter (out iter); From 35c9c043dd42e06c145966629fd2f2751cbc01f3 Mon Sep 17 00:00:00 2001 From: wimh Date: Sun, 12 Jun 2011 01:53:38 +0100 Subject: [PATCH 23/43] fix portability issue in OnFileActivity --- SparkleLib/SparkleRepoBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index bac49759..e254e0ef 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -299,7 +299,7 @@ namespace SparkleLib { // Starts a timer when something changes public void OnFileActivity (object o, FileSystemEventArgs args) { - if (args.FullPath.Contains ("/.")) + if (args.FullPath.Contains (Path.DirectorySeparatorChar + ".")) return; WatcherChangeTypes wct = args.ChangeType; From 3f6a28f3e67efa47f4237971358f642a17c56400 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 02:41:53 +0100 Subject: [PATCH 24/43] statusicon: change folder icon to dialog-error when folde rhas unsynced changes --- SparkleShare/SparkleStatusIcon.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 58e567a1..67c039c2 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -158,16 +158,21 @@ namespace SparkleShare { // Creates a menu item for each repository with a link to their logs foreach (string folder_name in SparkleShare.Controller.Folders) { - Gdk.Pixbuf folder_icon = IconTheme.Default.LoadIcon ("folder", 16, - IconLookupFlags.GenericFallback); - + Gdk.Pixbuf folder_icon; + + if (SparkleShare.Controller.UnsyncedFolders.Contains (folder_name)) { + folder_icon = IconTheme.Default.LoadIcon ("dialog-error", 16, + IconLookupFlags.GenericFallback); + + } else { + folder_icon = IconTheme.Default.LoadIcon ("folder", 16, + IconLookupFlags.GenericFallback); + } + ImageMenuItem subfolder_item = new SparkleMenuItem (folder_name) { Image = new Image (folder_icon) }; -// if (repo.HasUnsyncedChanges) TODO -// folder_action.IconName = "dialog-error"; - subfolder_item.Activated += OpenFolderDelegate (folder_name); Menu.Add (subfolder_item); } @@ -207,7 +212,7 @@ namespace SparkleShare { MenuItem recent_events_item = new MenuItem (_("Show Recent Events")); - if (SparkleShare.Controller.FirstRun) // TODO in mac version too + if (SparkleShare.Controller.FirstRun) recent_events_item.Sensitive = false; recent_events_item.Activated += delegate { From a7eef99be2929565556ba72a0fd489de3c569366 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 02:45:18 +0100 Subject: [PATCH 25/43] statusicon mac: only enable Show Recent Events when there are folders --- SparkleShare/Mac/SparkleStatusIcon.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 7e3935c0..65fb1ab4 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -239,17 +239,19 @@ namespace SparkleShare { Title = "Show Recent Events" }; - RecentEventsMenuItem.Activated +=delegate { - InvokeOnMainThread (delegate { - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - - if (SparkleUI.EventLog == null) - SparkleUI.EventLog = new SparkleEventLog (); - - SparkleUI.EventLog.OrderFrontRegardless (); - SparkleUI.EventLog.MakeKeyAndOrderFront (this); - }); - }; + if (SparkleShare.Controller.Folders.Count > 0) { + RecentEventsMenuItem.Activated +=delegate { + InvokeOnMainThread (delegate { + NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + + if (SparkleUI.EventLog == null) + SparkleUI.EventLog = new SparkleEventLog (); + + SparkleUI.EventLog.OrderFrontRegardless (); + SparkleUI.EventLog.MakeKeyAndOrderFront (this); + }); + }; + } Menu.AddItem (RecentEventsMenuItem); From 097199bd95ebde2aac3d2ab07f9b1cec731041d3 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 02:47:43 +0100 Subject: [PATCH 26/43] statusicon linux: only enable Show Recent Events when there are folders --- SparkleShare/SparkleStatusIcon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 67c039c2..80072252 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -212,7 +212,7 @@ namespace SparkleShare { MenuItem recent_events_item = new MenuItem (_("Show Recent Events")); - if (SparkleShare.Controller.FirstRun) + if (SparkleShare.Controller.Folders.Count > 0) recent_events_item.Sensitive = false; recent_events_item.Activated += delegate { From 773f940e693ca8bfd67cf60f48622f8a5e4c89e0 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 02:56:01 +0100 Subject: [PATCH 27/43] repo base: make polling intervals setting a bit more readable --- SparkleLib/SparkleRepoBase.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index e254e0ef..31791649 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -34,12 +34,15 @@ namespace SparkleLib { public abstract class SparkleRepoBase { + private TimeSpan short_interval = new TimeSpan (0, 0, 3, 0); + private TimeSpan long_interval = new TimeSpan (0, 0, 10, 0); + private FileSystemWatcher watcher; private SparkleListenerBase listener; + private TimeSpan poll_interval; private Timer local_timer = new Timer () { Interval = 0.25 * 1000 }; private Timer remote_timer = new Timer () { Interval = 10 * 1000 }; private DateTime last_poll = DateTime.Now; - private TimeSpan poll_interval = new TimeSpan (0, 0, 3, 0); private List sizebuffer = new List (); private bool has_changed = false; private Object change_lock = new Object (); @@ -74,9 +77,10 @@ namespace SparkleLib { public SparkleRepoBase (string path, SparkleBackend backend) { - LocalPath = path; - Name = Path.GetFileName (LocalPath); - Backend = backend; + LocalPath = path; + Name = Path.GetFileName (LocalPath); + Backend = backend; + this.poll_interval = this.short_interval; SyncStatusChanged += delegate (SyncStatus status) { this.status = status; @@ -227,7 +231,7 @@ namespace SparkleLib { // Stop polling when the connection to the irc channel is succesful this.listener.Connected += delegate { - this.poll_interval = new TimeSpan (0, 0, 10, 0); + this.poll_interval = this.long_interval; this.last_poll = DateTime.Now; // Check for changes manually one more time @@ -241,7 +245,7 @@ namespace SparkleLib { // Start polling when the connection to the irc channel is lost this.listener.Disconnected += delegate { - this.poll_interval = new TimeSpan (0, 0, 3, 0); + this.poll_interval = this.short_interval; SparkleHelpers.DebugInfo (Name, "Falling back to polling"); }; From a0c4dbf53e2b3a9538bb70ea3b2e43b7fe1d91a6 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 02:59:18 +0100 Subject: [PATCH 28/43] statusicon: wrong sign --- SparkleShare/Mac/SparkleStatusIcon.cs | 2 +- SparkleShare/SparkleStatusIcon.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 65fb1ab4..3d8ea80a 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -239,7 +239,7 @@ namespace SparkleShare { Title = "Show Recent Events" }; - if (SparkleShare.Controller.Folders.Count > 0) { + if (SparkleShare.Controller.Folders.Count < 0) { RecentEventsMenuItem.Activated +=delegate { InvokeOnMainThread (delegate { NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 80072252..978f702c 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -212,7 +212,7 @@ namespace SparkleShare { MenuItem recent_events_item = new MenuItem (_("Show Recent Events")); - if (SparkleShare.Controller.Folders.Count > 0) + if (SparkleShare.Controller.Folders.Count < 1) recent_events_item.Sensitive = false; recent_events_item.Activated += delegate { From cb22f9f56eddaa68c3765923ed9a80109b043ab7 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 03:06:00 +0100 Subject: [PATCH 29/43] meh --- SparkleShare/Mac/SparkleStatusIcon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 3d8ea80a..fae88fc6 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -239,7 +239,7 @@ namespace SparkleShare { Title = "Show Recent Events" }; - if (SparkleShare.Controller.Folders.Count < 0) { + if (SparkleShare.Controller.Folders.Count < 1) { RecentEventsMenuItem.Activated +=delegate { InvokeOnMainThread (delegate { NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); From b39fe62edc879b97a776ed60cf3ed4d90d749499 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 03:07:29 +0100 Subject: [PATCH 30/43] meh part 2 --- SparkleShare/Mac/SparkleStatusIcon.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index fae88fc6..bd2950b0 100644 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -239,8 +239,8 @@ namespace SparkleShare { Title = "Show Recent Events" }; - if (SparkleShare.Controller.Folders.Count < 1) { - RecentEventsMenuItem.Activated +=delegate { + if (SparkleShare.Controller.Folders.Count > 0) { + RecentEventsMenuItem.Activated += delegate { InvokeOnMainThread (delegate { NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); From a1c4dd205a4281597f3725ee1a2931381641a5f9 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 03:25:19 +0100 Subject: [PATCH 31/43] controller: sort folder list by name --- SparkleShare/SparkleController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 12c0e8ba..663497ba 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -223,7 +223,9 @@ namespace SparkleShare { public List Folders { get { - return SparkleConfig.DefaultConfig.Folders; + List folders = SparkleConfig.DefaultConfig.Folders; + folders.Sort (); + return folders; } } From 2dc8c805987cb5b9845d49d62569039dc1b30883 Mon Sep 17 00:00:00 2001 From: fidel Date: Sun, 12 Jun 2011 02:00:25 -0700 Subject: [PATCH 32/43] added several german translations to the file --- po/de.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/po/de.po b/po/de.po index 92d0590e..3d849b10 100644 --- a/po/de.po +++ b/po/de.po @@ -69,15 +69,15 @@ msgstr "Über SparkleShare" #: ../SparkleShare/SparkleAbout.cs:54 msgid "A newer version is available" -msgstr "" +msgstr "Eine neuere Version ist verfügbar" #: ../SparkleShare/SparkleAbout.cs:61 msgid "You are running the latest version." -msgstr "" +msgstr "Sie verwenden die aktuelle Version." #: ../SparkleShare/SparkleAbout.cs:88 msgid "Checking for updates..." -msgstr "" +msgstr "Suche Aktualisierungen..." #: ../SparkleShare/SparkleAbout.cs:117 msgid "_Show Credits" @@ -103,7 +103,7 @@ msgstr "‘{0}’ hinzugefügt" #: ../SparkleShare/SparkleController.cs:613 #, csharp-format msgid "moved ‘{0}’" -msgstr "" +msgstr "‘{0}’ verschoben" #: ../SparkleShare/SparkleController.cs:618 #, csharp-format @@ -132,7 +132,7 @@ msgid "" "bits of information from you." msgstr "" "Bevor wir einen SparkleShare-Ordner auf diesem Computer einrichten können, " -"benötigen wir ein paar Informationen von Ihnen." +"benötigen wir einige Informationen von Ihnen." #: ../SparkleShare/SparkleIntro.cs:81 msgid "Full Name:" @@ -178,7 +178,7 @@ msgstr "Das GNOME Project" #: ../SparkleShare/SparkleIntro.cs:195 msgid "GNOME is an easy to understand interface to your computer." -msgstr "GNOME ist ein einfach verständliches Interface zu Ihrem Computer" +msgstr "GNOME ist ein einfach verständliches Interface für Ihrem Computer" #: ../SparkleShare/SparkleIntro.cs:196 msgid "Select this option if you’re a developer or designer working on GNOME." @@ -356,7 +356,7 @@ msgstr "Diesen Hilfetext anzeigen" #: ../SparkleShare/SparkleShare.cs:114 msgid "SparkleShare, a collaboration and sharing tool." -msgstr "" +msgstr "SparkleShare, ein Werkzeug für verteilte Zusammenarbeit." #: ../SparkleShare/SparkleShare.cs:115 msgid "Copyright (C) 2010 Hylke Bons" @@ -434,6 +434,6 @@ msgstr "" #: ../SparkleShare/SparkleWindow.cs:41 msgid "SparkleShare Setup" -msgstr "" +msgstr "SparkleShare Konfiguration" From 4ab5aa335e33283900441187040ccf16abe00977 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 13:35:27 +0100 Subject: [PATCH 33/43] build: don't hardcode growl path --- SparkleShare/Mac/SparkleShare.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SparkleShare/Mac/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare.csproj index 579e66b0..08c5bec8 100644 --- a/SparkleShare/Mac/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare.csproj @@ -24,7 +24,7 @@ false - + From 8ffb32716adb994749a6d138580d198516067fe1 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 12 Jun 2011 08:10:29 -0700 Subject: [PATCH 34/43] reference appindicator --- SparkleShare/SparkleStatusIcon.cs | 1 + configure.ac | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 978f702c..2de8fab4 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -19,6 +19,7 @@ using System; using System.IO; using System.Timers; +using AppIndicator; using Gtk; using Mono.Unix; diff --git a/configure.ac b/configure.ac index 6c3ba1dd..8b999ed6 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,30 @@ AC_SUBST(WEBKIT_SHARP_LIBS) SHAMROCK_CHECK_NUNIT +APPINDICATOR_REQUIRED=0.0.7 + +AC_ARG_ENABLE(appindicator, + AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]), + [enable_appindicator=$enableval], + [enable_appindicator="auto"]) + +if test x$enable_appindicator = xauto ; then + PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED], + enable_appindicator="yes", + enable_appindicator="no") +fi + +if test x$enable_appindicator = xyes ; then + PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],, + AC_MSG_ERROR([appindicator-0.1 is not installed])) + PKG_CHECK_MODULES(APP_INDICATOR, + appindicator-0.1 >= $APPINDICATOR_REQUIRED) + AC_SUBST(APP_INDICATOR_CFLAGS) + AC_SUBST(APP_INDICATOR_LIBS) + AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator]) +fi +AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes) + dnl Get nautilus extensions directory SPARKLESHARE_NAUTILUS_PYTHON From effa7a9b025aac68e973855064fd4d83ef1473c0 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 12 Jun 2011 17:32:25 +0200 Subject: [PATCH 35/43] build: look for appindicator-sharp-0.1 instead of appindicator-0.1 We want the sharp-iest appindicators, not just the plain C library. --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 8b999ed6..e9ee69ff 100644 --- a/configure.ac +++ b/configure.ac @@ -103,16 +103,16 @@ AC_ARG_ENABLE(appindicator, [enable_appindicator="auto"]) if test x$enable_appindicator = xauto ; then - PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED], + PKG_CHECK_EXISTS([appindicator-sharp-0.1 >= $APPINDICATOR_REQUIRED], enable_appindicator="yes", enable_appindicator="no") fi if test x$enable_appindicator = xyes ; then - PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],, - AC_MSG_ERROR([appindicator-0.1 is not installed])) + PKG_CHECK_EXISTS([appindicator-sharp-0.1 >= $APPINDICATOR_REQUIRED],, + AC_MSG_ERROR([appindicator-sharp-0.1 is not installed])) PKG_CHECK_MODULES(APP_INDICATOR, - appindicator-0.1 >= $APPINDICATOR_REQUIRED) + appindicator-sharp-0.1 >= $APPINDICATOR_REQUIRED) AC_SUBST(APP_INDICATOR_CFLAGS) AC_SUBST(APP_INDICATOR_LIBS) AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator]) From 0a863371ef0a83df63bc1708278ada3b6abb630c Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 12 Jun 2011 17:35:12 +0200 Subject: [PATCH 36/43] build: Add a reference to the appindicator libs for SparkleShare.exe --- build/build.environment.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/build.environment.mk b/build/build.environment.mk index 59717142..7be1e14e 100644 --- a/build/build.environment.mk +++ b/build/build.environment.mk @@ -17,6 +17,7 @@ LINK_DBUS = $(NDESK_DBUS_LIBS) $(NDESK_DBUS_GLIB_LIBS) LINK_DBUS_NO_GLIB = $(NDESK_DBUS_LIBS) LINK_SMARTIRC4NET = $(SMARTIRC4NET_LIBS) LINK_SMARTIRC4NET_LOCAL = -r:$(abs_top_builddir)/$(SMARTIRC4NET_ASSEMBLY) +LINK_APP_INDICATOR = $(APP_INDICATOR_LIBS) REF_NOTIFY_SHARP = $(LINK_SYSTEM) $(LINK_DBUS) $(GTKSHARP_LIBS) $(GLIBSHARP_LIBS) LINK_NOTIFY_SHARP = -r:$(DIR_BIN)/NotifySharp.dll @@ -30,7 +31,7 @@ REF_SPARKLELIB = $(LINK_SYSTEM) $(LINK_MONO_POSIX) $(LINK_SMARTIRC4NET) $(LINK_S LINK_SPARKLELIB = -r:$(DIR_BIN)/SparkleLib.dll LINK_SPARKLELIB_DEPS = $(REF_SPARKLELIB) $(LINK_SPARKLELIB) -REF_SPARKLESHARE = $(LINK_DBUS) $(LINK_GTK) $(LINK_SPARKLELIB_DEPS) +REF_SPARKLESHARE = $(LINK_DBUS) $(LINK_GTK) $(LINK_SPARKLELIB_DEPS) $(LINK_APP_INDICATOR) REF_SPARKLEDIFF = $(LINK_FRIENDFACE_DEPS) $(LINK_GTK) $(LINK_SPARKLELIB_DEPS) From f549f6e13ffaf7faf1d89452cbe0342294c9cfd5 Mon Sep 17 00:00:00 2001 From: Hylke Date: Sun, 12 Jun 2011 10:14:22 -0700 Subject: [PATCH 37/43] statusicon: adjust basic structure for appindicator --- SparkleShare/SparkleStatusIcon.cs | 55 +++++++++++++++++++++++++------ SparkleShare/SparkleUI.cs | 3 -- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 2de8fab4..34c74886 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -27,14 +27,18 @@ namespace SparkleShare { // The statusicon that stays in the // user's notification area - public class SparkleStatusIcon : StatusIcon { + public class SparkleStatusIcon { + + public bool UseIndicator = true; private Timer Animation; private Gdk.Pixbuf [] AnimationFrames; private int FrameNumber; private string StateText; private Menu Menu; - + private StatusIcon status_icon; + private ApplicationIndicator indicator; +private Menu menu; // Short alias for the translations public static string _ (string s) { @@ -42,13 +46,23 @@ namespace SparkleShare { } - public SparkleStatusIcon () : base () + public SparkleStatusIcon () { AnimationFrames = CreateAnimationFrames (); Animation = CreateAnimation (); - Activate += ShowMenu; // Primary mouse button click - PopupMenu += ShowMenu; // Secondary mouse button click + if (UseIndicator) { + this.indicator = new ApplicationIndicator ("sparkleshare", + "folder", Category.ApplicationStatus); + + indicator.Status = Status.Attention; + + } else { + this.status_icon = new StatusIcon (); + + this.status_icon.Activate += ShowMenu; // Primary mouse button click + this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click + } SetNormalState (); CreateMenu (); @@ -122,7 +136,11 @@ namespace SparkleShare { FrameNumber = 0; Application.Invoke (delegate { - Pixbuf = AnimationFrames [FrameNumber]; + if (UseIndicator) { + this.indicator.IconName = "folder-videos"; + } else { + this.status_icon.Pixbuf = AnimationFrames [FrameNumber]; + } }); }; @@ -186,6 +204,8 @@ namespace SparkleShare { Menu.Add (no_folders_item); } + Menu.Add (new SeparatorMenuItem ()); + // Opens the wizard to add a new remote folder MenuItem sync_item = new MenuItem (_("Add Remote Folder…")); @@ -263,6 +283,9 @@ namespace SparkleShare { Menu.Add (quit_item); Menu.ShowAll (); + + if (UseIndicator) + this.indicator.Menu = Menu; } @@ -301,7 +324,7 @@ namespace SparkleShare { // Makes sure the menu pops up in the right position private void SetPosition (Menu menu, out int x, out int y, out bool push_in) { - PositionMenu (menu, out x, out y, out push_in, Handle); + StatusIcon.PositionMenu (menu, out x, out y, out push_in, this.status_icon.Handle); } @@ -321,19 +344,31 @@ namespace SparkleShare { StateText = _("Welcome to SparkleShare!"); Application.Invoke (delegate { - Pixbuf = AnimationFrames [0]; + if (UseIndicator) { + this.indicator.IconName = "folder-pictures"; + } else { + this.status_icon.Pixbuf = AnimationFrames [0]; + } }); } else { if (error) { StateText = _("Not everything is synced"); Application.Invoke (delegate { - Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24); + if (UseIndicator) { + this.indicator.IconName = "folder-music"; + } else { + this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24); + } }); } else { StateText = _("Up to date") + " (" + SparkleShare.Controller.FolderSize + ")"; Application.Invoke (delegate { - Pixbuf = AnimationFrames [0]; + if (UseIndicator) { + this.indicator.IconName = "folder-pictures"; + } else { + this.status_icon.Pixbuf = AnimationFrames [0]; + } }); } } diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 317a5f9e..51dad981 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -49,9 +49,6 @@ namespace SparkleShare { // Initialize the application Application.Init (); - foreach (SparkleChangeSet change_set in SparkleShare.Controller.GetLog ()) { - Console.WriteLine (change_set.Timestamp.ToString ()); - } // Create the statusicon StatusIcon = new SparkleStatusIcon (); From 1135516798e7d17496be5ac051e147f3b05c598b Mon Sep 17 00:00:00 2001 From: Hylke Date: Sun, 12 Jun 2011 14:49:37 -0700 Subject: [PATCH 38/43] Fix icon names --- SparkleShare/SparkleStatusIcon.cs | 32 +++++++++++------- data/icons/Makefile.am | 7 +++- .../process-syncing-sparkleshare-i-24.png | Bin 0 -> 994 bytes .../process-syncing-sparkleshare-ii-24.png | Bin 0 -> 1002 bytes .../process-syncing-sparkleshare-iii-24.png | Bin 0 -> 990 bytes .../process-syncing-sparkleshare-iiii-24.png | Bin 0 -> 989 bytes .../process-syncing-sparkleshare-iiiii-24.png | Bin 0 -> 993 bytes 7 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 data/icons/process-syncing-sparkleshare-i-24.png create mode 100644 data/icons/process-syncing-sparkleshare-ii-24.png create mode 100644 data/icons/process-syncing-sparkleshare-iii-24.png create mode 100644 data/icons/process-syncing-sparkleshare-iiii-24.png create mode 100644 data/icons/process-syncing-sparkleshare-iiiii-24.png diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 34c74886..b577eabe 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -19,10 +19,11 @@ using System; using System.IO; using System.Timers; -using AppIndicator; using Gtk; using Mono.Unix; +using AppIndicator; + namespace SparkleShare { // The statusicon that stays in the @@ -36,9 +37,10 @@ namespace SparkleShare { private int FrameNumber; private string StateText; private Menu Menu; + private StatusIcon status_icon; - private ApplicationIndicator indicator; -private Menu menu; + private ApplicationIndicator indicator; + // Short alias for the translations public static string _ (string s) { @@ -53,9 +55,10 @@ private Menu menu; if (UseIndicator) { this.indicator = new ApplicationIndicator ("sparkleshare", - "folder", Category.ApplicationStatus); + "process-syncing-sparkleshare-i", Category.ApplicationStatus) { - indicator.Status = Status.Attention; + Status = Status.Attention + }; } else { this.status_icon = new StatusIcon (); @@ -135,11 +138,17 @@ private Menu menu; else FrameNumber = 0; + string icon_name = "process-syncing-sparkleshare-"; + + for (int i = 0; i <= FrameNumber; i++) + icon_name += "i"; + Application.Invoke (delegate { if (UseIndicator) { - this.indicator.IconName = "folder-videos"; + this.indicator.IconName = icon_name; + Console.WriteLine (icon_name); } else { - this.status_icon.Pixbuf = AnimationFrames [FrameNumber]; + this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon (icon_name, 24); } }); }; @@ -176,7 +185,6 @@ private Menu menu; // Creates a menu item for each repository with a link to their logs foreach (string folder_name in SparkleShare.Controller.Folders) { - Gdk.Pixbuf folder_icon; if (SparkleShare.Controller.UnsyncedFolders.Contains (folder_name)) { @@ -309,7 +317,6 @@ private Menu menu; Menu.Add (status_menu_item); Menu.ReorderChild (status_menu_item, 0); - Menu.ShowAll (); } @@ -345,18 +352,19 @@ private Menu menu; Application.Invoke (delegate { if (UseIndicator) { - this.indicator.IconName = "folder-pictures"; + this.indicator.IconName = "process-syncing-sparkleshare-i"; } else { this.status_icon.Pixbuf = AnimationFrames [0]; } }); + } else { if (error) { StateText = _("Not everything is synced"); Application.Invoke (delegate { if (UseIndicator) { - this.indicator.IconName = "folder-music"; + this.indicator.IconName = "sparkleshare-syncing-error"; } else { this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24); } @@ -365,7 +373,7 @@ private Menu menu; StateText = _("Up to date") + " (" + SparkleShare.Controller.FolderSize + ")"; Application.Invoke (delegate { if (UseIndicator) { - this.indicator.IconName = "folder-pictures"; + this.indicator.IconName = "process-syncing-sparkleshare-i"; } else { this.status_icon.Pixbuf = AnimationFrames [0]; } diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index f23af747..79026af3 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -8,7 +8,12 @@ system_theme_icons = \ apps,folder-sparkleshare-24.png \ apps,folder-sparkleshare-256.png \ apps,folder-sparkleshare-32.png \ - apps,folder-sparkleshare-48.png + apps,folder-sparkleshare-48.png \ + status,process-syncing-sparkleshare-i-24.png \ + status,process-syncing-sparkleshare-ii-24.png \ + status,process-syncing-sparkleshare-iii-24.png \ + status,process-syncing-sparkleshare-iiii-24.png \ + status,process-syncing-sparkleshare-iiiii-24.png app_theme_icons = \ animations,process-syncing-sparkleshare-24.png \ diff --git a/data/icons/process-syncing-sparkleshare-i-24.png b/data/icons/process-syncing-sparkleshare-i-24.png new file mode 100644 index 0000000000000000000000000000000000000000..286e79d6fcebefbcdf3e15315075b95064206304 GIT binary patch literal 994 zcmV<810DQ{P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2ipb= z6$c}RaEf{W00Ux4L_t(Y$F-GDXk1kk#((F%H~-R1{?te^)HcSX4bp0xM5)ChRIEtR zRdH1tLBXveZi?<)SP@q$DyR@#NTCY@7B_05D-}aZY#XW2PE(Uknwd;8O{O#R-o3}g zjBO_K3e}jiIq%QC_q*r&zH_grDw`P&n;e@C;H`Z*`=Y!m;=Zd$tYM_uykcJ&7}3-J z20+$o@Y}Fkc<|}xlb&P124H*J5D&1A`+v^`9y*hJ>pn%(>BqfswXu zw(aUmT%Eo+ad!Al%xY1DxAuI5C` z9MT%Uy9(3+)&cbPrC2P@v6`J@OM5qT?4_9gg}4e`%>|m9Ti4mhsnQ*$fw%(Ec!M)q zc07iOM36^LP{~~)ao`}L%6t`bzR;uP!d0}=6zNOpBG2X06OUXJ;(_vz_L&_B>iv@prc zH*XSkZmhFtl+}D5gDi-M2jGc_0I_S!X6)P#Kfkbl|4vuXx@L>xaer3|ik4utNV^-S zeOn5a$^?{d9T&!AnVOh2v&-gtASNQl0|anC{+-h=+sqT`bf#w`H`v@NS3a5I>#AW9 zsR2ZRdw~90-bmzuX&?twL{$+HrzUu`2Dp(>paKM{YHwYcH7)+P(AvU(0~hdsj2jTm Q*Z=?k07*qoM6N<$f;f`bxBvhE literal 0 HcmV?d00001 diff --git a/data/icons/process-syncing-sparkleshare-ii-24.png b/data/icons/process-syncing-sparkleshare-ii-24.png new file mode 100644 index 0000000000000000000000000000000000000000..83dd2cf25aed748726a033c703b286f22f05a6b5 GIT binary patch literal 1002 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2ipb= z6$l1O>_YMY00U}CL_t(Y$F-G9Xk1ko$A90wcOID}lbggeNo!gY(w9Y>#7YpY(1q@b zO3{tB0fnL~7lJEsts6HYcBi3;6bh29V10lnrAgbQwOVaS(l(toiIdk%X6D{=J{L1> zb2Fo;As-yheVlWC=l?y<5mjX~&0&*m(*fSvmkUGkwut+oB8jSzYO{(x-ao9T{|i9Y z#^BsBcWLkQFE@IQ0ULr1z=U8!iiHA`qi6G>37#4l*75(Pz!>UWEnqHn zVE_2K=JwrvN6=b9E*jbgj=Tzqrpk^gyHkTMPGhIP$7yKAJNyY!mnOJ-5iKlKr=>t> zY5+nDl5E0UJ{484=LNij@1l1mAmKB2`5T&c9Yj+tIJQu;bOT!h5Sa2$iAQT})%9_g zvn*d5!%c4`KYEge9eu?6hT!H8Xy#(MUhXMa2e_Zmfdz3CNhBg|VeAwd6sb!$voiV_ zTel>b9(kXI%yneoE!+cdM#kfoy;0jmj#Me=?2NNCca212CtY2w0Cewt6xnkKON_Z+ ze`L#=Isd3Y9Uz{FG^cGh>77rrJarc5vDXp53)y~%?A4!`IPnUJ+;7o2u2Xh*tr&Vk&2TKf00G=jCpi6v%{)6fnd#oh4K|Zw z>clu-0dA$R5g-n<0=p~yMl1_l0p@{{s461jRN@h@05@U^lz>oG?folL*5}(sDV2r) Y0=Eo=$s#$xH2?qr07*qoM6N<$f;_^=5C8xG literal 0 HcmV?d00001 diff --git a/data/icons/process-syncing-sparkleshare-iii-24.png b/data/icons/process-syncing-sparkleshare-iii-24.png new file mode 100644 index 0000000000000000000000000000000000000000..6f6b9e5858ec13ec6aef92dea2fb23588577b2b1 GIT binary patch literal 990 zcmV<410np0P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2ipb= z6$lnrTT+$)00Ul0L_t(Y$F-HuYg|Xm+sn5%&W{f{LAL^NM}*M7Q?* z8vxnN!Hsk7;$ts&rai}ijlhOrBCrv~LV?k~-&P|NK6|oT2mVt8#!%yG0W;WJu`$u` zCsNf>HtQSwfqdG6hAwPAioSIH~vquQrmx4awjfpQw2a|l;yc8wD{LItFXET zP0zeUZDTX21r$|XU#kMTuGON&W$s+>ZLEl(|E%O1l6d*KrFb2C2@W1_C$lGo8Tt~` zB7O?QMT?6S?z_j%pw&n&8X8ZYc^!iKvPWg_)ZjEdft?*el65!@hwx5cLQRqIN@rzR z3Ph#~Kx9FZ^_Zcrwz%Zuo_Y)8)ZxGS3b+AN{oj&lc^c18R&CwTRsjgj`cLuWJ!Vyz zAG%IBGt9!ZKQK{|rlY4QOpTECEBjHl1+XBFB0=291z4LT+uA{L@&}v*6lZUdJ>G?z z2{40~p|lh;h-{Tv6j=~Q5I=}L&f{HV4!_9VA3r8tpCXk>k@Sj;U;PxbuN^ts8Mpbn z2-E?#gdJv|M2(^4wU1zF3_J7%bgD0=CL7mTPj@vA#1+^=+~_y& z;bsm{TAZP+>k`hP(=3e-a__r$NhCe?AKZs*vJppODcS%~aaO~yP@AYtv$>U<+xD=w zlE;6jmgyTk?0?~HN_|&2(%x33f)bRX5>}km7zZNa8IjqQ`8jao5hVNsnQWS5O@K51 z3%7eNQoQs1Hn)qKMKN}{TWh*KuqF9YsG6et0as@jb!v&_Z+CR#rDPb*7*b%7 M07*qoM6N<$fPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2ipb= z6$m7si~|+`00Uh~L_t(Y$F-GTY|~W~$3N%y>pyC{Hf=(2bKnSLTX;~0LQIT4!Lx`a zMjbww?3Kj$=qm{(z8GWlb>RU?FmaDYMH6ErvIR1kTZqgxFxIWCWvuPm{(ko!A6lTL zg{X5U`Q`q8zkBZep6~gdbFZi>+i4ElY}*bHX#KeQo}3bKKUO5%;iw)pX`qZjb7N>u!_{Mu_bV6tT69Z$|;c69gZL-5LnA}6( z{(U=c&Rw6rdh&6Z)rtroJvX7Bbp`MYcz0JZUYE7`EWu>I>^-nAp!Pn)#;Dc@R_I)Upz~pZJldMFqj7jd`S>4qE;2Wj1wu06k{<8{|P1yC~ zQKFdvPzxxk+IUw5v@xnhYb6$bn#^=CxH2ZWWQ0I*ZKJ)813{j7{t$`&J@_-{z~6jg z`0jxdXg85-hRo=RcOaZ-M%0W>4fr+O!{f-ntN7o3fCQtsBd=rgbJ*<9?PV$8n=Syp z1&Jguv*$aasz0?Gr*MnPt$9+%Cy;OquUvri5VCx^qjf#o1;8_nNeOl9u_}>NAG!16 ztS?-qyt2U1*r((!eMRph{_k~<-k(S$PBImzUi^!~?DzB>JB>t>?Q5RIKpmi! zvcmki56KK4CiTMGu=*=fEf61kgW%c{#QM<8D3YIQVc;~<-Aw~=1wxTF#!tr!Z2a*x zmAk8?_Z}kDf0XQZpW`|nbi{Df2{ zNg|yfl}SEQq9Mw~A_mEeNB|%pA_9b$*UgXDE?#=~$dN%;(Dr6S39CbItVYC1;IEV) z&fh;KP>i|5%=D63S~oucVG%I_KmhlP-?{L<&Aqa?m>by24R*Us_RAT*X%s9XO@I)P z28NpBR;&oj0c${AR230%nu3R#fLk#I>VU7R_Q93e)Z%|LZEpNGr&WO1p2d9R00000 LNkvXXu0mjfURl~v literal 0 HcmV?d00001 diff --git a/data/icons/process-syncing-sparkleshare-iiiii-24.png b/data/icons/process-syncing-sparkleshare-iiiii-24.png new file mode 100644 index 0000000000000000000000000000000000000000..a0e2476aad315141a0dafa9e2ac96edb6b1d9357 GIT binary patch literal 993 zcmV<710MW|P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2ipb= z6$mzLHF91600Uu3L_t(Y$F-GDXk1kk#((F%H*fx!Oealj23u27n%bC!ZB+)PRS*>v zTopwyjSI2hLb`KRH@Z;}H-gR5;6e&Tj4lKr_y<9$2`yu!;zB2;F;nC4l4df=%zO79 z7c<7Z&IHt$1BZLxpymMOE2NbJ%6ubpUVc$JOWMoQV6TBFVN$wSi*K9-q)l z{{}#|_F#I(sa9^F^}qjFh1xpg z?|+O;{~)LZRTSOagEm*SXuZnMUrhG5F}QL@%DEI?P+5)7v6tY$v3tq(b%Ru~rLWLx zdE4^ck<)0WCf5!9Cr*z-GTW?dvnqqG%!BLW7GAw?HG(d$TyH9#X+H*<4q=2ir!NYQ`L0}(j# z40XB@Zy&ecag0WAoy0Bi;y9fpQgLcwV;a9MvB*mqygUic^aLh=}*WQ|=#Y%aws#t_Rd2i41rdNZf`nNgiG^#YkPecSrF0Po*XQ#d$Efj`aA%6WqxqGl5#}Ul* zMGT6l#j0XA;}l~J#hC@Ouwtfwq=*==IsLd7zUR^lw){}3R36;P3-;R@bK^xm0$iG% zLjWJ>1@3CCJFx(`22_BCs461jwEE$<0C!>vG=NA|?dFr&>c#(N+B*18ikgZaIsqT_ P00000NkvXXu0mjfoe9~H literal 0 HcmV?d00001 From 266f128733708e3966e4bcc10b13bcc896572c15 Mon Sep 17 00:00:00 2001 From: Hylke Date: Sun, 12 Jun 2011 15:12:58 -0700 Subject: [PATCH 39/43] statusicon remove debug line --- SparkleShare/SparkleStatusIcon.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index b577eabe..0b5059aa 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -146,7 +146,6 @@ namespace SparkleShare { Application.Invoke (delegate { if (UseIndicator) { this.indicator.IconName = icon_name; - Console.WriteLine (icon_name); } else { this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon (icon_name, 24); } From fc7725217180b62f882f8946683d6cca74332d1b Mon Sep 17 00:00:00 2001 From: Hylke Date: Sun, 12 Jun 2011 15:32:17 -0700 Subject: [PATCH 40/43] statusicon: add ifdefs --- SparkleShare/SparkleStatusIcon.cs | 78 ++++++++++++++++--------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 0b5059aa..ede28cb5 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -19,27 +19,29 @@ using System; using System.IO; using System.Timers; +#ifdef USE_APPINDICATOR +using AppIndicator; +#endif using Gtk; using Mono.Unix; -using AppIndicator; - namespace SparkleShare { // The statusicon that stays in the // user's notification area public class SparkleStatusIcon { - public bool UseIndicator = true; - private Timer Animation; private Gdk.Pixbuf [] AnimationFrames; private int FrameNumber; private string StateText; private Menu Menu; - private StatusIcon status_icon; + #ifdef USE_APPINDICATOR private ApplicationIndicator indicator; + #else + private StatusIcon status_icon; + #endif // Short alias for the translations public static string _ (string s) @@ -53,19 +55,18 @@ namespace SparkleShare { AnimationFrames = CreateAnimationFrames (); Animation = CreateAnimation (); - if (UseIndicator) { - this.indicator = new ApplicationIndicator ("sparkleshare", - "process-syncing-sparkleshare-i", Category.ApplicationStatus) { + #ifdef USE_APPINDICATOR + this.indicator = new ApplicationIndicator ("sparkleshare", + "process-syncing-sparkleshare-i", Category.ApplicationStatus) { - Status = Status.Attention - }; + Status = Status.Attention + }; + #else + this.status_icon = new StatusIcon (); - } else { - this.status_icon = new StatusIcon (); - - this.status_icon.Activate += ShowMenu; // Primary mouse button click - this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click - } + this.status_icon.Activate += ShowMenu; // Primary mouse button click + this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click + #endif SetNormalState (); CreateMenu (); @@ -144,11 +145,11 @@ namespace SparkleShare { icon_name += "i"; Application.Invoke (delegate { - if (UseIndicator) { - this.indicator.IconName = icon_name; - } else { - this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon (icon_name, 24); - } + #ifdef USE_APPINDICATOR + this.indicator.IconName = icon_name; + #else + this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon (icon_name, 24); + #endif }); }; @@ -291,8 +292,9 @@ namespace SparkleShare { Menu.Add (quit_item); Menu.ShowAll (); - if (UseIndicator) - this.indicator.Menu = Menu; + #ifdef USE_APPINDICATOR + this.indicator.Menu = Menu; + #endif } @@ -350,11 +352,11 @@ namespace SparkleShare { StateText = _("Welcome to SparkleShare!"); Application.Invoke (delegate { - if (UseIndicator) { - this.indicator.IconName = "process-syncing-sparkleshare-i"; - } else { - this.status_icon.Pixbuf = AnimationFrames [0]; - } + #ifdef USE_APPINDICATOR + this.indicator.IconName = "process-syncing-sparkleshare-i"; + #else + this.status_icon.Pixbuf = AnimationFrames [0]; + #endif }); } else { @@ -362,20 +364,20 @@ namespace SparkleShare { StateText = _("Not everything is synced"); Application.Invoke (delegate { - if (UseIndicator) { - this.indicator.IconName = "sparkleshare-syncing-error"; - } else { - this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24); - } + #ifdef USE_APPINDICATOR + this.indicator.IconName = "sparkleshare-syncing-error"; + #else + this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24); + #endif }); } else { StateText = _("Up to date") + " (" + SparkleShare.Controller.FolderSize + ")"; Application.Invoke (delegate { - if (UseIndicator) { - this.indicator.IconName = "process-syncing-sparkleshare-i"; - } else { - this.status_icon.Pixbuf = AnimationFrames [0]; - } + #ifdef USE_APPINDICATOR + this.indicator.IconName = "process-syncing-sparkleshare-i"; + #else + this.status_icon.Pixbuf = AnimationFrames [0]; + #endif }); } } From aa9a5a0b43b2f648749606e7078ffeb6c1189d31 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Mon, 13 Jun 2011 00:51:07 +0200 Subject: [PATCH 41/43] Fix preprocessor directives for AppIndicator support --- SparkleShare/Makefile.am | 3 +++ SparkleShare/SparkleStatusIcon.cs | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/SparkleShare/Makefile.am b/SparkleShare/Makefile.am index f39777ab..c757da22 100644 --- a/SparkleShare/Makefile.am +++ b/SparkleShare/Makefile.am @@ -7,6 +7,9 @@ TARGET = exe LINK = $(REF_SPARKLESHARE) $(NOTIFY_SHARP_LIBS) $(WEBKIT_SHARP_LIBS) +if HAVE_APP_INDICATOR +BUILD_DEFINES="-define:HAVE_APP_INDICATOR" +endif SOURCES = \ SparkleAbout.cs \ diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index ede28cb5..333ab67c 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -19,7 +19,7 @@ using System; using System.IO; using System.Timers; -#ifdef USE_APPINDICATOR +#if HAVE_APP_INDICATOR using AppIndicator; #endif using Gtk; @@ -37,7 +37,7 @@ namespace SparkleShare { private string StateText; private Menu Menu; - #ifdef USE_APPINDICATOR + #if HAVE_APP_INDICATOR private ApplicationIndicator indicator; #else private StatusIcon status_icon; @@ -55,7 +55,7 @@ namespace SparkleShare { AnimationFrames = CreateAnimationFrames (); Animation = CreateAnimation (); - #ifdef USE_APPINDICATOR + #if HAVE_APP_INDICATOR this.indicator = new ApplicationIndicator ("sparkleshare", "process-syncing-sparkleshare-i", Category.ApplicationStatus) { @@ -145,7 +145,7 @@ namespace SparkleShare { icon_name += "i"; Application.Invoke (delegate { - #ifdef USE_APPINDICATOR + #if HAVE_APP_INDICATOR this.indicator.IconName = icon_name; #else this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon (icon_name, 24); @@ -292,7 +292,7 @@ namespace SparkleShare { Menu.Add (quit_item); Menu.ShowAll (); - #ifdef USE_APPINDICATOR + #if HAVE_APP_INDICATOR this.indicator.Menu = Menu; #endif } @@ -321,7 +321,7 @@ namespace SparkleShare { Menu.ShowAll (); } - + #if !HAVE_APP_INDICATOR // Makes the menu visible private void ShowMenu (object o, EventArgs args) { @@ -334,7 +334,7 @@ namespace SparkleShare { { StatusIcon.PositionMenu (menu, out x, out y, out push_in, this.status_icon.Handle); } - + #endif // The state when there's nothing going on private void SetNormalState () @@ -352,7 +352,7 @@ namespace SparkleShare { StateText = _("Welcome to SparkleShare!"); Application.Invoke (delegate { - #ifdef USE_APPINDICATOR + #if HAVE_APP_INDICATOR this.indicator.IconName = "process-syncing-sparkleshare-i"; #else this.status_icon.Pixbuf = AnimationFrames [0]; @@ -364,7 +364,7 @@ namespace SparkleShare { StateText = _("Not everything is synced"); Application.Invoke (delegate { - #ifdef USE_APPINDICATOR + #if HAVE_APP_INDICATOR this.indicator.IconName = "sparkleshare-syncing-error"; #else this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24); @@ -373,7 +373,7 @@ namespace SparkleShare { } else { StateText = _("Up to date") + " (" + SparkleShare.Controller.FolderSize + ")"; Application.Invoke (delegate { - #ifdef USE_APPINDICATOR + #if HAVE_APP_INDICATOR this.indicator.IconName = "process-syncing-sparkleshare-i"; #else this.status_icon.Pixbuf = AnimationFrames [0]; From 8b8eefe93c78e3b24ff05bc7a4a51c4e8e735b19 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 13 Jun 2011 00:19:18 +0100 Subject: [PATCH 42/43] Update README with instructions on how to build with libappindicator support --- README | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README b/README index b8b921cb..c3f265d1 100644 --- a/README +++ b/README @@ -63,13 +63,18 @@ Note: Build on Linux: =============== -Installing the build dependencies on Debian: +Installing the build dependencies on Debian or Ubuntu: $ sudo apt-get install gtk-sharp2 mono-runtime mono-devel monodevelop \ libndesk-dbus1.0-cil-dev nant libnotify-cil-dev libgtk2.0-cil-dev \ libwebkit-cil-dev intltool libtool python-nautilus libndesk-dbus-glib1.0-cil-dev -Or on Fedora: +For Ubuntu libappindicator support, run the following before building: + + $ sudo apt-get install libappindicator0.1-cil-dev + + +On Fedora: $ sudo yum install gtk-sharp2-devel mono-core mono-devel monodevelop \ ndesk-dbus-devel ndesk-dbus-glib-devel nautilus-python-devel nant \ @@ -79,13 +84,13 @@ Or on Fedora: You can build and install SparkleShare like this: - $ ./configure (or ./autogen if you got SparkleShare from the repository) + $ ./configure --prefix=/usr (or ./autogen.sh if you build from the repository) $ make $ sudo make install Note: - Use './configure --prefix=/usr' if you want the Nautilus extension to work. + Use '--prefix=/usr' if you want the Nautilus extension to work. Run on Mac: From 67f8885cc1204f34d40296eabce110fb1459c99f Mon Sep 17 00:00:00 2001 From: Hylke Date: Sun, 12 Jun 2011 16:28:16 -0700 Subject: [PATCH 43/43] statusicon: simplify status text update code. fixes menu item moving about in appindicator --- SparkleShare/SparkleStatusIcon.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 333ab67c..3c29c866 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -310,14 +310,7 @@ namespace SparkleShare { public void UpdateMenu () { - Menu.Remove (Menu.Children [0]); - - MenuItem status_menu_item = new MenuItem (StateText) { - Sensitive = false - }; - - Menu.Add (status_menu_item); - Menu.ReorderChild (status_menu_item, 0); + ((Menu.Children [0] as MenuItem).Child as Label).Text = StateText; Menu.ShowAll (); }