コード例 #1
0
ファイル: MainWindow.cs プロジェクト: ruben206/ad
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        UiManagerHelper uiManagerHelper = new UiManagerHelper(UIManager);

        ActionGroup actionGroup1 = new ActionGroup("pageActionGroup");
        Gtk.Action newAction = new Gtk.Action("newAction", null, null, Stock.New);
        actionGroup1.Add (newAction);
        Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
        actionGroup1.Add (editAction);

        ActionGroup actionGroup2 = new ActionGroup("pageActionGroup");
        Gtk.Action deleteAction = new Gtk.Action("deleteAction", null, null, Stock.Delete);
        actionGroup2.Add (deleteAction);

        ActionGroup currentActionGroup = actionGroup1;
        uiManagerHelper.SetActionGroup (currentActionGroup);

        executeAction.Activated += delegate {
            Console.WriteLine("executeAction.Activated");
            if (currentActionGroup == actionGroup1)
                currentActionGroup = actionGroup2;
            else
                currentActionGroup = actionGroup1;
            uiManagerHelper.SetActionGroup(currentActionGroup);
        };
    }
コード例 #2
0
ファイル: Window.cs プロジェクト: konne88/MyInventory
        public Window(Inventory inventory)
            : this(new Builder("window.ui"))
        {
            Inventory = inventory;

            // load the menues and toolbars
            uiManager = new UIManager();

            // create the file actions
            Gtk.Action saveInventoryAction = new Gtk.Action("saveFile","Save","Save the active inventory",Stock.Save);
            saveInventoryAction.Activated += OnSaveInventory;
            Gtk.Action printLabelsAction = new Gtk.Action("printLabels","Print Labels","Print labels for items.",Stock.Print);
            printLabelsAction.Activated += OnPrintLabels;
            Gtk.Action quitAction = new Gtk.Action("quit","Quit","Quit the application",Stock.Quit);
            quitAction.Activated += OnQuit;
            Gtk.Action fileAction = new Gtk.Action("file","File");
            ActionGroup fileActionGroup = new ActionGroup("file");
            fileActionGroup.Add(saveInventoryAction);
            fileActionGroup.Add(printLabelsAction);
            fileActionGroup.Add(quitAction);
            fileActionGroup.Add(fileAction);
            uiManager.InsertActionGroup(fileActionGroup,0);

            // create items box
            itemsBox = new ItemsBox(inventory.Items, uiManager);
            itemsBox.DrawDescriptionEntry += OnDrawDescriptionEntry;
            itemsBox.ShowMe += OnShowItemsBox;
            itemsAlign.Add(itemsBox);

            // create locations box
            locationsBox = new LocationsBox(inventory.Locations, uiManager);
            locationsBox.DrawDescriptionEntry += OnDrawDescriptionEntry;
            locationsBox.ShowMe += OnShowLocationsBox;
            locationsBox.GotoItem += OnGotoLocationsItem;
            locationsAlign.Add(locationsBox);

            // create tags box
            tagsBox = new TagsBox(inventory.Tags, uiManager);
            tagsBox.ShowMe += OnShowTagsBox;
            tagsAlign.Add(tagsBox);

            // create tool and menubar
            uiManager.AddUiFromResource("window_menues.xml");
            menuBar = (MenuBar) uiManager.GetWidget("/menuBar");
            toolbar = (Toolbar) uiManager.GetWidget("/toolbar");
            toolbar.IconSize = IconSize.LargeToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Both;

            mainBox.PackStart(menuBar,false,true,0);
            mainBox.PackStart(toolbar,false,true,0);

            // laod category icons
            itemsTabImage.Pixbuf = ((GtkSettings)Inventory.Settings).ItemsTabIcon;
            locationsTabImage.Pixbuf = ((GtkSettings)Inventory.Settings).LocationsTabIcon;
            tagsTabImage.Pixbuf = ((GtkSettings)Inventory.Settings).TagsTabIcon;

            this.Icon = ((GtkSettings)Inventory.Settings).WindowIcon;
            this.Resize(((GtkSettings)Inventory.Settings).MainWindowWidth,((GtkSettings)Inventory.Settings).MainWindowHeight);
        }
コード例 #3
0
        public MainUIManager(ViewGui viewGui)
        {
            this.viewGui = viewGui;

            actions = new ActionGroup ("Actions");

            ActionEntry actionEntryQuit;
            actionEntryQuit = new ActionEntry("Quitter", Gtk.Stock.Quit,  null, "<control>Q", "Quitter l'environnement Sofia", new EventHandler (Quit));

            ActionEntry[] entries = new ActionEntry [] {
                new ActionEntry ("Fichier", null,	"_Fichier", null, null, null),
                new ActionEntry ("Editer", null,	"Editio_n", null, null, null),
                new ActionEntry ("Rechercher", null,	"Recher_cher", null, null, null),
                new ActionEntry ("Aide", null, "_Aide",  null, null, null),
                actionEntryQuit,
                new ActionEntry ("Préférences", Gtk.Stock.Preferences, null, null, "Préférences", new EventHandler (Preferences)),
                new ActionEntry ("RubriquesAide", Gtk.Stock.Help,  "Rubriques d'_aide",	 "F1", "Aide - Rubriques d'aide", new EventHandler (Help)),
                new ActionEntry ("APropos", Gtk.Stock.About, null, null, "A propos de l'environnement Sofia", new EventHandler (About))
            };
            actions.Add (entries);

            InsertActionGroup(actions, 0);
            this.viewGui.AddAccelGroup(AccelGroup);
            uint id = 0;
            try {
                id = AddUiFromFile("MainUIDef.xml");
            }
            catch {
                RemoveUi(id);
            }
        }
