windows statusicon: clean up

This commit is contained in:
Hylke Bons 2012-11-25 13:33:12 +00:00
parent 38b4fd8e81
commit 2b1fa6a57c
2 changed files with 28 additions and 48 deletions

View file

@ -26,6 +26,6 @@ using System.Reflection;
namespace SparkleLib { namespace SparkleLib {
public class Defines { public class Defines {
public const string INSTALL_DIR = "/usr/local/share/sparkleshare"; public const string INSTALL_DIR = "/usr/share/sparkleshare";
} }
} }

View file

@ -114,8 +114,6 @@ namespace SparkleShare {
IsEnabled = false IsEnabled = false
}; };
this.notify_icon.HeaderText = "SparkleShare\n" + Controller.StateText;
Image folder_image = new Image () { Image folder_image = new Image () {
Source = SparkleUIHelpers.GetImageSource ("sparkleshare-folder"), Source = SparkleUIHelpers.GetImageSource ("sparkleshare-folder"),
Width = 16, Width = 16,
@ -127,34 +125,29 @@ namespace SparkleShare {
Icon = folder_image Icon = folder_image
}; };
SparkleMenuItem add_item = new SparkleMenuItem () { SparkleMenuItem add_item = new SparkleMenuItem () { Header = "Add hosted project…" };
Header = "Add hosted project…"
};
add_item.Click += delegate {
Controller.AddHostedProjectClicked ();
};
this.log_item = new SparkleMenuItem () { this.log_item = new SparkleMenuItem () {
Header = "Recent changes…", Header = "Recent changes…",
IsEnabled = Controller.RecentEventsItemEnabled IsEnabled = Controller.RecentEventsItemEnabled
}; };
this.log_item.Click += delegate {
Controller.RecentEventsClicked ();
};
SparkleMenuItem notify_item = new SparkleMenuItem () {
Header = "Notifications"
};
CheckBox notify_check_box = new CheckBox () { CheckBox notify_check_box = new CheckBox () {
Margin = new Thickness (6, 0, 0, 0), Margin = new Thickness (6, 0, 0, 0),
IsChecked = (Controller.Folders.Length > 0 && Program.Controller.NotificationsEnabled) IsChecked = (Controller.Folders.Length > 0 && Program.Controller.NotificationsEnabled)
}; };
SparkleMenuItem notify_item = new SparkleMenuItem () { Header = "Notifications" };
notify_item.Icon = notify_check_box; notify_item.Icon = notify_check_box;
SparkleMenuItem about_item = new SparkleMenuItem () { Header = "About SparkleShare" };
this.exit_item = new SparkleMenuItem () { Header = "Exit" };
add_item.Click += Controller.AddHostedProjectClicked;
this.log_item.Click += Controller.RecentEventsClicked;
about_item.Click += Controller.AboutClicked;
notify_check_box.Click += delegate { notify_check_box.Click += delegate {
this.context_menu.IsOpen = false; this.context_menu.IsOpen = false;
Program.Controller.ToggleNotifications (); Program.Controller.ToggleNotifications ();
@ -166,18 +159,6 @@ namespace SparkleShare {
notify_check_box.IsChecked = Program.Controller.NotificationsEnabled; notify_check_box.IsChecked = Program.Controller.NotificationsEnabled;
}; };
SparkleMenuItem about_item = new SparkleMenuItem () {
Header = "About SparkleShare"
};
about_item.Click += delegate {
Controller.AboutClicked ();
};
this.exit_item = new SparkleMenuItem () {
Header = "Exit"
};
this.exit_item.Click += delegate { this.exit_item.Click += delegate {
this.notify_icon.Dispose (); this.notify_icon.Dispose ();
Controller.QuitClicked (); Controller.QuitClicked ();
@ -229,7 +210,6 @@ namespace SparkleShare {
} }
this.context_menu.Items.Add (subfolder_item); this.context_menu.Items.Add (subfolder_item);
i++; i++;
} }
} }