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; } }
protected void RemoveAction (TileAction action) { actions.Remove (action); }
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 (); }
protected void AddAction (TileAction action) { actions.Add (action); }