diff --git a/SparkleShare/SparkleLog.cs b/SparkleShare/SparkleLog.cs index 9b465120..fe455cf5 100644 --- a/SparkleShare/SparkleLog.cs +++ b/SparkleShare/SparkleLog.cs @@ -154,7 +154,7 @@ namespace SparkleShare { } - HideAll (); // TODO: destroy it + HideAll (); } diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 815455ed..d12f02b6 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -30,8 +30,6 @@ namespace SparkleShare { public class SparkleStatusIcon : StatusIcon { - private List OpenLogs; - private Menu Menu; private MenuItem StatusMenuItem; private string StateText; @@ -52,7 +50,7 @@ namespace SparkleShare { public SparkleStatusIcon () : base () { - OpenLogs = new List (); + SparkleUI.OpenLogs = new List (); FolderSize = GetFolderSize (new DirectoryInfo (SparklePaths.SparklePath)); @@ -129,7 +127,7 @@ namespace SparkleShare { return delegate { - SparkleLog log = OpenLogs.Find (delegate (SparkleLog l) { return l.LocalPath.Equals (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 @@ -139,11 +137,13 @@ namespace SparkleShare { log = new SparkleLog (path); log.Hidden += delegate { - OpenLogs.Remove (log); - log = null; + + SparkleUI.OpenLogs.Remove (log); + log.Destroy (); + }; - OpenLogs.Add (log); + SparkleUI.OpenLogs.Add (log); } @@ -227,8 +227,10 @@ namespace SparkleShare { // Creates the menu that is popped up when the // user clicks the statusicon public void CreateMenu () - { - + {int i = 0; +foreach (SparkleLog logi in SparkleUI.OpenLogs){i++; +Console.WriteLine (i + ": " + logi.LocalPath); +} Menu = new Menu (); // The menu item showing the status and size of the SparkleShare folder @@ -267,6 +269,10 @@ namespace SparkleShare { IsImportant = true }; + if (repo.HasUnsyncedChanges){ + folder_action.IconName = "dialog-warning"; + Console.WriteLine ("FFFFFFFFFFFFFFFFFFFF"); +} folder_action.Activated += OpenLogDelegate (repo.LocalPath); MenuItem menu_item = (MenuItem) folder_action.CreateMenuItem (); @@ -354,6 +360,7 @@ namespace SparkleShare { private void ShowMenu (object o, EventArgs args) { + CreateMenu (); Menu.ShowAll (); Menu.Popup (null, null, SetPosition, 0, Global.CurrentEventTime); diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index c78495aa..be60b0d0 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -32,7 +32,7 @@ namespace SparkleShare { public static List Repositories; public static SparkleStatusIcon StatusIcon; - + public static List OpenLogs; // Short alias for the translations public static string _(string s) diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 7618c2ad..88e72484 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -28,7 +28,8 @@ app_theme_icons = \ status,document-added-16.png \ status,document-edited-16.png \ status,document-moved-16.png \ - status,document-removed-16.png + status,document-removed-16.png \ + status,dialog-warning-16.png install_icon_exec = $(top_srcdir)/build/icon-theme-installer \ -t "$(theme)" \ diff --git a/data/icons/dialog-warning.png b/data/icons/dialog-warning.png new file mode 100644 index 00000000..219432c4 Binary files /dev/null and b/data/icons/dialog-warning.png differ