コード例 #4
0
		public override void Initialize ()
		{
			
			action_group = new Gtk.ActionGroup ("RemoveBrokenLinks");
			action_group.Add (new Gtk.ActionEntry [] {
				new Gtk.ActionEntry ("ToolsMenuAction", null,
				Catalog.GetString ("_Tools"), null, null, null),
				new Gtk.ActionEntry ("RemoveBrokenLinksAction", null,
				Catalog.GetString ("_Remove broken links"), null, null,
				delegate {
					OnRemoveBrokenLinksActivated ();
				})
			});
					
			rblUi = Tomboy.ActionManager.UI.AddUiFromString (@"
			                <ui>
			                <menubar name='MainWindowMenubar'>
			                <placeholder name='MainWindowMenuPlaceholder'>
			                <menu name='ToolsMenu' action='ToolsMenuAction'>
			                <menuitem name='RemoveBrokenLinks' action='RemoveBrokenLinksAction' />
			                </menu>
			                </placeholder>
			                </menubar>
			                </ui>
			                ");
			
			Tomboy.ActionManager.UI.InsertActionGroup (action_group, 0);			
			
			initialized = true;
		}
コード例 #5
0
ファイル: HelpUIHandler.cs プロジェクト: chergert/adroit
        void AddHelpActions(ActionGroup actionGroup)
        {
            var help = new Gtk.Action ("help", Catalog.GetString ("_Help"));
            actionGroup.Add (help);

            var about = new Gtk.Action ("about", null, null, Gtk.Stock.About);
            about.Activated += delegate {
                var dialog = new AboutDialog ();
                dialog.Authors = new string[] { "Christian Hergert" };
                dialog.License = Util.ReadResource ("Resources.license.txt");
                dialog.Copyright = "Copyright © 2008 Christian Hergert";
                dialog.Run ();
                dialog.Destroy ();
            };
            actionGroup.Add (about);
        }
コード例 #6
0
        public override void Initialize()
        {
            action_group = new Gtk.ActionGroup("RemoveBrokenLinks");
            action_group.Add(new Gtk.ActionEntry [] {
                new Gtk.ActionEntry("ToolsMenuAction", null,
                                    Catalog.GetString("_Tools"), null, null, null),
                new Gtk.ActionEntry("RemoveBrokenLinksAction", null,
                                    Catalog.GetString("_Remove broken links"), null, null,
                                    delegate {
                    OnRemoveBrokenLinksActivated();
                })
            });

            rblUi = Tomboy.ActionManager.UI.AddUiFromString(@"
			                <ui>
			                <menubar name='MainWindowMenubar'>
			                <placeholder name='MainWindowMenuPlaceholder'>
			                <menu name='ToolsMenu' action='ToolsMenuAction'>
			                <menuitem name='RemoveBrokenLinks' action='RemoveBrokenLinksAction' />
			                </menu>
			                </placeholder>
			                </menubar>
			                </ui>
			                "            );

            Tomboy.ActionManager.UI.InsertActionGroup(action_group, 0);

            initialized = true;
        }
コード例 #7
0
ファイル: Shell.cs プロジェクト: mono/heap-prof
    public Shell()
        : base("Mono Heap Profiler")
    {
        entries = new ActionEntry[] {
            new ActionEntry ("FileMenu", null, "_File", null, null, null),
            new ActionEntry ("OpenAction", Stock.Open, null, "<control>O", "Open a profile...", new EventHandler (OnOpen)),
            new ActionEntry ("QuitAction", Stock.Quit, null, "<control>Q", "Quit the application", delegate { Application.Quit (); }),
        };

        DefaultSize = new Gdk.Size (700, 700);
        DeleteEvent += delegate { Application.Quit (); };

        main_box = new VBox (false, 0);
        Add (main_box);

        shell_commands = new ActionGroup ("TestActions");
        shell_commands.Add (entries);

        uim = new UIManager ();
        uim.AddWidget += delegate (object obj, AddWidgetArgs args) {
            args.Widget.Show ();
            main_box.PackStart (args.Widget, false, true, 0);
        };

        uim.ConnectProxy += OnProxyConnect;
        uim.InsertActionGroup (shell_commands, 0);
        uim.AddUiFromResource ("shell-ui.xml");
        AddAccelGroup (uim.AccelGroup);

        sb = new Statusbar ();
        main_box.PackEnd (sb, false, true, 0);

        pager = new ShellPager (this);
        main_box.PackEnd (pager, true, true, 0);
    }
コード例 #8
0
        public MainUIManager(ViewGui viewGui)
        {
            this.viewGui = viewGui;

            actions = new ActionGroup("Actions");

            ActionEntry actionEntryQuit;

            actionEntryQuit = new ActionEntry("Quitter", Gtk.Stock.Quit, null, "<control>Q", "Quitter l'environnement Sofia", new EventHandler(Quit));

            ActionEntry[] entries = new ActionEntry [] {
                new ActionEntry("Fichier", null, "_Fichier", null, null, null),
                new ActionEntry("Editer", null, "Editio_n", null, null, null),
                new ActionEntry("Rechercher", null, "Recher_cher", null, null, null),
                new ActionEntry("Aide", null, "_Aide", null, null, null),
                actionEntryQuit,
                new ActionEntry("Préférences", Gtk.Stock.Preferences, null, null, "Préférences", new EventHandler(Preferences)),
                new ActionEntry("RubriquesAide", Gtk.Stock.Help, "Rubriques d'_aide", "F1", "Aide - Rubriques d'aide", new EventHandler(Help)),
                new ActionEntry("APropos", Gtk.Stock.About, null, null, "A propos de l'environnement Sofia", new EventHandler(About))
            };
            actions.Add(entries);

            InsertActionGroup(actions, 0);
            this.viewGui.AddAccelGroup(AccelGroup);
            uint id = 0;

            try {
                id = AddUiFromFile("MainUIDef.xml");
            }
            catch {
                RemoveUi(id);
            }
        }
コード例 #9
0
		public Navbar (Gtk.IconSize size)
		{
			address = new Entry ("address");
			// FIXME: this doesnt't seem to work yet
			// address.Completion = new EntryCompletion ();
			address.WidthChars = 50;
			address.Activated += new EventHandler (OnGoUrl);

			ActionEntry[] actions = new ActionEntry[]
			{
				new ActionEntry ("back", Gtk.Stock.GoBack, null, null, GettextCatalog.GetString ("Go back"), new EventHandler (OnBackClicked)),
				new ActionEntry ("forward", Gtk.Stock.GoForward, null, null, GettextCatalog.GetString ("Go forward"), new EventHandler (OnForwardClicked)),
				new ActionEntry ("stop", Gtk.Stock.Stop, null, null, GettextCatalog.GetString ("Stop loading"), new EventHandler (OnStopClicked)),
				new ActionEntry ("reload", Gtk.Stock.Refresh, null, null, GettextCatalog.GetString ("Address"), new EventHandler (OnReloadClicked)),
				new ActionEntry ("go", Gtk.Stock.Ok, null, null, GettextCatalog.GetString ("Load address"), new EventHandler (OnGoUrl))
			};

			ActionGroup ag = new ActionGroup ("navbarGroup");
			ag.Add (actions);

			UIManager uim = new UIManager ();
			uim.InsertActionGroup (ag, 0);
			uim.AddWidget += new AddWidgetHandler (OnAddWidget);
			uim.AddUiFromString (uiInfo);

			ToolItem item = new ToolItem ();
			item.Add (address);
	
			Toolbar tb = uim.GetWidget ("/ui/toolbar") as Toolbar;
			tb.IconSize = size;
			tb.Add (item);
			this.ShowAll ();
		}
コード例 #10
0
        public override void Initialize()
        {
            Logger.Debug("TasksApplicationAddin.Initialize ()");

            if (manager == null)
            {
                lock (locker) {
                    if (manager == null)
                    {
                        manager = new TaskManager(
                            Path.Combine(Tomboy.DefaultNoteManager.NoteDirectoryPath, "Tasks"));
                    }
                }

                ///
                /// Add a "To Do List" to Tomboy's Tray Icon Menu
                ///
                action_group = new Gtk.ActionGroup("Tasks");
                action_group.Add(new Gtk.ActionEntry [] {
                    new Gtk.ActionEntry("ToolsMenuAction", null,
                                        Catalog.GetString("_Tools"), null, null, null),
                    new Gtk.ActionEntry("OpenToDoListAction", null,
                                        Catalog.GetString("To Do List"), null, null,
                                        delegate { OnOpenToDoListAction(); })
                });

                //    tray_icon_ui = Tomboy.ActionManager.UI.AddUiFromString (@"
                //     <ui>
                //      <popup name='TrayIconMenu' action='TrayIconMenuAction'>
                //       <menuitem name='OpenToDoList' action='OpenToDoListAction' />
                //      </popup>
                //     </ui>
                //    ");

                tools_menu_ui = Tomboy.ActionManager.UI.AddUiFromString(@"
				                <ui>
				                <menubar name='MainWindowMenubar'>
				                <placeholder name='MainWindowMenuPlaceholder'>
				                <menu name='ToolsMenu' action='ToolsMenuAction'>
				                <menuitem name='OpenToDoList' action='OpenToDoListAction' />
				                </menu>
				                </placeholder>
				                </menubar>
				                </ui>
				                "                );

                Tomboy.ActionManager.UI.InsertActionGroup(action_group, 0);

                Tomboy.DefaultNoteManager.NoteDeleted += OnNoteDeleted;

                tomboy_tray_menu         = GetTomboyTrayMenu();
                tomboy_tray_menu.Shown  += OnTomboyTrayMenuShown;
                tomboy_tray_menu.Hidden += OnTomboyTrayMenuHidden;

                initialized = true;
            }
        }
コード例 #11
0
ファイル: AdroitUIHandler.cs プロジェクト: chergert/adroit
        void AddAdroitActions(ActionGroup actionGroup)
        {
            var adroit = new Gtk.Action ("adroit", Catalog.GetString ("_Adroit"));
            actionGroup.Add (adroit);

            var quit = new Gtk.Action ("quit", null, null, Gtk.Stock.Quit);
            quit.Activated += delegate { Gtk.Application.Quit (); };
            actionGroup.Add (quit, "<Control>Q");

            var close = new Gtk.Action ("close", null, null, Gtk.Stock.Close);
            close.Activated += delegate { Gtk.Application.Quit (); };
            close.Visible = false;
            actionGroup.Add (close, "<Control>W");

            var export = new Gtk.Action ("export", Catalog.GetString ("_Export"));
            export.Visible = false;
            actionGroup.Add (export, null);
        }
コード例 #12
0
		public override void Initialize ()
		{
			Logger.Debug ("TasksApplicationAddin.Initialize ()");

			if (manager == null) {
				lock (locker) {
					if (manager == null) {
						manager = new TaskManager (
						        Path.Combine (Tomboy.DefaultNoteManager.NoteDirectoryPath, "Tasks"));
					}
				}

				///
				/// Add a "To Do List" to Tomboy's Tray Icon Menu
				///
				action_group = new Gtk.ActionGroup ("Tasks");
				action_group.Add (new Gtk.ActionEntry [] {
					new Gtk.ActionEntry ("ToolsMenuAction", null,
					Catalog.GetString ("_Tools"), null, null, null),
					new Gtk.ActionEntry ("OpenToDoListAction", null,
					Catalog.GetString ("To Do List"), null, null,
					delegate { OnOpenToDoListAction (); })
				});

				//    tray_icon_ui = Tomboy.ActionManager.UI.AddUiFromString (@"
				//     <ui>
				//      <popup name='TrayIconMenu' action='TrayIconMenuAction'>
				//       <menuitem name='OpenToDoList' action='OpenToDoListAction' />
				//      </popup>
				//     </ui>
				//    ");

				tools_menu_ui = Tomboy.ActionManager.UI.AddUiFromString (@"
				                <ui>
				                <menubar name='MainWindowMenubar'>
				                <placeholder name='MainWindowMenuPlaceholder'>
				                <menu name='ToolsMenu' action='ToolsMenuAction'>
				                <menuitem name='OpenToDoList' action='OpenToDoListAction' />
				                </menu>
				                </placeholder>
				                </menubar>
				                </ui>
				                ");

				Tomboy.ActionManager.UI.InsertActionGroup (action_group, 0);

				Tomboy.DefaultNoteManager.NoteDeleted += OnNoteDeleted;

				tomboy_tray_menu = GetTomboyTrayMenu ();
				tomboy_tray_menu.Shown += OnTomboyTrayMenuShown;
				tomboy_tray_menu.Hidden += OnTomboyTrayMenuHidden;

				initialized = true;
			}
		}
コード例 #13
0
ファイル: MainWindow.cs プロジェクト: nerea123/ad
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        ActionGroup actionGroup1 = new ActionGroup("pageActionGroup");

        Gtk.Action newAction = new Gtk.Action("newAction", null, null, Stock.New);
        actionGroup1.Add (newAction);
        Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
        actionGroup1.Add (editAction);
        UIManager.InsertActionGroup(actionGroup1, 0);

        //		uint mergeId = UIManager.AddUiFromString(
        //			"<ui>" +
        //			"<toolbar name='toolbar'>" +
        //			"<toolitem name='newAction' action='newAction'/>" +
        //			"<toolitem name='editAction' action='editAction'/>" +
        //			"</toolbar>" +
        //			"</ui>");

        uint mergeId = UIManager.AddUiFromString( getUi(actionGroup1) );

        Console.WriteLine ("mergeId={0}", mergeId);

        ActionGroup actionGroup2 = new ActionGroup("pageActionGroup");

        Gtk.Action deleteAction = new Gtk.Action("deleteAction", null, null, Stock.Delete);
        actionGroup2.Add (deleteAction);

        executeAction.Activated += delegate {
            Console.WriteLine("executeAction.Activated");

            //Console.WriteLine("UIManager.Ui='{0}'", UIManager.Ui);
            UIManager.RemoveUi (mergeId);
            UIManager.RemoveActionGroup(actionGroup1);

            UIManager.InsertActionGroup(actionGroup2, 0);
            UIManager.AddUiFromString( getUi(actionGroup2) );

        };
    }
コード例 #14
0
		public void ShowWindow ()
		{
			Application.Init ();
			
			gxml = new Glade.XML ("contactviewer.glade", "MainWindow");
			gxml.Autoconnect (this);
			
			ActionEntry[] entries = new ActionEntry [] {
				new ActionEntry ("FileMenuAction", null, "_File", null, null, null),
				new ActionEntry ("OpenAction", Gtk.Stock.Open,
					"_Open", "<control>O", Catalog.GetString ("Open..."), new EventHandler (OnOpenDatabase)),
				new ActionEntry ("QuitAction", Gtk.Stock.Quit,
					"_Quit", "<control>Q", Catalog.GetString ("Quit"), new EventHandler (OnQuit)),
				new ActionEntry ("HelpMenuAction", null, "_Help", null, null, null),
				new ActionEntry ("AboutAction", Gnome.Stock.About,
					"_About", null, Catalog.GetString ("About"), new EventHandler (OnAbout))
			};
			
			ActionGroup grp = new ActionGroup ("MainGroup");
			grp.Add (entries);
			
			ui_manager = new UIManager ();
			ui_manager.InsertActionGroup(grp, 0);
			ui_manager.AddUiFromResource ("menu.xml");
			MenubarHolder.Add (ui_manager.GetWidget ("/MainMenu"));
			
			// Fix the TreeView that will contain all contacts
			contact_store = new ListStore (typeof (string), typeof (string));
			
			ContactList.Model = contact_store;
			ContactList.RulesHint = true;
			ContactList.AppendColumn (Catalog.GetString ("Contacts"), new CellRendererText (), "text", 1);
			ContactList.ButtonReleaseEvent += OnContactSelected;
			
			// This ListStore will let the user choose what to see in the contact list
			contact_show_type_store = new ListStore (typeof (string), typeof (string));
			contact_show_type_store.AppendValues ("DisplayName", Catalog.GetString ("Display name"));
			contact_show_type_store.AppendValues ("PrimaryEmail", Catalog.GetString ("Primary E-mail"));
			contact_show_type_store.AppendValues ("SecondEmail", Catalog.GetString ("Secondary E-mail"));
			contact_show_type_store.AppendValues ("NickName", Catalog.GetString ("Nickname"));
			
			CellRendererText cell = new CellRendererText ();
			ListIdentifier.PackStart (cell, false);
			ListIdentifier.AddAttribute (cell, "text", 1);
			ListIdentifier.Model = contact_show_type_store;
			ListIdentifier.Active = 0;
			ListIdentifier.Changed += OnContactListTypeChanged;
			
			MainWindow.Icon = Beagle.Images.GetPixbuf ("contact-icon.png");
			MainWindow.DeleteEvent += OnDeleteEvent;
			
			LoadDatabase ();
			Application.Run ();
		}
コード例 #15
0
 protected void SetupSpecialActions()
 {
     // This demonstrates a shortcut assigned to an action that is
     // not attached to a menu widget. This particular one is assigned
     // to a textbox entry. I'm not sure that this is the best way
     // to do this, but it seems to work. :)
     Gtk.ActionGroup specialActions = new Gtk.ActionGroup("Special");
     this.specialAction1 = new Gtk.Action("specialAction1", "Special Action 1");
     string accelerator = Gtk.Accelerator.Name((uint)Gdk.Key.j, Gdk.ModifierType.ControlMask);
     specialActions.Add(this.specialAction1, accelerator);
     this.entry1.SetAccelPath(this.specialAction1.AccelPath, this.UIManager.AccelGroup);
     this.entry1.Activated += new System.EventHandler(this.OnSpecialAction1Activated);
     this.UIManager.InsertActionGroup(specialActions, -1);
 }
コード例 #16
0
ファイル: ProjectUIHandler.cs プロジェクト: chergert/adroit
        void AddProjectActions(ActionGroup actionGroup)
        {
            var guiService = ServiceManager.Get<GuiService> ();

            var project = new Gtk.Action ("project", Catalog.GetString ("_Project"));
            actionGroup.Add (project);

            var addproject = new Gtk.Action ("add-project", Catalog.GetString ("_Add Project"), null, Gtk.Stock.Add);
            addproject.Activated += delegate {
                guiService.Window.Planning.AppendProject ();
            };
            actionGroup.Add (addproject, "<Control>plus");

            var removeproject = new Gtk.Action ("remove-project", Catalog.GetString ("_Remove Project"), null, Gtk.Stock.Remove);
            removeproject.Sensitive = false;
            guiService.Window.Planning.ProjectChanged += delegate {
                var p = guiService.Window.Planning.SelectedProject;
                removeproject.Sensitive = p != null && p.Id > 0;
            };
            removeproject.Activated += delegate {
                guiService.Window.Planning.RemoveSelectedProject ();
            };
            actionGroup.Add (removeproject);
        }
コード例 #17
0
        //------------------------------------------------------------------------------
        public MainMenu()
        {
            uim = new Gtk.UIManager();

            Gtk.ActionGroup actions = new Gtk.ActionGroup("MenuBarActions" + Guid.NewGuid());

            actions.Add(getActionEntries());
            uim.InsertActionGroup(actions, 0);

            // Put the XML definition of the controls (widgets) into the UIManager's buffer -and- create controls (widgets).
            uim.AddUiFromString(UI.ToString());

            instance = (Gtk.MenuBar)uim.GetWidget("/menubar");
            instance.ShowAll();
        }
コード例 #18
0
        public LircPlugin()
        {
            actions = new ActionGroup("Lirc");
            ctrl = new ActionMapper(new BansheeController());
            actions.Add(new ActionEntry[] {
                new ActionEntry("LircAction", null, "_Lirc", null,
                                "Configure the Lirc Addin", null),
                new ActionEntry("LircConfigureAction", Stock.Properties, "_Configure",
                                null, "Configure the Lirc addin", OnConfigurePlugin),
            });

            action_service = ServiceManager.Get<InterfaceActionService>("InterfaceActionService");

            action_service.UIManager.InsertActionGroup(actions, 0);
            action_service.UIManager.AddUiFromResource("Ui.xml");
        }
コード例 #19
0
        void IExtensionService.Initialize()
        {
            /*
             * if SavedOrTried = 0, try and download the art
             * if SavedOrTried = 1, we have tried this session
             * if SavedOrTried = 2, art is already in folder
             * if SavedOrTired = 3, we were successful in writing art to folder
             */
            if (!ServiceManager.DbConnection.TableExists ("AlbumArtWriter")) {
                ServiceManager.DbConnection.Execute (@"
                        CREATE TABLE AlbumArtWriter (
                            AlbumID     INTEGER UNIQUE,
                            SavedOrTried INTEGER
                        )");
            DatabaseConfigurationClient.Client.Set<int>("AlbumArtWriter", "Version", 1);
            }
            if (DatabaseConfigurationClient.Client.Get<int> ("AlbumArtWriter", "Version", 0) < 2) {
                ServiceManager.DbConnection.Execute (@"ALTER TABLE AlbumArtWriter ADD COLUMN LastUpdated INTEGER");
                DatabaseConfigurationClient.Client.Set<int>("AlbumArtWriter", "Version", 2);
            }
            if (!ServiceStartup ()) {
                ServiceManager.SourceManager.SourceAdded += OnSourceAdded;
            }

            action_service = ServiceManager.Get<InterfaceActionService> ();

            actions = new ActionGroup ("AlbumArtWriter");

            actions.Add (new ActionEntry [] {
                new ActionEntry ("AlbumArtWriterAction", null,
                    AddinManager.CurrentLocalizer.GetString ("Album Art Writer"), null,
                    null, null),
                new ActionEntry ("AlbumArtWriterConfigureAction", Stock.Properties,
                    AddinManager.CurrentLocalizer.GetString ("_Configure..."), null,
                    AddinManager.CurrentLocalizer.GetString ("Configure the Album Art Writer plugin"), OnConfigure),
                new ActionEntry ("AlbumArtWriterForceAction", Stock.Refresh,
                    AddinManager.CurrentLocalizer.GetString ("Force Copy"), null,
                    AddinManager.CurrentLocalizer.GetString ("Force Recopy of all Album Art"), onForce)
            });

            action_service.UIManager.InsertActionGroup (actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource ("GlobalUI.xml");
        }
コード例 #20
0
ファイル: LocationsBox.cs プロジェクト: konne88/MyInventory
        public LocationsBox (Locations locations, UIManager uiManager)
		: this(new Builder("locations_box.ui"))
        {
			Locations = locations;
			
			// create the actions
			Gtk.Action create = new Gtk.Action("createLocation","Create Location","",Stock.Add);
			create.Activated += OnCreateLocation;
			Gtk.Action delete = new Gtk.Action("deleteLocation","Delete Location","",Stock.Remove);
			delete.Activated += OnDeleteLocation;
			Gtk.Action gotoItem = new Gtk.Action("gotoLocationItem","Goto Item","",Stock.GoForward);
			gotoItem.Activated += OnGotoLocationItem;
			Gtk.Action action = new Gtk.Action("location","Location");
			
			ActionGroup group = new ActionGroup("location");
			group.Add(create);
			group.Add(delete);
			group.Add(gotoItem);
			group.Add(action);
			uiManager.InsertActionGroup(group,0);
			
			// create item column with id
			TreeViewColumn col = new TreeViewColumn ();
			locationsItemColumn = col;
			col.Title = "Item";
			col.Expand = true;
			CellRenderer render;
			render = new CellRendererPixbuf ();
			col.PackStart (render, false);
			col.AddAttribute (render, "pixbuf", 1);
			render = new CellRendererText ();
			(render as CellRendererText).Editable = true;
			render.EditingStarted += OnStartLocationItemEdit;
			col.PackStart (render, true);
			col.AddAttribute (render, "text", 2);
			locationsView.AppendColumn(col);
			locationsView.AppendColumn ("ID", new Gtk.CellRendererText (), "text", 3);
			
			// create the labeled column
			col = new TreeViewColumn ();
			col.Title = "Labeled";
			render = new CellRendererToggle ();
			(render as CellRendererToggle).Toggled += OnLabeledToggle;
			col.PackStart (render, false);
			col.AddAttribute (render, "active", 4);
			col.AddAttribute (render, "activatable", 5);
			locationsView.AppendColumn(col);
			
			// create the amount column
			col    = new TreeViewColumn ();
			col.Title = "Amount";
			render = new CellRendererSpin ();
			(render as CellRendererText).Editable = true;
			(render as CellRendererText).Edited += OnAmountEdited;		
			Adjustment adj = new Adjustment(0, 0, 0, 0, 0, 0);  //set all limits etc to 0
			adj.Upper = 1000000000;  // assign some special values, that aren't 0
			adj.PageIncrement = 10;
			adj.StepIncrement = 1;
			(render as CellRendererSpin).Adjustment = adj;
			col.PackStart (render, false);
			col.AddAttribute (render, "text", 6);
			locationsView.AppendColumn (col);
			
			//set model etc
			locations.CollectionChanged += OnLocationCreation;
			TreeModelFilter filter = new LocationsFilter ( new LocationsModel( locations ));
			filter.Model.RowInserted += OnRowInserted;
			filter.VisibleFunc = new TreeModelFilterVisibleFunc (FilterLocations);
	 		locationsView.Model = filter;
			locationsView.Reorderable = true;
			
			// create the items chooser completion
			locationCompletion = new LocationItemChooser();
			TreeModel compModel = new TreeModelAdapter( new ItemsModel(locations.Inventory.Items));
			locationCompletion.Model = compModel;
			locationCompletion.MatchFunc = LocationItemCompletionMatch;
			locationCompletion.MinimumKeyLength = 0;
			// add the item info cell renderer to the completion	
			render = new CellRendererText ();
			locationCompletion.PackStart (render, true);
			locationCompletion.AddAttribute (render, "text", 2);
			
			// create the popups
			uiManager.AddUiFromResource("locations_box_menues.xml");
			locationPopup = (Menu) uiManager.GetWidget("/locationPopup");
	    }
コード例 #21
0
		void AddActions ()
		{
			ActionEntry[] actions = new ActionEntry[]
				{
					new ActionEntry ("FileMenu", null, "_File", null, null, null),
					new ActionEntry ("PreferencesMenu", null, "_Preferences", null, null, null),
					new ActionEntry ("ColorMenu", null, "_Color", null, null, null),
					new ActionEntry ("ShapeMenu", null, "_Shape", null, null, null),
					new ActionEntry ("HelpMenu", null, "_Help", null, null, null),
					new ActionEntry ("New", Stock.New, "_New", "<control>N", "Create a new file", new EventHandler (ActionActivated)),
					new ActionEntry ("Open", Stock.Open, "_Open", "<control>O", "Open a file", new EventHandler (ActionActivated)),
					new ActionEntry ("Save", Stock.Save, "_Save", "<control>S", "Save current file", new EventHandler (ActionActivated)),
					new ActionEntry ("SaveAs", Stock.SaveAs, "Save _As", null, "Save to a file", new EventHandler (ActionActivated)),
					new ActionEntry ("Quit", Stock.Quit, "_Quit", "<control>Q", "Quit", new EventHandler (ActionActivated)),
					new ActionEntry ("About", null, "_About", "<control>A", "About", new EventHandler (ActionActivated)),
					new ActionEntry ("Logo", "demo-gtk-logo", null, null, "Gtk#", new EventHandler (ActionActivated))
				};

			ToggleActionEntry[] toggleActions = new ToggleActionEntry[]
				{
					new ToggleActionEntry ("Bold", Stock.Bold, "_Bold", "<control>B", "Bold", new EventHandler (ActionActivated), true)
				};

			RadioActionEntry[] colorActions = new RadioActionEntry[]
				{
					new RadioActionEntry ("Red", null, "_Red", "<control>R", "Blood", (int)Color.Red),
					new RadioActionEntry ("Green", null, "_Green", "<control>G", "Grass", (int)Color.Green),
					new RadioActionEntry ("Blue", null, "_Blue", "<control>B", "Sky", (int)Color.Blue)
				};

			RadioActionEntry[] shapeActions = new RadioActionEntry[]
				{
					new RadioActionEntry ("Square", null, "_Square", "<control>S", "Square", (int)Shape.Square),
					new RadioActionEntry ("Rectangle", null, "_Rectangle", "<control>R", "Rectangle", (int)Shape.Rectangle),
					new RadioActionEntry ("Oval", null, "_Oval", "<control>O", "Egg", (int)Shape.Oval)
				};

			ActionGroup group = new ActionGroup ("AppWindowActions");
			group.Add (actions);
			group.Add (toggleActions);
			group.Add (colorActions, (int)Color.Red, new ChangedHandler (RadioActionActivated));
			group.Add (shapeActions, (int)Shape.Square, new ChangedHandler (RadioActionActivated));

			UIManager uim = new UIManager ();
			uim.InsertActionGroup (group, 0);
			uim.AddWidget += new AddWidgetHandler (AddWidget);
			uim.AddUiFromString (uiInfo);

			AddAccelGroup (uim.AccelGroup);
		}
コード例 #22
0
ファイル: UIManager.cs プロジェクト: ArsenShnurkov/beagle-1
        public UIManager(SearchWindow search)
        {
            this.search  = search;
            this.actions = new ActionGroup("Actions");

            ActionEntry quit_action_entry;

            if (search.IconEnabled)
            {
                quit_action_entry = new ActionEntry("Quit", Gtk.Stock.Close,
                                                    null, "<control>Q",
                                                    Catalog.GetString("Close Desktop Search"),
                                                    Quit);
            }
            else
            {
                quit_action_entry = new ActionEntry("Quit", Gtk.Stock.Quit,
                                                    null, "<control>Q",
                                                    Catalog.GetString("Exit Desktop Search"),
                                                    Quit);
            }

            Gtk.ActionEntry[] entries = new ActionEntry[] {
                new ActionEntry("Search", null,
                                Catalog.GetString("_Search"),
                                null, null, null),
                new ActionEntry("Domain", null,
                                Catalog.GetString("Search _Domains"),
                                null, null, null),
                new ActionEntry("Actions", null,
                                Catalog.GetString("_Actions"),
                                null, null, null),
                new ActionEntry("View", null,
                                Catalog.GetString("_View"),
                                null, null, null),
                new ActionEntry("Service", null,
                                Catalog.GetString("Service _Options"),
                                null, null, null),
                new ActionEntry("Help", null,
                                Catalog.GetString("_Help"),
                                null, null, null),
                quit_action_entry,
                new ActionEntry("Preferences", Gtk.Stock.Preferences,
                                null, null,
                                Catalog.GetString("Exit Desktop Search"),
                                Preferences),
                new ActionEntry("StartService", Gtk.Stock.Execute,
                                Catalog.GetString("Start service"),
                                null, null, StartService),
                new ActionEntry("StopService", Gtk.Stock.Stop,
                                Catalog.GetString("Stop service"),
                                null, null, StopService),
                new ActionEntry("IndexInfo", Gtk.Stock.Index,
                                Catalog.GetString("Index information"),
                                null, null, IndexInfo),
                new ActionEntry("Contents", Gtk.Stock.Help,
                                Catalog.GetString("_Contents"),
                                "F1",
                                Catalog.GetString("Help - Table of Contents"),
                                Help),
                new ActionEntry("About", Gnome.Stock.About,
                                null, null,
                                Catalog.GetString("About Desktop Search"),
                                About),
                new ActionEntry("QuickTips", null,
                                Catalog.GetString("Quick Tips"),
                                null, null, QuickTips),
                new ActionEntry("FocusSearchEntry", null, "",
                                "<control>K", null,
                                OnFocusSearchEntry),
                new ActionEntry("FocusSearchEntry2", null, "",
                                "<control>L", null,
                                OnFocusSearchEntry),
                new ActionEntry("HideWindow", null, "",
                                "Escape", null,
                                OnHideWindow),
                new ActionEntry("HideWindow2", null, "",
                                "<control>W", null,
                                OnHideWindow)
            };
            actions.Add(entries);

            sort_entries = new RadioActionEntry[] {
                new RadioActionEntry("SortModified", null,
                                     Catalog.GetString("Sort by Date _Modified"), null,
                                     Catalog.GetString("Sort the most-recently-modified matches first"),
                                     (int)SortType.Modified),
                new RadioActionEntry("SortName", null,
                                     Catalog.GetString("Sort by _Name"), null,
                                     Catalog.GetString("Sort matches by name"),
                                     (int)SortType.Name),
                new RadioActionEntry("SortRelevance", null,
                                     Catalog.GetString("Sort by _Relevance"), null,
                                     Catalog.GetString("Sort the best matches first"),
                                     (int)SortType.Relevance),
            };
            actions.Add(sort_entries, (int)SortType.Modified, OnSortChanged);

            domain_entries = new ToggleActionEntry [] {
                new ToggleActionEntry("Local", null,
                                      Catalog.GetString("_Local"),
                                      null,
                                      Catalog.GetString("Search in personal data in this computer"),                   /* personal files, emails */
                                      OnDomainChanged,
                                      true),
                new ToggleActionEntry("System", null,
                                      Catalog.GetString("_System"),
                                      null,
                                      Catalog.GetString("Search in system data on this computer"),                   /* system manpages, applications */
                                      OnDomainChanged,
                                      true),
                new ToggleActionEntry("Global", null,
                                      Catalog.GetString("_Global"),
                                      null,
                                      Catalog.GetString("Search in internet services"),                   /* gmail and other web services */
                                      OnDomainChanged,
                                      false),
                new ToggleActionEntry("Neighborhood", null,
                                      Catalog.GetString("_Neighborhood"),
                                      null,
                                      Catalog.GetString("Search on computers near me"),                   /* remote beagle services */
                                      OnDomainChanged,
                                      false)
            };
            actions.Add(domain_entries);

            view_entries = new ToggleActionEntry[] {
                new ToggleActionEntry("ShowDetails", null,
                                      Catalog.GetString("Show Details"), null, null,
                                      OnToggleDetails, true)
            };
            actions.Add(view_entries);

            InsertActionGroup(actions, 0);
            search.AddAccelGroup(AccelGroup);
            AddUiFromString(ui_def);
        }
コード例 #23
0
ファイル: MainMenu.cs プロジェクト: Narinyir/crown-tools
        //------------------------------------------------------------------------------
        public MainMenu()
        {
            uim = new Gtk.UIManager ();

            Gtk.ActionGroup actions = new Gtk.ActionGroup ("MenuBarActions" + Guid.NewGuid ());

            actions.Add (getActionEntries ());
            uim.InsertActionGroup (actions, 0);

            // Put the XML definition of the controls (widgets) into the UIManager's buffer -and- create controls (widgets).
            uim.AddUiFromString (UI.ToString ());

            instance = (Gtk.MenuBar)uim.GetWidget ("/menubar");
            instance.ShowAll ();
        }
コード例 #24
0
ファイル: TaskListWindow.cs プロジェクト: shubhtr/tomboy-1
        protected TaskListWindow(TaskManager manager)
            : base(Catalog.GetString("To Do List"))
        {
            this.manager  = manager;
            this.IconName = "tomboy";
            this.SetDefaultSize(500, 300);
            this.sort_column = SortColumn.CompletionDate;

            AddAccelGroup(Tomboy.ActionManager.UI.AccelGroup);

            action_group = new Gtk.ActionGroup("TaskList");
            action_group.Add(new Gtk.ActionEntry [] {
                new Gtk.ActionEntry("TaskListFileMenuAction", null,
                                    Catalog.GetString("_File"), null, null, null),

                new Gtk.ActionEntry("NewTaskAction", Gtk.Stock.New,
                                    Catalog.GetString("New _Task"), "<Control>T",
                                    Catalog.GetString("Create a new task"), null),

                new Gtk.ActionEntry("OpenTaskAction", String.Empty,
                                    Catalog.GetString("_Options..."), "<Control>O",
                                    Catalog.GetString("Open the selected task"), null),

                new Gtk.ActionEntry("CloseTaskListWindowAction", Gtk.Stock.Close,
                                    Catalog.GetString("_Close"), "<Control>W",
                                    Catalog.GetString("Close this window"), null),

                new Gtk.ActionEntry("TaskListEditMenuAction", null,
                                    Catalog.GetString("_Edit"), null, null, null),

                new Gtk.ActionEntry("DeleteTaskAction", Gtk.Stock.Preferences,
                                    Catalog.GetString("_Delete"), "Delete",
                                    Catalog.GetString("Delete the selected task"), null),

                new Gtk.ActionEntry("OpenOriginNoteAction", null,
                                    Catalog.GetString("Open Associated _Note"), null,
                                    Catalog.GetString("Open the note containing the task"), null),

                new Gtk.ActionEntry("TaskListViewMenuAction", null,
                                    Catalog.GetString("_View"), null, null, null),

                new Gtk.ActionEntry("TaskListHelpMenuAction", null,
                                    Catalog.GetString("_Help"), null, null, null),

                new Gtk.ActionEntry("ShowTaskHelpAction", Gtk.Stock.Help,
                                    Catalog.GetString("_Contents"), "F1",
                                    Catalog.GetString("Tasks Help"), null)
            });

            action_group.Add(new Gtk.ToggleActionEntry [] {
                new Gtk.ToggleActionEntry("ShowCompletedTasksAction", null,
                                          Catalog.GetString("Show _Completed Tasks"), null,
                                          Catalog.GetString("Show completed tasks in the list"), null, true),

                new Gtk.ToggleActionEntry("ShowDueDateColumnAction", null,
                                          Catalog.GetString("Show _Due Date Column"), null,
                                          Catalog.GetString("Show the due date column in the list"), null, true),

                new Gtk.ToggleActionEntry("ShowPriorityColumnAction", null,
                                          Catalog.GetString("Show _Priority Column"), null,
                                          Catalog.GetString("Show the priority column in the list"), null, true)
            });

            Tomboy.ActionManager.UI.InsertActionGroup(action_group, 0);

            menu_bar = CreateMenuBar();

            MakeTasksTree();
            tree.Show();

            // Update on changes to tasks
            TaskManager.TaskAdded         += OnTaskAdded;
            TaskManager.TaskDeleted       += OnTaskDeleted;
            TaskManager.TaskStatusChanged += OnTaskStatusChanged;

            tasks_sw                  = new Gtk.ScrolledWindow();
            tasks_sw.ShadowType       = Gtk.ShadowType.In;
            tasks_sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            tasks_sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;

            // Reign in the window size if there are notes with long
            // names, or a lot of notes...

            Gtk.Requisition tree_req = tree.SizeRequest();
            if (tree_req.Height > 420)
            {
                tasks_sw.HeightRequest = 420;
            }

            if (tree_req.Width > 480)
            {
                tasks_sw.WidthRequest = 480;
            }

            tasks_sw.Add(tree);
            tasks_sw.Show();

            task_count        = new Gtk.Label();
            task_count.Xalign = 0;
            task_count.Show();

            Gtk.HBox status_box = new Gtk.HBox(false, 8);
            status_box.PackStart(task_count, true, true, 0);
            status_box.Show();

            Gtk.VBox vbox = new Gtk.VBox(false, 8);
            vbox.BorderWidth = 6;
            vbox.PackStart(tasks_sw, true, true, 0);
            vbox.PackStart(status_box, false, false, 0);
            vbox.Show();

            // Use another VBox to place the MenuBar
            // right at thetop of the window.
            content_vbox = new Gtk.VBox(false, 0);
            content_vbox.PackStart(menu_bar, false, false, 0);
            content_vbox.PackStart(vbox, true, true, 0);
            content_vbox.Show();

            this.Add(content_vbox);
            this.DeleteEvent   += OnDelete;
            this.KeyPressEvent += OnKeyPressed;             // For Escape

            SetUpTreeModel();
        }
コード例 #25
0
ファイル: ViewUIHandler.cs プロジェクト: chergert/adroit
        void AddViewActions(ActionGroup actionGroup)
        {
            var guiService = ServiceManager.Get<GuiService> ();

            var view = new Gtk.Action ("view", Catalog.GetString ("_View"));
            actionGroup.Add (view);

            var planning = new Gtk.RadioAction ("planning", Catalog.GetString ("Planning"), Catalog.GetString ("Select the Planning mode"), null, 0);
            var context = new Gtk.RadioAction ("context", Catalog.GetString ("Context"), Catalog.GetString ("Select the Context mode"), null, 1);
            var calendar = new Gtk.RadioAction ("calendar", Catalog.GetString ("Calendar"), Catalog.GetString ("Select the Calendar mode"), null, 2);

            context.Group = planning.Group;
            calendar.Group = planning.Group;

            planning.CurrentValue = 0;

            guiService.Window.ModeChanged += delegate {
                if (!m_inModeUpdate) {
                    m_inModeUpdate = true;
                    planning.CurrentValue = guiService.Window.Mode;
                    m_inModeUpdate = false;
                }
            };

            planning.Activated += delegate {
                if (!m_inModeUpdate) {
                    m_inModeUpdate = true;
                    guiService.Window.Mode = 0;
                    m_inModeUpdate = false;
                }
            };

            context.Activated += delegate {
                if (!m_inModeUpdate) {
                    m_inModeUpdate = true;
                    guiService.Window.Mode = 1;
                    m_inModeUpdate = false;
                }
            };

            calendar.Activated += delegate {
                if (!m_inModeUpdate) {
                    m_inModeUpdate = true;
                    guiService.Window.Mode = 2;
                    m_inModeUpdate = false;
                }
            };

            actionGroup.Add (planning, "<Alt>1");
            actionGroup.Add (context, "<Alt>2");
            actionGroup.Add (calendar, "<Alt>3");

            var attachments = new Gtk.ToggleAction ("attachments", Catalog.GetString ("Show _Attachments"), Catalog.GetString ("Show attachments"), null);
            attachments.Active = true;
            attachments.Activated += delegate {
                if (attachments.Active)
                    guiService.Window.ShowAttachments ();
                else
                    guiService.Window.HideAttachments ();
            };
            actionGroup.Add (attachments);

            var sidebar = new Gtk.ToggleAction ("sidebar", Catalog.GetString ("Show _Sidebar"), Catalog.GetString ("Show the sidebar"), null);
            sidebar.Active = true;
            sidebar.Activated += delegate {
                if (sidebar.Active)
                    guiService.Window.ShowSidebar ();
                else
                    guiService.Window.HideSidebar ();
            };
            actionGroup.Add (sidebar, "F9");

            var fullscreen = new Gtk.Action ("fullscreen", null, null, Gtk.Stock.Fullscreen);
            actionGroup.Add (fullscreen, "F11");

            var compact = new Gtk.ToggleAction ("compact", Catalog.GetString ("Compact Mode"), Catalog.GetString ("Enable compact mode"), null);
            compact.Active = guiService.Window.Planning.CompactMode;
            compact.Activated += delegate {
                guiService.Window.Planning.CompactMode = compact.Active;
            };
            actionGroup.Add (compact);
        }
コード例 #26
0
        private void InstallInterfaceActions()
        {
            actions = new ActionGroup("Recommendation");

            actions.Add(new ToggleActionEntry [] {
                    new ToggleActionEntry("ShowRecommendationAction", null,
                                  Catalog.GetString("Show Recommendations"), "<control>R",
                                  Catalog.GetString("Show Recommendations"), OnToggleShow, true)
                });

            Globals.ActionManager.UI.InsertActionGroup(actions, 0);
            ui_manager_id = Globals.ActionManager.UI.AddUiFromResource("RecommendationMenu.xml");
        }
コード例 #27
0
        public void InterfaceInitialize ()
        {
            actions = new ActionGroup ("Audioscrobbler");

            actions.Add (new ActionEntry [] {
                new ActionEntry ("AudioscrobblerAction", null,
                    Catalog.GetString ("_Last.fm"), null,
                    Catalog.GetString ("Configure the Audioscrobbler plugin"), null),

                new ActionEntry ("AudioscrobblerVisitAction", null,
                    Catalog.GetString ("Visit _User Profile Page"), null,
                    Catalog.GetString ("Visit Your Last.fm Profile Page"), OnVisitOwnProfile)
            });

            actions.Add (new ToggleActionEntry [] {
                new ToggleActionEntry ("AudioscrobblerEnableAction", null,
                    Catalog.GetString ("_Enable Song Reporting"), "<control>U",
                    Catalog.GetString ("Enable song reporting"), OnToggleEnabled, Enabled)
            });

            action_service.UIManager.InsertActionGroup (actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource ("AudioscrobblerMenu.xml");

            actions["AudioscrobblerVisitAction"].Sensitive = account.UserName != null && account.UserName != String.Empty;
        }
コード例 #28
0
        private bool SetupInterfaceActions()
        {
            action_service = ServiceManager.Get<InterfaceActionService> ();

            if (action_service.FindActionGroup ("ClutterFlowView") == null) {
                clutterflow_actions = new ActionGroup ("ClutterFlowView");

                ToggleActionEntry [] tae = new ToggleActionEntry [] { new ToggleActionEntry ("ClutterFlowVisibleAction", null,
                    AddinManager.CurrentLocalizer.GetString ("Show ClutterFlow Browser"), null,
                    AddinManager.CurrentLocalizer.GetString ("Show or hide the ClutterFlow browser"),
                    null, ClutterFlowSchemas.ShowClutterFlow.Get ()) };
                clutterflow_actions.Add (tae);

                action_service.AddActionGroup (clutterflow_actions);
                ui_manager_id = action_service.UIManager.AddUiFromString (menu_xml);
            }

            source_manager.ActiveSourceChanged += HandleActiveSourceChanged;

            BrowserAction.Activated += OnToggleBrowser;
            CfBrowsAction.Activated += OnToggleClutterFlow;

            return true;
        }
コード例 #29
0
		void CreateMenu ()
		{
			if (menu == null)
			{
				ActionGroup group = new ActionGroup ("Popup");

				Gtk.Action copy = new Gtk.Action ("copy", GettextCatalog.GetString ("_Copy"),
				                          GettextCatalog.GetString ("Copy comment task"), Gtk.Stock.Copy);
				copy.Activated += new EventHandler (OnGenTaskCopied);
				group.Add (copy, "<Control><Mod2>c");

				Gtk.Action jump = new Gtk.Action ("jump", GettextCatalog.GetString ("_Go to"),
				                          GettextCatalog.GetString ("Go to comment task"), Gtk.Stock.JumpTo);
				jump.Activated += new EventHandler (OnGenTaskJumpto);
				group.Add (jump);

				Gtk.Action delete = new Gtk.Action ("delete", GettextCatalog.GetString ("_Delete"),
				                          GettextCatalog.GetString ("Delete comment task"), Gtk.Stock.Delete);
				delete.Activated += new EventHandler (OnGenTaskDelete);
				group.Add (delete);

				Gtk.Action columns = new Gtk.Action ("columns", GettextCatalog.GetString ("Columns"));
				group.Add (columns, null);

				ToggleAction columnLine = new ToggleAction ("columnLine", GettextCatalog.GetString ("Line"),
				                                            GettextCatalog.GetString ("Toggle visibility of Line column"), null);
				columnLine.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnLine] = (int)Columns.Line;
				group.Add (columnLine);

				ToggleAction columnDescription = new ToggleAction ("columnDescription", GettextCatalog.GetString ("Description"),
				                                            GettextCatalog.GetString ("Toggle visibility of Description column"), null);
				columnDescription.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnDescription] = (int)Columns.Description;
				group.Add (columnDescription);

				ToggleAction columnFile = new ToggleAction ("columnFile", GettextCatalog.GetString ("File"),
				                                            GettextCatalog.GetString ("Toggle visibility of File column"), null);
				columnFile.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnFile] = (int)Columns.File;
				group.Add (columnFile);

				ToggleAction columnPath = new ToggleAction ("columnPath", GettextCatalog.GetString ("Path"),
				                                            GettextCatalog.GetString ("Toggle visibility of Path column"), null);
				columnPath.Toggled += new EventHandler (OnColumnVisibilityChanged);
				columnsActions[columnPath] = (int)Columns.Path;
				group.Add (columnPath);

				UIManager uiManager = new UIManager ();
				uiManager.InsertActionGroup (group, 0);
				
				string uiStr = "<ui><popup name='popup'>"
					+ "<menuitem action='copy'/>"
					+ "<menuitem action='jump'/>"
					+ "<menuitem action='delete'/>"
					+ "<separator/>"
					+ "<menu action='columns'>"
					+ "<menuitem action='columnLine' />"
					+ "<menuitem action='columnDescription' />"
					+ "<menuitem action='columnFile' />"
					+ "<menuitem action='columnPath' />"
					+ "</menu>"
					+ "</popup></ui>";

				uiManager.AddUiFromString (uiStr);
				menu = (Menu)uiManager.GetWidget ("/popup");
				menu.ShowAll ();

				menu.Shown += delegate (object o, EventArgs args)
				{
					columnLine.Active = view.Columns[(int)Columns.Line].Visible;
					columnDescription.Active = view.Columns[(int)Columns.Description].Visible;
					columnFile.Active = view.Columns[(int)Columns.File].Visible;
					columnPath.Active = view.Columns[(int)Columns.Path].Visible;
					copy.Sensitive = jump.Sensitive = delete.Sensitive =
						view.Selection != null &&
						view.Selection.CountSelectedRows () > 0 &&
						(columnLine.Active ||
						columnDescription.Active ||
						columnFile.Active ||
						columnPath.Active);
				};
			}
		}
コード例 #30
0
ファイル: ErrorListPad.cs プロジェクト: segaman/monodevelop
		Gtk.Menu CreateMenu ()
		{
			if (menu != null)
				return menu;
			
			var group = new ActionGroup ("Popup");

			var help = new Gtk.Action ("help", GettextCatalog.GetString ("Show Error Reference"),
				GettextCatalog.GetString ("Show Error Reference"), Gtk.Stock.Help);
			help.Activated += OnShowReference;
			group.Add (help, "F1");

			var copy = new Gtk.Action ("copy", GettextCatalog.GetString ("_Copy"),
				GettextCatalog.GetString ("Copy task"), Gtk.Stock.Copy);
			copy.Activated += OnTaskCopied;
			group.Add (copy, "<Control><Mod2>c");

			var jump = new Gtk.Action ("jump", GettextCatalog.GetString ("_Go to"),
				GettextCatalog.GetString ("Go to task"), Gtk.Stock.JumpTo);
			jump.Activated += OnTaskJumpto;
			group.Add (jump);

			var columns = new Gtk.Action ("columns", GettextCatalog.GetString ("Columns"));
			group.Add (columns, null);

			var columnType = new ToggleAction ("columnType", GettextCatalog.GetString ("Type"),
				GettextCatalog.GetString ("Toggle visibility of Type column"), null);
			columnType.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnType] = VisibleColumns.Type;
			group.Add (columnType);

			var columnValidity = new ToggleAction ("columnValidity", GettextCatalog.GetString ("Validity"),
				GettextCatalog.GetString ("Toggle visibility of Validity column"), null);
			columnValidity.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnValidity] = VisibleColumns.Marked;
			group.Add (columnValidity);

			var columnLine = new ToggleAction ("columnLine", GettextCatalog.GetString ("Line"),
				GettextCatalog.GetString ("Toggle visibility of Line column"), null);
			columnLine.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnLine] = VisibleColumns.Line;
			group.Add (columnLine);

			var columnDescription = new ToggleAction ("columnDescription", GettextCatalog.GetString ("Description"),
				GettextCatalog.GetString ("Toggle visibility of Description column"), null);
			columnDescription.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnDescription] = VisibleColumns.Description;
			group.Add (columnDescription);

			var columnFile = new ToggleAction ("columnFile", GettextCatalog.GetString ("File"),
				GettextCatalog.GetString ("Toggle visibility of File column"), null);
			columnFile.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnFile] = VisibleColumns.File;
			group.Add (columnFile);

			var columnProject = new ToggleAction ("columnProject", GettextCatalog.GetString ("Project"),
				GettextCatalog.GetString ("Toggle visibility of Project column"), null);
			columnProject.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnProject] = VisibleColumns.Project;
			group.Add (columnProject);

			var columnPath = new ToggleAction ("columnPath", GettextCatalog.GetString ("Path"),
				GettextCatalog.GetString ("Toggle visibility of Path column"), null);
			columnPath.Toggled += OnColumnVisibilityChanged;
			columnsActions[columnPath] = VisibleColumns.Path;
			group.Add (columnPath);

			var uiManager = new UIManager ();
			uiManager.InsertActionGroup (group, 0);
			
			string uiStr = "<ui><popup name='popup'>"
				+ "<menuitem action='help'/>"
				+ "<menuitem action='copy'/>"
				+ "<menuitem action='jump'/>"
				+ "<separator/>"
				+ "<menu action='columns'>"
				+ "<menuitem action='columnType' />"
				+ "<menuitem action='columnValidity' />"
				+ "<menuitem action='columnLine' />"
				+ "<menuitem action='columnDescription' />"
				+ "<menuitem action='columnFile' />"
				+ "<menuitem action='columnProject' />"
				+ "<menuitem action='columnPath' />"
				+ "</menu>"
				+ "</popup></ui>";

			uiManager.AddUiFromString (uiStr);
			menu = (Menu)uiManager.GetWidget ("/popup");
			menu.ShowAll ();

			menu.Shown += delegate {
				columnType.Active = view.Columns[VisibleColumns.Type].Visible;
				columnValidity.Active = view.Columns[VisibleColumns.Marked].Visible;
				columnLine.Active = view.Columns[VisibleColumns.Line].Visible;
				columnDescription.Active = view.Columns[VisibleColumns.Description].Visible;
				columnFile.Active = view.Columns[VisibleColumns.File].Visible;
				columnProject.Active = view.Columns[VisibleColumns.Project].Visible;
				columnPath.Active = view.Columns[VisibleColumns.Path].Visible;
				help.Sensitive = copy.Sensitive = jump.Sensitive =
					view.Selection != null &&
					view.Selection.CountSelectedRows () > 0 &&
					(columnType.Active ||
						columnValidity.Active ||
						columnLine.Active ||
						columnDescription.Active ||
						columnFile.Active ||
						columnPath.Active);
			};
			
			return menu;
		}
