2 * app_debug - zavai debug menus
4 * Copyright (C) 2009 Enrico Zini <enrico@enricozini.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 public class Useless : Applet
30 pack_start(new Gtk.Label("This has no use"), false, false, 0);
34 public class UselessService : Service
36 public UselessService()
38 Object(name: "app.debug.useless_service");
42 public class Quitter : Applet
49 public override void start()
56 class Quitter(gtk.Action):
57 def __init__(self, **kw):
58 super(Quitter, self).__init__("menu.main.debug.quit", _("Quit"), None, None)
60 self.connect("activate", gtk.main_quit)
65 //label_on = "Stop useless service";
66 //label_off = "Start useless service";
68 var useless = new Useless();
69 var quitter = new Quitter();
70 var useless_service = new UselessService();
71 zavai.registry.register_applet("app.debug.useless", useless);
72 zavai.registry.register_service(useless_service);
73 zavai.registry.register_applet("app.debug.quit", quitter);
76 var menu_debug = new zavai.Menu("Debug");
77 menu_debug.add_applet("app.debug.useless");
78 menu_debug.add_service_toggle("app.debug.useless_service", "Start useless service", "Stop useless service");
79 menu_debug.add_applet("app.debug.quit");
81 zavai.registry.register_menu("menu.debug", menu_debug);
82 zavai.registry.getmenu("menu.main").add_applet("menu.debug");