statusicon: remove noisy 'No projects yet' item and disable notifications item on zero folders

This commit is contained in:
Hylke Bons 2012-04-11 14:59:02 +02:00
parent 5fe7284385
commit fbebc52220
3 changed files with 4 additions and 23 deletions

View file

@ -187,12 +187,6 @@ namespace SparkleShare {
this.menu.Add (more_item);
}
} else {
MenuItem no_folders_item = new MenuItem (_("No projects yet")) {
Sensitive = false
};
this.menu.Add (no_folders_item);
}
this.menu.Add (new SeparatorMenuItem ());
@ -217,7 +211,7 @@ namespace SparkleShare {
this.menu.Add (new SeparatorMenuItem ());
CheckMenuItem notify_item = new CheckMenuItem (_("Notifications")) {
Active = Program.Controller.NotificationsEnabled
Active = (Controller.Folders.Length > 0 && Program.Controller.NotificationsEnabled)
};
notify_item.Activated += delegate {

View file

@ -183,7 +183,7 @@ namespace SparkleShare {
}
this.notify_item = new NSMenuItem () {
Enabled = true
Enabled = (Controller.Folders.Length > 0)
};
if (Program.Controller.NotificationsEnabled)
@ -270,12 +270,6 @@ namespace SparkleShare {
i++;
};
} else {
this.folder_menu_items = new NSMenuItem [1];
this.folder_menu_items [0] = new NSMenuItem () {
Title = "No projects yet",
Enabled = false
};
}

View file

@ -141,8 +141,8 @@ namespace SparkleShare {
};
CheckBox notify_check_box = new CheckBox () {
Margin = new Thickness (6,0,0,0),
IsChecked = Program.Controller.NotificationsEnabled
Margin = new Thickness (6, 0, 0, 0),
IsChecked = (Controller.Folders.Length > 0 && Program.Controller.NotificationsEnabled)
};
notify_item.Icon = notify_check_box;
@ -242,13 +242,6 @@ namespace SparkleShare {
this.context_menu.Items.Add (more_item);
}
} else {
SparkleMenuItem no_folders_item = new SparkleMenuItem () {
Header = "No projects yet",
IsEnabled = false
};
this.context_menu.Items.Add (no_folders_item);
}
this.context_menu.Items.Add (new Separator ());