コード例 #31
0
ファイル: Application.cs プロジェクト: nolith/tasque
        private void RegisterUIManager()
        {
            ActionGroup trayActionGroup = new ActionGroup ("Tray");
            trayActionGroup.Add (new ActionEntry [] {
                new ActionEntry ("NewTaskAction",
                                 Stock.New,
                                 Catalog.GetString ("New Task ..."),
                                 null,
                                 null,
                                 OnNewTask),

                new ActionEntry ("ShowTasksAction",
                                 null,
                                 Catalog.GetString ("Show Tasks ..."),
                                 null,
                                 null,
                                 OnShowTaskWindow),

                new ActionEntry ("AboutAction",
                                 Stock.About,
                                 OnAbout),

                new ActionEntry ("PreferencesAction",
                                 Stock.Preferences,
                                 OnPreferences),

                new ActionEntry ("RefreshAction",
                                 Stock.Execute,
                                 Catalog.GetString ("Refresh Tasks ..."),
                                 null,
                                 null,
                                 OnRefreshAction),

                new ActionEntry ("QuitAction",
                                 Stock.Quit,
                                 OnQuit)
            });

            uiManager = new UIManager ();
            uiManager.AddUiFromString (menuXml);
            uiManager.InsertActionGroup (trayActionGroup, 0);
        }
