[statusicon] Make notification toggling the same as on Mac

This commit is contained in:
Hylke Bons 2011-03-04 00:55:21 +00:00
parent 70d15e31fb
commit 2f8d0199e6

View file

@ -191,7 +191,7 @@ namespace SparkleShare {
} }
// Opens the wizard to add a new remote folder // Opens the wizard to add a new remote folder
MenuItem sync_item = new MenuItem (_("Sync Remote Folder…")); MenuItem sync_item = new MenuItem (_("Add Remote Folder…"));
if (SparkleShare.Controller.FirstRun) if (SparkleShare.Controller.FirstRun)
sync_item.Sensitive = false; sync_item.Sensitive = false;
@ -208,14 +208,18 @@ namespace SparkleShare {
Menu.Add (sync_item); Menu.Add (sync_item);
Menu.Add (new SeparatorMenuItem ()); Menu.Add (new SeparatorMenuItem ());
// A checkbutton to toggle whether or not to show notifications MenuItem notify_item;
CheckMenuItem notify_item = new CheckMenuItem (_("Show Notifications"));
if (SparkleShare.Controller.NotificationsEnabled) if (SparkleShare.Controller.NotificationsEnabled)
notify_item.Active = true; notify_item = new MenuItem (_("Turn Notifications Off"));
else
notify_item = new MenuItem (_("Turn Notifications On"));
notify_item.Toggled += delegate { notify_item.Activated += delegate {
SparkleShare.Controller.ToggleNotifications (); SparkleShare.Controller.ToggleNotifications ();
CreateMenu ();
}; };
Menu.Add (notify_item); Menu.Add (notify_item);