windows statusicon: implement link code item. closes #1129

This commit is contained in:
Hylke Bons 2013-03-09 14:03:01 +00:00
parent 008736d229
commit c228337e1b
6 changed files with 21 additions and 5 deletions

View file

@ -621,7 +621,7 @@ namespace SparkleShare {
}
case 4: {
Header = "Here's your unique link code";
Header = "Here's your unique client ID";
Description = "You'll need it whenever you want to link this computer to a host. " +
"You can also find it in the status icon menu.";

View file

@ -194,7 +194,7 @@ namespace SparkleShare {
});
};
MenuItem link_code_item = new MenuItem ("Link Code");
MenuItem link_code_item = new MenuItem ("Client ID");
if (Controller.LinkCodeItemEnabled) {
link_code_item.Submenu = new Menu ();

View file

@ -657,7 +657,7 @@ namespace SparkleShare {
}
case 4: {
Header = "Here's your unique link code";
Header = "Here's your unique client ID";
Description = "You'll need it whenever you want to link this computer to a host. " +
" You can also find it in the status icon menu.";

View file

@ -138,7 +138,7 @@ namespace SparkleShare {
};
this.link_code_item = new NSMenuItem ();
this.link_code_item.Title = "Link Code";
this.link_code_item.Title = "Client ID";
if (Controller.LinkCodeItemEnabled) {
this.link_code_submenu = new NSMenu ();

View file

@ -903,7 +903,7 @@ namespace SparkleShare {
}
case 4: {
Header = "Here's your unique link code";
Header = "Here's your unique client ID";
Description = "You'll need it whenever you want to link this computer to a host. " +
"You can also find it in the status icon menu.";

View file

@ -132,6 +132,20 @@ namespace SparkleShare {
IsEnabled = Controller.RecentEventsItemEnabled
};
SparkleMenuItem link_code_item = new SparkleMenuItem () { Header = "Client ID" };
if (Controller.LinkCodeItemEnabled) {
SparkleMenuItem code_item = new SparkleMenuItem ();
code_item.Header = Program.Controller.CurrentUser.PublicKey.Substring (0, 20) + "...";
SparkleMenuItem copy_item = new SparkleMenuItem () { Header = "Copy to Clipboard" };
copy_item.Click += delegate { Controller.CopyToClipboardClicked (); };
link_code_item.Items.Add (code_item);
link_code_item.Items.Add (new Separator);
link_code_item.Items.Add (this.copy_item);
}
CheckBox notify_check_box = new CheckBox () {
Margin = new Thickness (6, 0, 0, 0),
IsChecked = Program.Controller.NotificationsEnabled
@ -219,6 +233,8 @@ namespace SparkleShare {
folder_item.Items.Add (new Separator ());
folder_item.Items.Add (notify_item);
folder_item.Items.Add (new Separator ());
folder_item.Items.Add (link_code_item);
folder_item.Items.Add (new Separator ());
folder_item.Items.Add (about_item);
this.context_menu.Items.Add (new Separator ());