コード例 #32
0
        void IExtensionService.Initialize()
        {
            Hyena.Log.Debug ("Initializing LCD service");

            action_service = ServiceManager.Get<InterfaceActionService> ();
            actions = new ActionGroup ("LCD");
            actions.Add (new ActionEntry [] {
                new ActionEntry ("LCDAction", null,
                    AddinManager.CurrentLocalizer.GetString ("LCD"), null,
                    null, null),
                new ActionEntry ("LCDConfigureAction", Stock.Properties,
                    AddinManager.CurrentLocalizer.GetString ("_Configure..."), null,
                    AddinManager.CurrentLocalizer.GetString ("Configure the LCD plugin"), OnConfigure)
            });
            action_service.UIManager.InsertActionGroup (actions, 0);
            ui_manager_id = action_service.UIManager.AddUiFromResource ("LCDMenu.xml");

            ScreensCreate();

            lcdclient = new LCDClient(Host, Port);
            lcdclient.Connected += OnConnected;
            parser = new LCDParser();
            ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent,
                PlayerEvent.Iterate |
                PlayerEvent.StartOfStream |
                PlayerEvent.EndOfStream |
                PlayerEvent.TrackInfoUpdated |
                PlayerEvent.StateChange);
        }
コード例 #33
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public MenuManager()
        {
            ActionEntry[] entries = new ActionEntry[] {
                new ActionEntry("FileMenu", null, "_File", null, null, null),
                new ActionEntry("ViewMenu", null, "_View", null, null, null),
                new ActionEntry("GoMenu", null, "_Go", null, null, null),
                new ActionEntry("ToolMenu", null, "_Tool", null, null, null),
                new ActionEntry("NetworkMenu", null, "_Network", null, null, null),
                new ActionEntry("HelpMenu", null, "_Help", null, null, null),

                // File Menu
                new ActionEntry("ProxySettings", "Proxy", "Proxy Settings", null,
                                "Setup Proxy", new EventHandler(ActionActivated)),
                new ActionEntry("Logout", "Logout", "Logout", null,
                                "Logout", new EventHandler(ActionActivated)),
                new ActionEntry("Quit", Gtk.Stock.Quit, "Quit", "<control>Q",
                                "Quit Shared Folder", new EventHandler(ActionActivated)),
                // View Menu
                new ActionEntry("Refresh", Gtk.Stock.Refresh, "Refresh", null,
                                null, new EventHandler(ActionActivated)),

                // Go Menu
                new ActionEntry("GoUp", Gtk.Stock.GoUp, "UP", null,
                                "Open The Parent Folder", new EventHandler(ActionActivated)),
                new ActionEntry("GoHome", Gtk.Stock.Home, "Home", null,
                                "Open The Root Directory", new EventHandler(ActionActivated)),
                new ActionEntry("GoMyFolder", "StockMyFolder", "MyFolder", null,
                                "My Shared Folder", new EventHandler(ActionActivated)),
                new ActionEntry("GoNetwork", "StockNetwork", "Network", null,
                                "View Network", new EventHandler(ActionActivated)),
                // Network
                new ActionEntry("SetPort", Gtk.Stock.Preferences, "Set P2P Port", null,
                                "Set P2P Port", new EventHandler(ActionActivated)),
                new ActionEntry("AddPeer", Gtk.Stock.Network, "Add Peer", null,
                                "Add New Peer", new EventHandler(ActionActivated)),
                new ActionEntry("RmPeer", Gtk.Stock.Delete, "Remove Peer", null,
                                "Remove Peer", new EventHandler(ActionActivated)),
                new ActionEntry("DownloadManager", "Download", "Download Manager", null,
                                "Download Manager", new EventHandler(ActionActivated)),
                // Help Menu
                new ActionEntry("About", Gtk.Stock.About, "About", null,
                                "About Shared Folder", new EventHandler(ActionActivated)),
            };

            // Toggle items
            ToggleActionEntry[] toggleEntries = new ToggleActionEntry[] {
                // View
                new ToggleActionEntry("ViewToolBar", null, "ToolBar", null,
                                        null, new EventHandler(ActionActivated), true),
                new ToggleActionEntry("ViewUserPanel", null, "User Panel", null,
                                        null, new EventHandler(ActionActivated), true),
                // Network
                new ToggleActionEntry("NetOnline", null, "Online", null,
                                        null, new EventHandler(ActionActivated), false)
            };

            actionGroup = new ActionGroup("group");
            actionGroup.Add(entries);
            actionGroup.Add(toggleEntries);
            InsertActionGroup(actionGroup, 0);
            AddUiFromString(uiInfo);
        }
