/* * app_debug - zavai debug menus * * Copyright (C) 2009 Enrico Zini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace zavai { namespace ui { namespace debug { public class Useless : Applet { public Useless() { _label = "Useless"; pack_start(new Gtk.Label("This has no use"), false, false, 0); } } public class UselessService : Service { public UselessService() { name = "app.debug.useless_service"; } } public class Quitter : Applet { public Quitter() { _label = "Quit"; } public override void start() { Gtk.main_quit(); } } /* class Quitter(gtk.Action): def __init__(self, **kw): super(Quitter, self).__init__("menu.main.debug.quit", _("Quit"), None, None) self.connect("activate", gtk.main_quit) */ void init() { //label_on = "Stop useless service"; //label_off = "Start useless service"; // Apps var useless = new Useless(); var quitter = new Quitter(); var useless_service = new UselessService(); zavai.registry.register_applet("app.debug.useless", useless); zavai.registry.register_service(useless_service); zavai.registry.register_applet("app.debug.quit", quitter); // Menus var menu_debug = new zavai.Menu("Debug"); menu_debug.add_applet("app.debug.useless"); menu_debug.add_service_toggle("app.debug.useless_service", "Start useless service", "Stop useless service"); menu_debug.add_applet("app.debug.quit"); zavai.registry.register_menu("menu.debug", menu_debug); zavai.registry.getmenu("menu.main").add_applet("menu.debug"); } } } }