private void Initialize() { interface_action_service.GlobalActions.Add(new Gtk3.ActionEntry [] { new Gtk3.ActionEntry("CloseAction", Gtk3.Stock.Close, AddinManager.CurrentLocalizer.GetString("_Close"), "<Control>W", AddinManager.CurrentLocalizer.GetString("Close"), CloseWindow) }); actions = new BansheeActionGroup(interface_action_service, "AppIndicator"); actions.Add(new Gtk3.ToggleActionEntry [] { new Gtk3.ToggleActionEntry("ShowHideAction", null, AddinManager.CurrentLocalizer.GetString("_Show Banshee"), null, AddinManager.CurrentLocalizer.GetString("Show the Banshee main window"), ToggleShowHide, PrimaryWindowVisible) }); interface_action_service.AddActionGroup(actions); ui_manager_id = (int)interface_action_service.UIManager.AddUiFromResource("AppIndicatorMenu.xml"); ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent, PlayerEvent.StartOfStream | PlayerEvent.EndOfStream | PlayerEvent.TrackInfoUpdated | PlayerEvent.StateChange); artwork_manager_service = ServiceManager.Get <ArtworkManager> (); artwork_manager_service.AddCachedSize(icon_size); // Forcefully load this show_notifications = ShowNotifications; DrawAppIndicator(); }
private void Initialize() { interface_action_service.GlobalActions.Add(new ActionEntry [] { new ActionEntry("CloseAction", Stock.Close, Catalog.GetString("_Close"), "<Control>W", Catalog.GetString("Close"), CloseWindow) }); actions = new BansheeActionGroup(interface_action_service, "NotificationArea"); actions.Add(new ToggleActionEntry [] { new ToggleActionEntry("ToggleNotificationsAction", null, Catalog.GetString("_Show Notifications"), null, Catalog.GetString("Show notifications when item changes"), ToggleNotifications, ShowNotifications) }); interface_action_service.AddActionGroup(actions); ui_manager_id = (int)interface_action_service.UIManager.AddUiFromResource("NotificationAreaMenu.xml"); ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent, PlayerEvent.StartOfStream | PlayerEvent.EndOfStream | PlayerEvent.TrackInfoUpdated | PlayerEvent.StateChange); // Forcefully load this show_notifications = ShowNotifications; artwork_manager_service = ServiceManager.Get <ArtworkManager> (); artwork_manager_service.AddCachedSize(icon_size); }
public WebSource(string name, int order, string id) : base(name, name, order, id) { TypeUniqueId = id; Properties.Set <bool> ("Nereid.SourceContents.HeaderVisible", false); actions = new BansheeActionGroup(id); actions.Add( new ActionEntry("ZoomIn" + id, Stock.ZoomIn, null, "<control>plus", null, (o, a) => view.ZoomIn()), new ActionEntry("ZoomOut" + id, Stock.ZoomOut, null, "<control>minus", null, (o, a) => view.ZoomOut()), new ActionEntry("Zoom100" + id, Stock.Zoom100, null, "<control>0", null, (o, a) => view.Zoom = 1f) ); Properties.Set <string> ("ActiveSourceUIString", String.Format(@" <ui> <menubar name=""MainMenu"" action=""MainMenuAction""> <menu name=""ViewMenu"" action=""ViewMenuAction""> <placeholder name=""ViewMenuAdditions""> <separator/> <menuitem action=""ZoomIn{0}""/> <menuitem action=""ZoomOut{0}""/> <menuitem action=""Zoom100{0}""/> <separator/> </placeholder> </menu> </menubar> </ui>", TypeUniqueId )); Properties.Set <BansheeActionGroup> ("ActiveSourceActions", actions); }