コード例 #34
0
		public FullScreenView (IBrowsableCollection collection) : base ("Full Screen Mode")
		{
			Name = "FullscreenContainer";
			try {
				//scroll = new Gtk.ScrolledWindow (null, null);
				actions = new ActionGroup ("joe");
				
				actions.Add (new ActionEntry [] {
					new ActionEntry (HideToolbar, Stock.Close, 
							 Catalog.GetString ("Hide"), 
							 null, 
							 Catalog.GetString ("Hide Toolbar"), 
							 HideToolbarAction),
					new ActionEntry (ExitFullScreen, 
							 "f-spot-view-restore", 
							 Catalog.GetString ("Exit fullscreen"), 
							 null, 
							 null, 
							 ExitAction),
					new ActionEntry (SlideShow,
							 "f-spot-slideshow",
							 Catalog.GetString ("Slideshow"),
							 null,
							 Catalog.GetString ("Start slideshow"),
							 SlideShowAction),
						});

				actions.Add (new ToggleActionEntry [] {
					new ToggleActionEntry (Info,
							       Stock.Info,
							       Catalog.GetString ("Info"),
							       null,
							       Catalog.GetString ("Image Information"),
							       InfoAction,
							       false)
						});
				
				new Fader (this, 1.0, 3);
				notebook = new Notebook ();
				notebook.ShowBorder = false;
				notebook.ShowTabs = false;
				notebook.Show ();

				scroll = new ScrolledView ();
				view = new PhotoImageView (collection);
				// FIXME this should be handled by the new style setting code
				view.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				view.PointerMode = ImageView.PointerModeType.Scroll;
				this.Add (notebook);
				view.Show ();
				view.MotionNotifyEvent += HandleViewMotion;
				
				Action rotate_left = new RotateLeftAction (view.Item);
				actions.Add (rotate_left);
				
				Action rotate_right = new RotateRightAction (view.Item);
				actions.Add (rotate_right);

				scroll.ScrolledWindow.Add (view);
				HBox hhbox = new HBox ();
				hhbox.PackEnd (GetButton (HideToolbar), false, true, 0);
				hhbox.PackEnd (GetButton (Info), false, true, 0);
				hhbox.PackStart (GetButton (ExitFullScreen, true), false, false, 0);
				hhbox.PackStart (Add (new PreviousPictureAction (view.Item)), false, false, 0);
				hhbox.PackStart (GetButton (SlideShow), false, true, 0);
				hhbox.PackStart (Add (new NextPictureAction (view.Item)), false, false, 0);
				//hhbox.PackStart (Add (new AutoColor (view.Item)), false, false, 0);

				display = new TextureDisplay (view.Item);
				display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
				display.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				display.MotionNotifyEvent += HandleViewMotion;
				Label effect = new Label (Catalog.GetString ("Slide transition: "));
				hhbox.PackStart (effect, false, false, 5);
				hhbox.PackStart (display.GetCombo (), false, false, 0);
				display.Show ();

				hhbox.PackStart (Add (new RotateLeftAction (view.Item)), false, false, 0);
				hhbox.PackStart (Add (new RotateRightAction (view.Item)), false, false, 0);
				hhbox.BorderWidth = 15;

				tag_view = new TagView ();
				hhbox.PackStart (tag_view, false, false, 0);

				//display = new ImageDisplay (view.Item);

				notebook.AppendPage (scroll, null);
				notebook.AppendPage (display, null);

				hhbox.ShowAll ();
				//scroll.ShowControls ();
				
				scroll.Show ();
				this.Decorated = false;
				this.Fullscreen ();
				this.ButtonPressEvent += HandleButtonPressEvent;
				
				view.Item.Changed += HandleItemChanged;
				view.GrabFocus ();
				
				controls = new ControlOverlay (this);
				controls.Add (hhbox);
				controls.Dismiss ();

				notebook.CurrentPage = 0;
			} catch (System.Exception e) {
				System.Console.WriteLine (e);
			}	

		}
