示例#1
0
		public ActionMenuItem (TileAction action) : base (action.Name)
		{
			this.action_delegate = action.Action;

			if (action.Stock != null) {
				Gtk.Image image = new Gtk.Image ();
				image.SetFromStock (action.Stock, IconSize.Menu);
				image.Show ();
				this.Image = image;
			}
		}
示例#2
0
		protected void RemoveAction (TileAction action)
		{
			actions.Remove (action);
		}
示例#3
0
		private void ShowPopupMenu ()
		{
			Gtk.Menu menu = new Gtk.Menu ();
			
			// Add the default 'Open' menu item

			TileAction open = new TileAction (Catalog.GetString ("Open"), Stock.Open, Open);

			ActionMenuItem open_menu_item = new ActionMenuItem (open);
			menu.Append (open_menu_item);

			if (EnableOpenWith) {
				// FIXME: Not sure if going with the parent is
				// the right thing to do in all cases.
				string mimetype = Utils.GetFirstPropertyOfParent (hit, "beagle:MimeType");

				OpenWithMenu owm = new OpenWithMenu (mimetype);
				owm.ApplicationActivated += OpenWith;
				owm.AppendToMenu (menu);
			}

			if (Actions.Count > 0) {
				SeparatorMenuItem separator = new SeparatorMenuItem ();
				menu.Append (separator);

				foreach (TileAction action in Actions) {
					ActionMenuItem item = new ActionMenuItem (action);
					menu.Append (item);
				}
			}

			menu.ShowAll ();
			menu.Popup ();
		}
示例#4
0
		protected void AddAction (TileAction action)
		{
			actions.Add (action);
		}