public static Hyena.Widgets.ImageButton CreateImageButton(this Gtk.Action action) { var button = new Hyena.Widgets.ImageButton(action.ShortLabel, action.IconName); action.ConnectProxy(button); return(button); }
public QueryBox (Client app) { this.app = app; AppPaintable = true; hbox = new HBox () { BorderWidth = 6 }; Entry = new Gtk.Entry () { WidthChars = 40 }; Entry.Activated += OnActivated; var query_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("Select Matching"), Gtk.Stock.Find); query_button.Clicked += OnActivated; var close_button = new Hyena.Widgets.ImageButton (null, Gtk.Stock.Close); close_button.Clicked += delegate { Hide (); }; hbox.PackStart (Entry, true, true, 0); hbox.PackStart (query_button, false, false, 0); hbox.PackStart (close_button, false, false, 0); Child = hbox; KeyPressEvent += delegate (object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { Hide (); } }; ShowAll (); }
public FixSource() : base(Catalog.GetString("Metadata Fixer"), Catalog.GetString("Metadata Fixer"), -1) { TypeUniqueId = "fixes"; var header_widget = new HBox() { Spacing = 6 }; header_widget.PackStart(new Label(Catalog.GetString("Problem Type:")), false, false, 0); var combo = new Banshee.Widgets.DictionaryComboBox <Solver> (); foreach (var solver in problem_model.Solvers) { combo.Add(solver.Name, solver); } combo.Changed += (o, a) => { problem_model.Solver = combo.ActiveValue; SetStatus(problem_model.Solver.Description, false, false, "gtk-info"); }; combo.Active = 0; var apply_button = new Hyena.Widgets.ImageButton(Catalog.GetString("Apply Selected Fixes"), "gtk-apply"); apply_button.Clicked += (o, a) => problem_model.Fix(); problem_model.Reloaded += (o, a) => apply_button.Sensitive = problem_model.SelectedCount > 0; header_widget.PackStart(combo, false, false, 0); header_widget.PackStart(apply_button, false, false, 0); header_widget.ShowAll(); Properties.SetStringList("Icon.Name", "search", "gtk-search"); Properties.SetString("ActiveSourceUIResource", "ActiveUI.xml"); Properties.SetString("GtkActionPath", "/FixSourcePopup"); Properties.Set <Gtk.Widget> ("Nereid.SourceContents.HeaderWidget", header_widget); Properties.Set <Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new View(problem_model)); Properties.SetString("UnmapSourceActionLabel", Catalog.GetString("Close")); Properties.SetString("UnmapSourceActionIconName", "gtk-close"); var actions = new BansheeActionGroup("fix-source"); actions.AddImportant( new ActionEntry("RefreshProblems", Stock.Refresh, Catalog.GetString("Refresh"), null, null, (o, a) => { problem_model.Refresh(); }) ); actions.Register(); problem_model.Reload(); }
void BuildButtons() { revert_button = new Hyena.Widgets.ImageButton(Catalog.GetString("_Revert Properties"), "revert"); revert_button.TooltipText = Catalog.GetString("Change the document's properties back to the original values"); revert_button.Clicked += HandleRevert; var close_button = new Hyena.Widgets.ImageButton(Catalog.GetString("_Close"), Gtk.Stock.Close); close_button.TooltipText = Catalog.GetString("Hide the document's properties"); close_button.Clicked += delegate { Hide(); }; table.Attach(revert_button, 4, 5, 0, 1, AttachOptions.Fill, 0, 0, 0); table.Attach(close_button, 4, 5, 1, 2, AttachOptions.Fill, 0, 0, 0); }
public FixSource () : base (Catalog.GetString ("Metadata Fixer"), Catalog.GetString ("Metadata Fixer"), -1) { TypeUniqueId = "fixes"; var header_widget = new HBox () { Spacing = 6 }; header_widget.PackStart (new Label (Catalog.GetString ("Problem Type:")), false, false, 0); var combo = new Banshee.Widgets.DictionaryComboBox<Solver> (); foreach (var solver in problem_model.Solvers) { combo.Add (solver.Name, solver); } combo.Changed += (o, a) => { problem_model.Solver = combo.ActiveValue; SetStatus (problem_model.Solver.Description, false, false, "gtk-info"); }; combo.Active = 0; var apply_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("Apply Selected Fixes"), "gtk-apply"); apply_button.Clicked += (o, a) => problem_model.Fix (); problem_model.Reloaded += (o, a) => apply_button.Sensitive = problem_model.SelectedCount > 0; header_widget.PackStart (combo, false, false, 0); header_widget.PackStart (apply_button, false, false, 0); header_widget.ShowAll (); Properties.SetStringList ("Icon.Name", "search", "gtk-search"); Properties.SetString ("ActiveSourceUIResource", "ActiveUI.xml"); Properties.SetString ("GtkActionPath", "/FixSourcePopup"); Properties.Set<Gtk.Widget> ("Nereid.SourceContents.HeaderWidget", header_widget); Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new View (problem_model)); Properties.SetString ("UnmapSourceActionLabel", Catalog.GetString ("Close")); Properties.SetString ("UnmapSourceActionIconName", "gtk-close"); var actions = new BansheeActionGroup ("fix-source"); actions.AddImportant ( new ActionEntry ("RefreshProblems", Stock.Refresh, Catalog.GetString ("Refresh"), null, null, (o, a) => { problem_model.Refresh (); }) ); actions.Register (); problem_model.Reload (); }
public QueryBox(Client app) { this.app = app; AppPaintable = true; hbox = new HBox() { BorderWidth = 6 }; Entry = new Gtk.Entry() { WidthChars = 40 }; Entry.Activated += OnActivated; var query_button = new Hyena.Widgets.ImageButton(Catalog.GetString("Select Matching"), Gtk.Stock.Find); query_button.Clicked += OnActivated; var close_button = new Hyena.Widgets.ImageButton(null, Gtk.Stock.Close); close_button.Clicked += delegate { Hide(); }; hbox.PackStart(Entry, true, true, 0); hbox.PackStart(query_button, false, false, 0); hbox.PackStart(close_button, false, false, 0); Child = hbox; KeyPressEvent += delegate(object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { Hide(); } }; ShowAll(); }
void BuildButtons () { revert_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("_Revert Properties"), "revert"); revert_button.TooltipText = Catalog.GetString ("Change the document's properties back to the original values"); revert_button.Clicked += HandleRevert; var close_button = new Hyena.Widgets.ImageButton (Catalog.GetString ("_Close"), Gtk.Stock.Close); close_button.TooltipText = Catalog.GetString ("Hide the document's properties"); close_button.Clicked += delegate { Hide (); }; table.Attach (revert_button, 4, 5, 0, 1, AttachOptions.Fill, 0, 0, 0); table.Attach (close_button, 4, 5, 1, 2, AttachOptions.Fill, 0, 0, 0); }
public static Hyena.Widgets.ImageButton CreateImageButton (this Gtk.Action action) { var button = new Hyena.Widgets.ImageButton (action.ShortLabel, action.IconName); action.ConnectProxy (button); return button; }