コード例 #35
0
        private void InstallInterfaceActions()
        {
            actions = new ActionGroup("Mirage Playlist Generator");

            actions.Add(new ActionEntry [] {
                    new ActionEntry ("MirageAction", null,
                        AddinManager.CurrentLocalizer.GetString ("Mirage Playlist Generator"), null,
                        AddinManager.CurrentLocalizer.GetString ("Manage the Mirage extension"), null),

                    new ActionEntry("MirageRescanMusicAction", null,
                        AddinManager.CurrentLocalizer.GetString ("Rescan the Music Library"), null,
                        AddinManager.CurrentLocalizer.GetString ("Rescans the Music Library for new songs"),
                        OnMirageRescanMusicHandler),

                    new ActionEntry("MirageDuplicateSearchAction", null,
                        AddinManager.CurrentLocalizer.GetString ("Duplicate Search (Experimental)"), null,
                        AddinManager.CurrentLocalizer.GetString ("Searches your Music Library for possible duplicates"),
                        OnMirageDuplicateSearchHandler),

                    new ActionEntry("MirageResetAction", null,
                        AddinManager.CurrentLocalizer.GetString ("Reset Mirage"), null,
                        AddinManager.CurrentLocalizer.GetString ("Resets the Mirage Playlist Generation Plugin. "+
                            "All songs have to be analyzed again to use Automatic Playlist Generation."),
                        OnMirageResetHandler),
                    });

            action_service.UIManager.InsertActionGroup(actions, 0);
            uiManagerId = action_service.UIManager.AddUiFromResource("MirageMenu.xml");
        }
