/* uimanager.vala * * Copyright (C) 2008 Nicolas Joseph * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Author: * Nicolas Joseph */ using Gtk; public class Valide.UIManager : Gtk.UIManager { private ActionGroup action_group; private ActionGroup document_action_group; construct { ToggleAction ta; action_group = new ActionGroup ("general"); document_action_group = new ActionGroup ("document"); /* File menu */ action_group.add_action (new Action ("file", "_File", null, null)); action_group.add_action_with_accel (new Action ("file-new", "_New file", "Create new source file", "gtk-new"), null); action_group.add_action_with_accel (new Action ("file-open", "_Open file", "Open source file", "gtk-open"), null); action_group.add_action_with_accel (new Action ("file-save", "_Save file", "Save source file", "gtk-save"), null); action_group.add_action_with_accel (new Action ("file-save-as", "_Save as file", "Save as source file", "gtk-save-as"), null); action_group.add_action_with_accel (new Action ("file-close", "_Close file", "Close source file", "gtk-close"), null); action_group.add_action_with_accel (new Action ("file-close-all", "_Close all files", "Close all sources files", null), null); action_group.add_action_with_accel (new Action ("quit", "_Quit", "Quit application", "gtk-quit"), null); /* Project menu */ action_group.add_action (new Action ("project", "_Project", null, null)); action_group.add_action_with_accel (new Action ("project-new", "_New project", "Create new project", "gtk-new"), "N"); action_group.add_action_with_accel (new Action ("project-open", "_Open project", "Open project", "gtk-open"), "O"); action_group.add_action_with_accel (new Action ("project-save", "_Save project", "Save project", "gtk-save"), "S"); action_group.add_action_with_accel (new Action ("project-save-as", "_Save as project", "Save as project", "gtk-save-as"), null); action_group.add_action_with_accel (new Action ("project-close", "_Close project", "Close project", "gtk-close"), "W"); action_group.add_action_with_accel (new Action ("project-close-all", "_Close all projects", "Close all projects", null), null); /* Help menu */ action_group.add_action (new Action ("help", "_Help", null, null)); action_group.add_action (new Action ("help-about", null, "About this application", "gtk-about")); insert_action_group (action_group, 0); insert_action_group (document_action_group, 0); } }