コード例 #36
0
ファイル: GtkTray.cs プロジェクト: GNOME/tasque
        void RegisterUIManager()
        {
            var newTaskAction = new ActionEntry ("NewTaskAction", Stock.New,
                Catalog.GetString ("New Task ..."), null, null, delegate {
                // Show the TaskWindow and then cause a new task to be created
                TaskWindow.ShowWindow (application);
                TaskWindow.GrabNewTaskEntryFocus (application);
            });

            var refreshAction =	new ActionEntry ("RefreshAction", Stock.Execute,
                Catalog.GetString ("Refresh Tasks ..."), null, null,
                delegate { application.BackendManager.ReInitializeBackend ();
            });

            var trayActionGroup = new ActionGroup ("Tray");
            trayActionGroup.Add (new ActionEntry [] {
                newTaskAction,
                new ActionEntry ("AboutAction", Stock.About, OnAbout),
                new ActionEntry ("PreferencesAction", Stock.Preferences,
                                 delegate { application.ShowPreferences (); }),
                refreshAction,
                new ActionEntry ("QuitAction", Stock.Quit,
                                 delegate { application.Exit (); })
            });

            ToggleTaskWindowAction = new Gtk.Action ("ToggleTaskWindowAction", Catalog.GetString ("Toggle Task Window"));
            ToggleTaskWindowAction.ActionGroup = trayActionGroup;
            ToggleTaskWindowAction.Activated += delegate { TaskWindow.ToggleWindowVisible (application); };

            uiManager = new UIManager ();
            uiManager.AddUiFromString (MenuXml);
            uiManager.InsertActionGroup (trayActionGroup, 0);

            SwitchBackendItems (false);
        }